{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper: Interest, Regions, Related, Trending Now",
    "description": "Google Trends scraper: interest over time, by region and city, related queries and topics, Trending Now with news. Web, YouTube, News, Images, Shopping. Compare any number of keywords on one scale. Tidy rows plus per keyword summaries.",
    "version": "1.0",
    "x-build-id": "JGeVJGfgPjrWcBqd2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zhtech~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zhtech-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/zhtech~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-zhtech-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/zhtech~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-zhtech-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 analyze, one per line. You can also enter a Google topic id such as /m/0dl567. Empty lines and duplicates are ignored. Each term and geo pair is one charged term report.",
            "items": {
              "type": "string"
            }
          },
          "dataTypes": {
            "title": "Data to collect",
            "type": "array",
            "description": "Which Google Trends widgets to fetch for every term. Related topics are only served by Google for single term requests and are often empty, so they are off by default.",
            "items": {
              "type": "string",
              "enum": [
                "interestOverTime",
                "interestByRegion",
                "relatedQueries",
                "relatedTopics"
              ],
              "enumTitles": [
                "Interest over time",
                "Interest by region",
                "Related queries (top and rising)",
                "Related topics (top and rising)"
              ]
            },
            "default": [
              "interestOverTime",
              "interestByRegion",
              "relatedQueries"
            ]
          },
          "comparisonMode": {
            "title": "Comparison mode",
            "enum": [
              "individual",
              "compare"
            ],
            "type": "string",
            "description": "Individual: every term is analyzed on its own 0 to 100 scale (best for bulk keyword research). Compare: all terms share one 0 to 100 scale. Up to 5 terms are compared natively by Google; with more than 5 the Actor splits them into groups that all contain the anchor term and rescales every group onto one shared scale.",
            "default": "individual"
          },
          "anchorTerm": {
            "title": "Anchor term (compare mode, more than 5 terms)",
            "type": "string",
            "description": "Only used when you compare more than 5 terms. The anchor is added to every group of 4 terms so the groups can be put on one scale. Pick a term with steady, medium popularity similar to your terms. Leave empty to use the first search term."
          },
          "startUrls": {
            "title": "Google Trends URLs (optional)",
            "type": "array",
            "description": "Paste Google Trends explore URLs (old /trends/explore and new /explore formats). Their terms, geo, date, category and property are used as is (up to 5 terms per URL).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "useTopics": {
            "title": "Search keywords as Google topics",
            "type": "boolean",
            "description": "Resolve each keyword to its best matching Google Knowledge Graph topic (for example apple to Apple Inc) before querying. Topics merge spellings and languages. Uses one extra request per keyword.",
            "default": false
          },
          "geos": {
            "title": "Locations (geo codes)",
            "type": "array",
            "description": "Where to measure interest. Country (US, GB, DE), subregion (US-CA, GB-SCT), US metro (US-NY-501) or WORLD for worldwide. Every term is analyzed for every location listed.",
            "default": [
              "US"
            ],
            "items": {
              "type": "string"
            }
          },
          "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": "Period to analyze. Choose Custom to set exact dates below.",
            "default": "today 12-m"
          },
          "customTimeRange": {
            "title": "Custom time range",
            "type": "string",
            "description": "Format YYYY-MM-DD YYYY-MM-DD, for example 2024-01-01 2024-12-31. For hourly data within the last 7 days use YYYY-MM-DDTHH YYYY-MM-DDTHH. Overrides Time range when filled."
          },
          "searchType": {
            "title": "Search type",
            "enum": [
              "web",
              "youtube",
              "news",
              "images",
              "shopping"
            ],
            "type": "string",
            "description": "Which Google property to measure.",
            "default": "web"
          },
          "category": {
            "title": "Category",
            "enum": [
              "0",
              "3",
              "47",
              "44",
              "22",
              "12",
              "5",
              "7",
              "71",
              "8",
              "45",
              "65",
              "11",
              "13",
              "958",
              "19",
              "16",
              "299",
              "14",
              "66",
              "29",
              "533",
              "174",
              "18",
              "20",
              "67"
            ],
            "type": "string",
            "description": "Limit interest to a Google Trends category. Use Custom category id below for any of the 1,100+ subcategories.",
            "default": "0"
          },
          "customCategoryId": {
            "title": "Custom category id",
            "minimum": 0,
            "type": "integer",
            "description": "Any Google Trends category id (for example 390 for Mobile Phones). Overrides Category when set."
          },
          "language": {
            "title": "Language (hl)",
            "type": "string",
            "description": "Interface language used for region names, formatted dates and topic titles, for example en-US, de, fr, es, ja.",
            "default": "en-US"
          },
          "regionResolution": {
            "title": "Region resolution",
            "enum": [
              "AUTO",
              "COUNTRY",
              "REGION",
              "DMA",
              "CITY"
            ],
            "type": "string",
            "description": "Granularity of Interest by region. Auto uses Google's default (countries for worldwide, subregions for a country). Metro (DMA) is only available for the United States.",
            "default": "AUTO"
          },
          "includeLowVolumeRegions": {
            "title": "Include low search volume regions",
            "type": "boolean",
            "description": "Also return regions where Google has too little data (they come back with value 0). Off by default so you do not get pages of zero rows.",
            "default": false
          },
          "maxRegionsPerTerm": {
            "title": "Max regions per term",
            "minimum": 0,
            "type": "integer",
            "description": "Limit how many regions (highest interest first) are returned per term. 0 returns all.",
            "default": 0
          },
          "trendingGeos": {
            "title": "Trending Now countries",
            "type": "array",
            "description": "Country codes to fetch Google's Trending Now list for (real time trending searches with volume, growth, related searches and news). Leave empty to skip. Each trending search is charged as one result.",
            "items": {
              "type": "string"
            }
          },
          "trendingHours": {
            "title": "Trending window",
            "enum": [
              "4",
              "24",
              "48",
              "168"
            ],
            "type": "string",
            "description": "Trends that started within this window.",
            "default": "24"
          },
          "trendingCategories": {
            "title": "Trending categories",
            "type": "array",
            "description": "Only keep trends in these categories. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9",
                "10",
                "11",
                "13",
                "14",
                "15",
                "16",
                "17",
                "18",
                "19",
                "20"
              ],
              "enumTitles": [
                "Autos and Vehicles",
                "Beauty and Fashion",
                "Business and Finance",
                "Entertainment",
                "Food and Drink",
                "Games",
                "Health",
                "Hobbies and Leisure",
                "Jobs and Education",
                "Law and Government",
                "Other",
                "Pets and Animals",
                "Politics",
                "Science",
                "Shopping",
                "Sports",
                "Technology",
                "Travel and Transportation",
                "Climate"
              ]
            }
          },
          "trendingActiveOnly": {
            "title": "Active trends only",
            "type": "boolean",
            "description": "Skip trends that Google already marks as ended.",
            "default": false
          },
          "trendingSort": {
            "title": "Sort trending by",
            "enum": [
              "relevance",
              "volume",
              "recency",
              "growth"
            ],
            "type": "string",
            "description": "Order of trending searches. Relevance keeps Google's own order.",
            "default": "relevance"
          },
          "maxTrendingPerGeo": {
            "title": "Max trending searches per country",
            "minimum": 0,
            "type": "integer",
            "description": "Google lists hundreds of trends per country (thousands for 7 days). 0 returns all.",
            "default": 50
          },
          "trendingIncludeNews": {
            "title": "Attach news articles",
            "type": "boolean",
            "description": "Attach the news articles Google shows for headline trends (taken from Google's Trending RSS feed, which covers the top trends only).",
            "default": true
          },
          "monitorMode": {
            "title": "Monitoring mode (flag what is new since the last run)",
            "type": "boolean",
            "description": "For scheduled runs. Remembers what earlier runs returned and marks every Trending Now search and every rising related query with isNew. Summaries get newRisingQueries and newBreakoutQueries. State is kept in your own key value store named google-trends-monitor.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Separate memory per name. Use a different name for each schedule or task (for example us-ai-daily).",
            "default": "default"
          },
          "monitorOnlyNew": {
            "title": "Output only new items",
            "type": "boolean",
            "description": "With monitoring on, skip Trending Now searches and rising related queries that an earlier run already returned. Skipped trending searches are not charged. Term reports are still charged when Google returns data, because the timeline and regions are new data every run.",
            "default": false
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "both",
              "rows",
              "summaries"
            ],
            "type": "string",
            "description": "Both: one summary record per term plus tidy rows (one row per date, region and related query). Rows: spreadsheet friendly rows only. Summaries: one record per term with the timeline nested. Every record has a recordType field you can filter on. The price is per term report, not per row.",
            "default": "both"
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Parallel sessions. Google Trends rate limits per IP, so keep 1 without proxies; 2 to 4 works well with Apify Proxy (each session gets its own IP).",
            "default": 1
          },
          "requestDelaySecs": {
            "title": "Delay between requests (seconds)",
            "minimum": 0,
            "maximum": 30,
            "type": "number",
            "description": "Base pause between requests in one session (randomized). The Actor slows down automatically when Google pushes back.",
            "default": 1.5
          },
          "maxRetries": {
            "title": "Max retries per request",
            "minimum": 0,
            "maximum": 12,
            "type": "integer",
            "description": "Retries with exponential backoff and a fresh session on rate limits (HTTP 429) and network errors. A request never loops forever.",
            "default": 6
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Default: Apify Proxy datacenter IPs with automatic rotation, which works well for Google Trends at normal volumes. If a large run keeps hitting rate limits, raise the delay, lower concurrency, or switch to RESIDENTIAL here.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}