{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper - Interest, Regions & Trends",
    "description": "Scrape Google Trends with no browser or API key: interest over time, interest by region, related & rising queries/topics, multi-keyword comparison, and real-time Trending Now searches with traffic & news. Web, YouTube, News, Image & Shopping trends. Monitoring mode.",
    "version": "0.1",
    "x-build-id": "TAG4wkpiht7U5bDVc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-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/scrapesage~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-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/scrapesage~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-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": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "keywords",
              "compare",
              "trending"
            ],
            "type": "string",
            "description": "<b>Keyword analysis</b> = full Google Trends breakdown for each keyword (interest over time, by region, related & rising queries/topics). <b>Compare keywords</b> = put 2–5 keywords on one relative 0–100 scale (who's winning, where). <b>Trending Now</b> = real-time trending searches for a country with traffic estimates and related news (great with Monitoring mode).",
            "default": "keywords"
          },
          "searchTerms": {
            "title": "Keywords",
            "type": "array",
            "description": "Search terms to analyze, e.g. <code>bitcoin</code>, <code>chatgpt</code>, <code>iphone 16</code>. In <b>Keyword analysis</b> each term gets its own record; in <b>Compare</b> the first 2–5 terms are compared on one scale. Not needed for <b>Trending Now</b>.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Trends URLs (optional)",
            "type": "array",
            "description": "Paste Google Trends Explore URLs (e.g. <code>https://trends.google.com/trends/explore?q=bitcoin&geo=US&date=today%2012-m</code>). The keywords, geo, time range, category and property are read straight from the URL — handy for reproducing a chart you built in the Trends UI.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "geo": {
            "title": "Location (geo)",
            "type": "string",
            "description": "Where to measure interest. Leave blank for <b>Worldwide</b>, or use a Google geo code: country (<code>US</code>, <code>GB</code>, <code>IN</code>, <code>DE</code>), US state (<code>US-CA</code>, <code>US-NY</code>) or metro (<code>US-CA-807</code>). In <b>Trending Now</b> mode this is the 2-letter country (defaults to <code>US</code>)."
          },
          "timeRange": {
            "title": "Time range",
            "enum": [
              "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",
              "custom"
            ],
            "type": "string",
            "description": "How far back to measure interest. Pick <b>Custom</b> to supply your own range below.",
            "default": "today 12-m"
          },
          "customTimeRange": {
            "title": "Custom time range",
            "type": "string",
            "description": "Used only when Time range = <b>Custom</b>. Format <code>YYYY-MM-DD YYYY-MM-DD</code> (e.g. <code>2023-01-01 2024-06-30</code>). For hourly data use <code>YYYY-MM-DDTHH YYYY-MM-DDTHH</code>."
          },
          "searchType": {
            "title": "Search property",
            "enum": [
              "web",
              "images",
              "news",
              "youtube",
              "froogle"
            ],
            "type": "string",
            "description": "Which Google surface to measure: <b>Web Search</b> (default), <b>Image</b>, <b>News</b>, <b>YouTube</b> or <b>Google Shopping</b> search. A standout differentiator — most scrapers only do web search.",
            "default": "web"
          },
          "category": {
            "title": "Category filter",
            "type": "integer",
            "description": "Restrict interest to one Google Trends category id (0 = All categories). Examples: <code>7</code> Finance, <code>5</code> Computers & Electronics, <code>71</code> Food & Drink, <code>20</code> Sports, <code>45</code> Health. See the Trends category list for more ids.",
            "default": 0
          },
          "dataTypes": {
            "title": "Data to include (Keyword / Compare)",
            "type": "array",
            "description": "Which breakdowns to fetch per keyword. Fewer types = faster & cheaper. Ignored in Trending Now mode.",
            "items": {
              "type": "string",
              "enum": [
                "interestOverTime",
                "interestByRegion",
                "relatedQueries",
                "relatedTopics"
              ],
              "enumTitles": [
                "Interest over time",
                "Interest by region",
                "Related queries (top & rising)",
                "Related topics (top & rising)"
              ]
            },
            "default": [
              "interestOverTime",
              "interestByRegion",
              "relatedQueries",
              "relatedTopics"
            ]
          },
          "regionResolution": {
            "title": "Region resolution (Interest by region)",
            "enum": [
              "",
              "COUNTRY",
              "REGION",
              "CITY",
              "DMA"
            ],
            "type": "string",
            "description": "Granularity for the interest-by-region breakdown. <b>Auto</b> lets Google choose based on the location (countries worldwide, states for a country, metros for a state).",
            "default": ""
          },
          "language": {
            "title": "Language (hl)",
            "type": "string",
            "description": "Interface language for labels & related results, e.g. <code>en-US</code>, <code>en-GB</code>, <code>es</code>, <code>de</code>, <code>fr</code>, <code>pt-BR</code>.",
            "default": "en-US"
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of records to output. Mainly limits <b>Trending Now</b> (one record per trending search); keyword/compare runs are bounded by your keyword list.",
            "default": 500
          },
          "monitorMode": {
            "title": "Monitoring mode — only new results",
            "type": "boolean",
            "description": "Remember what was seen in previous runs (in a named key-value store) and output ONLY new items — ideal for <b>Trending Now</b> to capture only freshly trending searches. Works together with Apify <a href='https://docs.apify.com/platform/schedules'>Schedules</a> (the schedule starts the run; monitoring filters to what's new).",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Names the memory used by monitoring mode. Use a distinct key per saved watch (e.g. per country) so different monitors don't share state.",
            "default": "default"
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Maximum parallel keyword analyses. Google Trends rate-limits per IP — keep this low (2–4); the actor rotates proxy IPs and retries on rate limits.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. The default Apify Proxy rotates IPs so the per-IP Google Trends rate limit is spread across many addresses. If a run is rate-limited, try the RESIDENTIAL group.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}