{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper",
    "description": "Scrape data from Google Trends by search terms or URLs. Specify locations, define time ranges, select categories to get interest by subregion and over time, related queries and topics, and more. Export scraped data, run the scraper via API, schedule and monitor runs, or integrate with other tools.",
    "version": "0.0",
    "x-build-id": "4PORbs2U4c62QH7dz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/apify~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-apify-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/apify~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-apify-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/apify~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-apify-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": "(Required if 'spreadsheetId' is not provided) List of search terms to be scraped.",
            "items": {
              "type": "string"
            }
          },
          "isMultiple": {
            "title": "Multiple terms",
            "type": "boolean",
            "description": "If checked comma will be handled as search for multiple terms",
            "default": false
          },
          "timeRange": {
            "title": "Time range",
            "enum": [
              "",
              "now 1-H",
              "now 4-H",
              "now 1-d",
              "now 7-d",
              "today 1-m",
              "today 3-m",
              "today 5-y",
              "all"
            ],
            "type": "string",
            "description": "Choose a predefined search's time range (defaults to 'Past 12 months')",
            "default": ""
          },
          "geo": {
            "title": "Geo area",
            "enum": [
              "",
              "AF",
              "AL",
              "DZ",
              "AS",
              "AD",
              "AO",
              "AI",
              "AQ",
              "AG",
              "AR",
              "AM",
              "AW",
              "AU",
              "AT",
              "AZ",
              "BS",
              "BH",
              "BD",
              "BB",
              "BY",
              "BE",
              "BZ",
              "BJ",
              "BM",
              "BT",
              "BO",
              "BQ",
              "BA",
              "BW",
              "BV",
              "BR",
              "IO",
              "BN",
              "BG",
              "BF",
              "BI",
              "CV",
              "KH",
              "CM",
              "CA",
              "KY",
              "CF",
              "TD",
              "CL",
              "CN",
              "CX",
              "Keeling Islands ",
              "CO",
              "KM",
              "CG",
              "CD",
              "CK",
              "CR",
              "CI",
              "HR",
              "CU",
              "CW",
              "CY",
              "CZ",
              "DK",
              "DJ",
              "DM",
              "DO",
              "EC",
              "EG",
              "SV",
              "GQ",
              "ER",
              "EE",
              "ET",
              "Malvinas ",
              "FO",
              "FJ",
              "FI",
              "FR",
              "GF",
              "PF",
              "TF",
              "GA",
              "GM",
              "GE",
              "DE",
              "GH",
              "GI",
              "GR",
              "GL",
              "GD",
              "GP",
              "GU",
              "GT",
              "GG",
              "GN",
              "GW",
              "GY",
              "HT",
              "HM",
              "Vatican City State ",
              "HN",
              "HK",
              "HU",
              "IS",
              "IN",
              "ID",
              "IR",
              "IQ",
              "IE",
              "IM",
              "IL",
              "IT",
              "JM",
              "JP",
              "JE",
              "JO",
              "KZ",
              "KE",
              "KI",
              "the Democratic People's Republic of ",
              "the Republic of ",
              "KW",
              "KG",
              "LA",
              "LV",
              "LB",
              "LS",
              "LR",
              "LY",
              "LI",
              "LT",
              "LU",
              "MO",
              "MK",
              "MG",
              "MW",
              "MY",
              "MV",
              "ML",
              "MT",
              "MH",
              "MQ",
              "MR",
              "MU",
              "YT",
              "MX",
              "FM",
              "MD",
              "MC",
              "MN",
              "ME",
              "MS",
              "MA",
              "MZ",
              "MM",
              "NA",
              "NR",
              "NP",
              "NL",
              "NC",
              "NZ",
              "NI",
              "NE",
              "NG",
              "NU",
              "NF",
              "MP",
              "NO",
              "OM",
              "PK",
              "PW",
              "PS",
              "PA",
              "PG",
              "PY",
              "PE",
              "PH",
              "PN",
              "PL",
              "PT",
              "PR",
              "QA",
              "RE",
              "RO",
              "RU",
              "RW",
              "BL",
              "SH",
              "KN",
              "LC",
              "French part ",
              "PM",
              "VC",
              "WS",
              "SM",
              "ST",
              "SA",
              "SN",
              "RS",
              "SC",
              "SL",
              "SG",
              "Dutch part ",
              "SK",
              "SI",
              "SB",
              "SO",
              "ZA",
              "GS",
              "SS",
              "ES",
              "LK",
              "SD",
              "SR",
              "SJ",
              "SZ",
              "SE",
              "CH",
              "SY",
              "TW",
              "TJ",
              "TZ",
              "TH",
              "TL",
              "TG",
              "TK",
              "TO",
              "TT",
              "TN",
              "TR",
              "TM",
              "TC",
              "TV",
              "UG",
              "UA",
              "AE",
              "GB",
              "US",
              "UM",
              "UY",
              "UZ",
              "VU",
              "VE",
              "VN",
              "VG",
              "VI",
              "WF",
              "EH",
              "YE",
              "ZM",
              "ZW"
            ],
            "type": "string",
            "description": "Get results from a specific geo area (defaults to 'Worldwide'). This maps to different fields in the dataset results: smaller countries like Greece return just 'interestByCity' data, while larger ones like the United States return 'interestBySubregion' data as well. When omitted (Worldwide), 'interestBy' is returned instead, which corresponds to the 'Interest by area' section on Google Trends. Note: When using Google Trends URLs from the '🔗 Use a Google Trends URL instead of search terms' section, the geo parameter from the URL's query string takes precedence over this setting. You can also use start URLs to retrieve 'interestByMetro' data for metropolitan areas by providing URLs with more specific geo regions like California (US) directly copied from Google Trends.",
            "default": ""
          },
          "viewedFrom": {
            "title": "Country to view Trends from",
            "enum": [
              "",
              "us",
              "af",
              "al",
              "dz",
              "as",
              "ad",
              "ao",
              "ai",
              "aq",
              "ag",
              "ar",
              "am",
              "aw",
              "au",
              "at",
              "az",
              "bs",
              "bh",
              "bd",
              "bb",
              "by",
              "be",
              "bz",
              "bj",
              "bm",
              "bt",
              "bo",
              "ba",
              "bw",
              "bv",
              "br",
              "io",
              "bn",
              "bg",
              "bf",
              "bi",
              "kh",
              "cm",
              "ca",
              "cv",
              "ky",
              "cf",
              "td",
              "cl",
              "cn",
              "cx",
              "cc",
              "co",
              "km",
              "cg",
              "cd",
              "ck",
              "cr",
              "ci",
              "hr",
              "cu",
              "cy",
              "cz",
              "dk",
              "dj",
              "dm",
              "do",
              "ec",
              "eg",
              "sv",
              "gq",
              "er",
              "ee",
              "et",
              "fk",
              "fo",
              "fj",
              "fi",
              "fr",
              "gf",
              "pf",
              "tf",
              "ga",
              "gm",
              "ge",
              "de",
              "gh",
              "gi",
              "gr",
              "gl",
              "gd",
              "gp",
              "gu",
              "gt",
              "gn",
              "gw",
              "gy",
              "ht",
              "hm",
              "va",
              "hn",
              "hk",
              "hu",
              "is",
              "in",
              "id",
              "ir",
              "iq",
              "ie",
              "il",
              "it",
              "jm",
              "jp",
              "jo",
              "kz",
              "ke",
              "ki",
              "kp",
              "kr",
              "kw",
              "kg",
              "la",
              "lv",
              "lb",
              "ls",
              "lr",
              "ly",
              "li",
              "lt",
              "lu",
              "mo",
              "mk",
              "mg",
              "mw",
              "my",
              "mv",
              "ml",
              "mt",
              "mh",
              "mq",
              "mr",
              "mu",
              "yt",
              "mx",
              "fm",
              "md",
              "mc",
              "mn",
              "me",
              "ms",
              "ma",
              "mz",
              "mm",
              "na",
              "nr",
              "np",
              "nl",
              "an",
              "nc",
              "nz",
              "ni",
              "ne",
              "ng",
              "nu",
              "nf",
              "mp",
              "no",
              "om",
              "pk",
              "pw",
              "ps",
              "pa",
              "pg",
              "py",
              "pe",
              "ph",
              "pn",
              "pl",
              "pt",
              "pr",
              "qa",
              "re",
              "ro",
              "ru",
              "rw",
              "sh",
              "kn",
              "lc",
              "pm",
              "vc",
              "ws",
              "sm",
              "st",
              "sa",
              "sn",
              "rs",
              "sc",
              "sl",
              "sg",
              "sk",
              "si",
              "sb",
              "so",
              "za",
              "gs",
              "ss",
              "es",
              "lk",
              "sd",
              "sr",
              "sj",
              "sz",
              "se",
              "ch",
              "sy",
              "tw",
              "tj",
              "tz",
              "th",
              "tl",
              "tg",
              "tk",
              "to",
              "tt",
              "tn",
              "tr",
              "tm",
              "tc",
              "tv",
              "ug",
              "ua",
              "ae",
              "gb",
              "um",
              "uy",
              "uz",
              "vu",
              "ve",
              "vn",
              "vg",
              "vi",
              "wf",
              "eh",
              "ye",
              "zm",
              "zw"
            ],
            "type": "string",
            "description": "Country for residential proxies to ensure correct results"
          },
          "skipDebugScreen": {
            "title": "Do not save snapshot",
            "type": "boolean",
            "description": "By default snapshot of each visited Google Trends page saved to KV Store",
            "default": false
          },
          "startUrls": {
            "title": "Google Trends URLs",
            "type": "array",
            "description": "Copy a Google Trends URL and paste it here.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "spreadsheetId": {
            "title": "Google sheet ID (To get input data from Google sheet)",
            "type": "string",
            "description": "(Optional) Id of the google sheet from where search terms will be loaded.\n Spreadsheet must have only one column. Row 1 is considered the title of the column so it will not be loaded as a search term. The provided spreadsheet must be publicly available. Check the actor documentation for more info."
          },
          "category": {
            "title": "Category of trends",
            "enum": [
              "",
              "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": "Choose a category to filter the search for (defaults to 'All categories')",
            "default": ""
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Limit of product items to be scraped. Zero value means no limit.",
            "default": 0
          },
          "customTimeRange": {
            "title": "Custom time range",
            "type": "string",
            "description": "Provide custom time range. If present, it takes precedence over regular timeRange. Format is: `YYYY-MM-DD YYYY-MM-DD`. See examples in the documentation."
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "type": "integer",
            "description": "How many pages will be opened in parallel if enough CPU is available.",
            "default": 10
          },
          "maxRequestRetries": {
            "title": "Max request retries",
            "minimum": 1,
            "type": "integer",
            "description": "How many times will the actor retry a request if it fails.",
            "default": 7
          },
          "pageLoadTimeoutSecs": {
            "title": "Page load timeout",
            "minimum": 30,
            "type": "integer",
            "description": "How long it will wait for page loading before it abandons the loading and tries again.",
            "default": 180
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}