{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends API & Scraper — pytrends Alternative",
    "description": "Google Trends interest over time, interest by region, and related queries (top + rising) for any keyword, country, time range or explore URL. Direct API, automatic 429 retry, and you only pay for results that contain data.",
    "version": "0.1",
    "x-build-id": "sSC9id4GT3wtx3Tq8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/westerly_breaker~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-westerly_breaker-google-trends-scraper",
        "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/westerly_breaker~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-westerly_breaker-google-trends-scraper",
        "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/westerly_breaker~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-westerly_breaker-google-trends-scraper",
        "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",
        "properties": {
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords to look up, e.g. [\"bitcoin\", \"ethereum\"]. Each term becomes its own result row unless 'compareTerms' is on. Max 500 queries per run. Commas are not allowed inside a term (Google uses them to separate compared terms).",
            "items": {
              "type": "string"
            }
          },
          "compareTerms": {
            "title": "Compare terms against each other",
            "type": "boolean",
            "description": "Off (default): every term is queried alone, so each term's values are scaled 0-100 against its own peak. On: terms are compared in groups of up to 5 (Google's limit), all on one shared 0-100 scale, and each group is one result row.",
            "default": false
          },
          "startUrls": {
            "title": "Google Trends explore URLs",
            "type": "array",
            "description": "Optional. Paste Google Trends explore URLs, e.g. https://trends.google.com/trends/explore?q=bitcoin,ethereum&geo=US&date=today%203-m. Each URL is one result row and keeps its own terms, location, time range, category and property; the settings below do not apply to it.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "geo": {
            "title": "Location",
            "type": "string",
            "description": "Leave empty for worldwide. Otherwise an ISO 3166 country code (\"US\", \"DE\", \"HU\"), a region (\"US-CA\"), or a US metro area (\"US-CA-807\").",
            "default": ""
          },
          "timeRange": {
            "title": "Time range",
            "type": "string",
            "description": "Period to cover. Use one of the preset values, or a custom range written as 'YYYY-MM-DD YYYY-MM-DD' (e.g. '2024-01-01 2024-12-31'). Google picks the resolution: hourly or minute data for short ranges, daily for up to ~9 months, weekly for longer ranges, and monthly for 5+ years.",
            "default": "today 12-m"
          },
          "category": {
            "title": "Category ID",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Optional Google Trends category ID to narrow the meaning of a term (0 = all categories). Examples: 7 = Finance, 71 = Food & Drink, 5 = Computers & Electronics. You can copy the 'cat=' value from a Google Trends URL.",
            "default": 0
          },
          "searchProperty": {
            "title": "Search type",
            "enum": [
              "web",
              "images",
              "news",
              "youtube",
              "shopping"
            ],
            "type": "string",
            "description": "Which Google search to measure: web search (default), image search, news search, YouTube search, or Google Shopping.",
            "default": "web"
          },
          "include": {
            "title": "Data to include",
            "type": "array",
            "description": "Which sections to fetch. Fewer sections make the run faster but do not change the price. interestOverTime = time series + per-term summary; interestByRegion = breakdown by country/region; relatedQueries = top and rising related searches.",
            "items": {
              "type": "string",
              "enum": [
                "interestOverTime",
                "interestByRegion",
                "relatedQueries"
              ],
              "enumTitles": [
                "Interest over time",
                "Interest by region",
                "Related queries (top + rising)"
              ]
            },
            "default": [
              "interestOverTime",
              "interestByRegion",
              "relatedQueries"
            ]
          },
          "regionResolution": {
            "title": "Region breakdown level",
            "enum": [
              "",
              "COUNTRY",
              "REGION",
              "CITY",
              "DMA"
            ],
            "type": "string",
            "description": "Level of the interest-by-region breakdown. Empty = Google's default (countries for worldwide, regions inside a country). CITY and DMA (US metro areas) only work inside a country; if Google rejects the level, the default is used and the log says so.",
            "default": ""
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Language for region names and related queries, e.g. 'en-US', 'de', 'hu'.",
            "default": "en-US"
          },
          "timezoneOffsetMinutes": {
            "title": "Timezone offset (minutes)",
            "minimum": -840,
            "maximum": 720,
            "type": "integer",
            "description": "Google's 'tz' parameter: minutes WEST of UTC, so New York (UTC-5) = 300 and Berlin (UTC+1) = -60. Only affects how hourly data is bucketed. Timestamps in the output are always UTC.",
            "default": 0
          },
          "maxConcurrency": {
            "title": "Parallel sessions",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "How many queries run in parallel. 3 is a good balance; lower it if you see many retries in the log. Does not change the price.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Every request goes out directly first. If Google answers 'too many requests', retries use fresh Apify datacenter proxy sessions and, as a last resort, residential IPs. Choosing specific proxy groups here replaces both retry tiers; turning the proxy off makes every attempt direct.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}