{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Compare · 5+ Keywords, Regions & Related",
    "description": "Google Trends scraper for keyword research and market research: compare more than the five keywords Google allows, on one 0-100 scale through anchor normalization. Interest over time, interest by region and related queries per keyword. Empty runs cost nothing.",
    "version": "0.1",
    "x-build-id": "SpMRZDcGPyMn75E3w"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/thequietstack~google-trends-compare/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-thequietstack-google-trends-compare",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/thequietstack~google-trends-compare/runs": {
      "post": {
        "operationId": "runs-sync-thequietstack-google-trends-compare",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/thequietstack~google-trends-compare/run-sync": {
      "post": {
        "operationId": "run-sync-thequietstack-google-trends-compare",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "keywords"
        ],
        "properties": {
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Search terms to compare. Any number up to 200 keyword/location pairs: more than 5 are split into several Google requests and put on one common scale through an anchor keyword.",
            "items": {
              "type": "string"
            }
          },
          "geos": {
            "title": "Locations",
            "type": "array",
            "description": "Leave empty for worldwide. Country codes (US, DE), regions (DE-BY, US-CA) or US metros (US-CA-807). Several locations compare every keyword in every location on the same scale.",
            "items": {
              "type": "string"
            }
          },
          "splitGeoIntoRegions": {
            "title": "Split each country into its regions",
            "type": "boolean",
            "description": "Replaces each country by all its regions before comparing, e.g. DE -> the 16 German federal states, US -> 51 states. Every keyword then gets one time series per region, all on one scale.",
            "default": false
          },
          "timeRange": {
            "title": "Time range",
            "type": "string",
            "description": "now 1-H, now 4-H, now 1-d, now 7-d, today 1-m, today 3-m, today 12-m, today 5-y, all - or a custom range \"YYYY-MM-DD YYYY-MM-DD\" (from 2004 on).",
            "default": "today 12-m"
          },
          "anchorKeyword": {
            "title": "Anchor keyword (optional)",
            "type": "string",
            "description": "Used in every Google request to link them to one scale. Default: your first keyword in the first location. Best: a term of medium popularity compared with the others - a tiny anchor makes the scaling imprecise (shown in scaling.precision)."
          },
          "anchorGeo": {
            "title": "Anchor location (optional)",
            "type": "string",
            "description": "Location of the anchor keyword. Default: your first location."
          },
          "includeRegions": {
            "title": "Interest by region",
            "type": "boolean",
            "description": "One extra row per keyword/location with Google's interest by sub-region (e.g. federal states or cities). Charged as region-breakdown only when Google returns regions.",
            "default": false
          },
          "regionResolution": {
            "title": "Region level",
            "enum": [
              "auto",
              "COUNTRY",
              "REGION",
              "DMA"
            ],
            "type": "string",
            "description": "auto = Google's default for the location (countries for worldwide, regions/states for a country). DMA gives US metro areas (US locations only).",
            "default": "auto"
          },
          "includeRelatedQueries": {
            "title": "Related queries (top + rising)",
            "type": "boolean",
            "description": "One extra row per keyword/location with Google's top and rising related queries (rising with growth % or Breakout). Charged as related-queries only when Google returns at least one.",
            "default": false
          },
          "searchType": {
            "title": "Google property",
            "enum": [
              "web",
              "images",
              "news",
              "shopping",
              "youtube"
            ],
            "type": "string",
            "description": "Which Google search to measure.",
            "default": "web"
          },
          "category": {
            "title": "Category ID",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category (0 = all categories). Example: 71 Food & Drink, 5 Computers & Electronics.",
            "default": 0
          },
          "includeTimeline": {
            "title": "Include the full timeline",
            "type": "boolean",
            "description": "Adds every data point (date, value on the common scale, Google's raw value, partial flag). Off = only the summary numbers per keyword.",
            "default": true
          },
          "requestDelaySecs": {
            "title": "Pause between requests (seconds)",
            "minimum": 1,
            "type": "number",
            "description": "Minimum pause between two requests to Google. Minimum 1.",
            "default": 1.5
          },
          "maxRunMinutes": {
            "title": "Stop after (minutes)",
            "minimum": 1,
            "type": "integer",
            "description": "The run stops cleanly after this time and delivers everything collected so far. No silent 20-minute hangs.",
            "default": 20
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}