{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper + Trending Now",
    "description": "Get Google Trends data for any search term: interest over time, interest by region, related queries and topics, and comparisons of up to 5 terms. Plus Trending Now searches in 125 countries with search volume and news.",
    "version": "1.0",
    "x-build-id": "iiu5mTurxfpsX6U3t"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mattwensey~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mattwensey-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/mattwensey~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-mattwensey-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/mattwensey~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-mattwensey-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": [
              "explore",
              "trendingNow"
            ],
            "type": "string",
            "description": "\"Explore search terms\" returns one trend report per search term: interest over time, interest by region, related queries and related topics (like the Explore page on Google Trends). \"Trending Now\" returns the searches that are trending right now in a country (like the Trending Now page), one result per trending search.",
            "default": "explore"
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Words or phrases to look up on Google Trends, one per line (Explore mode). Each term gets its own report. You can also use a Google Knowledge Graph topic id such as \"/m/02vqfm\" (the topic \"Coffee\").",
            "items": {
              "type": "string"
            }
          },
          "compareTerms": {
            "title": "Compare the terms with each other",
            "type": "boolean",
            "description": "When on, the search terms are requested together (up to 5 per comparison, like adding terms with \"+ Compare\" on Google Trends), so their values share one 0-100 scale and can be compared directly. Each term still gets its own report. When off, every term is scaled on its own.",
            "default": false
          },
          "startUrls": {
            "title": "Google Trends URLs",
            "type": "array",
            "description": "Paste Google Trends page URLs instead of (or in addition to) search terms. Explore URLs (https://trends.google.com/trends/explore?q=coffee,tea&geo=US&date=today%2012-m) keep their terms, comparison, location, time range, category and search property. Trending Now URLs (https://trends.google.com/trending?geo=US&hours=24) return that trending list.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "geo": {
            "title": "Location",
            "type": "string",
            "description": "Country code such as \"US\", \"GB\" or \"DE\". Leave empty for Worldwide (Explore mode only). You can also type a region (\"US-CA\") or a US metro area (\"US-CA-807\"). Trending Now needs a country (125 countries are supported).",
            "default": "US"
          },
          "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"
            ],
            "type": "string",
            "description": "Period to analyze (Explore mode). The data resolution follows Google: minutes for the past hours, hours for the past 7 days, days up to 90 days, weeks up to 5 years, months for 2004 to present. Ignored when Start date and End date are set.",
            "default": "today 12-m"
          },
          "startDate": {
            "title": "Start date (custom range)",
            "type": "string",
            "description": "Start of a custom time range, e.g. 2024-01-01. Set together with End date; overrides Time range. Data starts on 2004-01-01."
          },
          "endDate": {
            "title": "End date (custom range)",
            "type": "string",
            "description": "End of a custom time range, e.g. 2024-12-31. Set together with Start date."
          },
          "category": {
            "title": "Category",
            "type": "string",
            "description": "Limit results to searches in one Google Trends category (Explore mode), e.g. 71 = Food & Drink. \"0\" means all categories. You can also type any sub-category id from Google Trends (the \"cat\" value in a Google Trends URL).",
            "default": "0"
          },
          "property": {
            "title": "Search type",
            "enum": [
              "web",
              "images",
              "news",
              "shopping",
              "youtube"
            ],
            "type": "string",
            "description": "Which Google search to analyze (Explore mode): Web Search (default), Image Search, News Search, Google Shopping or YouTube Search.",
            "default": "web"
          },
          "includeInterestOverTime": {
            "title": "Interest over time",
            "type": "boolean",
            "description": "Time series of search interest (0-100) for each term. Also saved as one CSV file for all terms in the key-value store (INTEREST_OVER_TIME.csv).",
            "default": true
          },
          "includeInterestByRegion": {
            "title": "Interest by region",
            "type": "boolean",
            "description": "Where each term is most popular: countries (Worldwide) or regions of the selected country, with values from 0 to 100.",
            "default": true
          },
          "regionResolution": {
            "title": "Region level",
            "enum": [
              "",
              "COUNTRY",
              "REGION",
              "DMA",
              "CITY"
            ],
            "type": "string",
            "description": "Level of detail for interest by region. Automatic uses Google's default: countries for Worldwide, regions/states for a country. Metro areas (DMA) exist for the United States only. If Google does not offer the chosen level for a location, the default level is used and the report says so.",
            "default": ""
          },
          "includeLowSearchVolumeRegions": {
            "title": "Include low search volume regions",
            "type": "boolean",
            "description": "Also return regions with low search volume (same as the checkbox on Google Trends).",
            "default": false
          },
          "includeRelatedQueries": {
            "title": "Related queries",
            "type": "boolean",
            "description": "Top and rising searches related to each term, including \"Breakout\" queries.",
            "default": true
          },
          "includeRelatedTopics": {
            "title": "Related topics",
            "type": "boolean",
            "description": "Top and rising topics (Knowledge Graph entities) related to each term, with topic ids and types.",
            "default": true
          },
          "trendingHours": {
            "title": "Trending Now: time window",
            "enum": [
              "4",
              "24",
              "48",
              "168"
            ],
            "type": "string",
            "description": "How far back to look for trending searches (Trending Now mode).",
            "default": "24"
          },
          "trendingCategory": {
            "title": "Trending Now: category",
            "enum": [
              "",
              "1",
              "2",
              "3",
              "20",
              "4",
              "5",
              "6",
              "7",
              "8",
              "9",
              "10",
              "11",
              "13",
              "14",
              "15",
              "16",
              "17",
              "18",
              "19"
            ],
            "type": "string",
            "description": "Only return trending searches in this category. Leave on \"All categories\" for everything.",
            "default": ""
          },
          "trendingActiveOnly": {
            "title": "Trending Now: active trends only",
            "type": "boolean",
            "description": "Only return searches that are still trending (Google marks them \"Active\").",
            "default": false
          },
          "trendingSortBy": {
            "title": "Trending Now: sort by",
            "enum": [
              "relevance",
              "searchVolume",
              "recency",
              "title"
            ],
            "type": "string",
            "description": "Order of the results. \"Relevance\" is Google's default order. The limit in \"Max results\" keeps the first results in this order.",
            "default": "relevance"
          },
          "newsArticlesPerTrend": {
            "title": "Trending Now: news articles per trend",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "How many news articles to include for each trending search (0 to 10). Use 0 to skip news and finish faster.",
            "default": 3
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of results to save: term reports in Explore mode, trending searches in Trending Now mode. Use 0 for no limit. You are only charged for results with data.",
            "default": 50
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Language for region names, topic titles and labels, as a code like \"en-US\", \"de\" or \"fr\" (the \"hl\" value in a Google Trends URL).",
            "default": "en-US"
          },
          "timezone": {
            "title": "Timezone",
            "type": "string",
            "description": "Timezone for dates in interest over time, as an IANA name such as \"UTC\" (default), \"America/New_York\" or \"Europe/Berlin\". Hourly and daily periods start at midnight in this timezone, as on Google Trends.",
            "default": "UTC"
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many queries to run at the same time, each from a different proxy IP. The default of 3 is a good balance between speed and reliability.",
            "default": 3
          },
          "maxRetries": {
            "title": "Retries per query",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "How many times to retry a query from a fresh IP when Google rate-limits or blocks it, before reporting it as failed.",
            "default": 6
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Google Trends rate-limits shared IP addresses quickly. Residential proxies (default) give the most reliable results; every query uses its own IP.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}