{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper",
    "description": "[ 1k / 1$ ] Google Trends scraper: get interest over time, interest by region, related queries and topics, or current trending searches for any search term. Filter by region, time range, category and Google property: web, images, news, YouTube, shopping.",
    "version": "0.1",
    "x-build-id": "HQgjacXDwWqiXkm3S"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/alpha-scraper~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-alpha-scraper-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/alpha-scraper~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-alpha-scraper-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/alpha-scraper~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-alpha-scraper-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": {
          "queries": {
            "title": "Search Terms",
            "type": "array",
            "description": "Keywords whose Google Trends data you want, for example 'python' or 'electric cars'. A Knowledge Graph topic id such as /m/05z1_ also works. Write 'trending' (or 'trending:GB' for a country) to get Google's current trending searches instead (about 10 per country). Every term is analysed on its own and gets its own 'Max Items Per Search Term'.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max Items Per Search Term",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of records per search term, counted over all data types together. A 12-month curve alone has about 53 weekly points and the region map has dozens of rows, so with the default of 15 only the first data types in the list below are filled. Raise it (for example to 500) to get everything. The records come in the order the data types are listed in the input.",
            "default": 15
          },
          "geo": {
            "title": "Region (geo)",
            "type": "string",
            "description": "Where the searches were made: a country code such as US, GB or DE, or a sub-region such as US-CA (California). Pick one from the list or type a Google Trends geo code. Clear the field (empty value) for worldwide. For 'trending' queries it is the country of the trending list.",
            "default": "US"
          },
          "timeRange": {
            "title": "Time Range",
            "type": "string",
            "description": "Period of the data. Pick a preset or type your own range as 'YYYY-MM-DD YYYY-MM-DD' (for example '2024-01-01 2024-06-30'). Short ranges (hours, days) give hourly points, longer ones daily, weekly or monthly points chosen by Google. The 'trending' query ignores it.",
            "default": "today 12-m"
          },
          "category": {
            "title": "Category ID",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category id that narrows the term to one topic area. 0 means all categories. Common ids: 3 Arts & Entertainment, 47 Autos & Vehicles, 44 Beauty & Fitness, 22 Books & Literature, 12 Business & Industrial, 5 Computers & Electronics, 7 Finance, 71 Food & Drink, 8 Games, 45 Health, 65 Hobbies & Leisure, 11 Home & Garden, 13 Internet & Telecom, 958 Jobs & Education, 19 Law & Government, 16 News, 14 People & Society, 66 Pets & Animals, 29 Real Estate, 174 Science, 18 Shopping, 20 Sports, 67 Travel.",
            "default": 0
          },
          "property": {
            "title": "Google Property",
            "enum": [
              "",
              "images",
              "news",
              "youtube",
              "froogle"
            ],
            "type": "string",
            "description": "Which Google search the interest is measured on: web search, image search, news search, YouTube search or Google Shopping.",
            "default": ""
          },
          "dataTypes": {
            "title": "Data To Collect",
            "type": "array",
            "description": "Which Google Trends widgets to read for every term (one extra request each): interest over time (the curve), interest by region (map table), related queries (top and rising) and related topics. Note: Google answers non-browser clients with an empty related-topics list and generic 'rising' related queries, so related topics are off by default and usually return nothing.",
            "items": {
              "type": "string",
              "enum": [
                "interestOverTime",
                "interestByRegion",
                "relatedQueries",
                "relatedTopics"
              ],
              "enumTitles": [
                "Interest over time",
                "Interest by region",
                "Related queries (top and rising)",
                "Related topics (usually empty for this client)"
              ]
            },
            "default": [
              "relatedQueries",
              "interestByRegion",
              "interestOverTime"
            ]
          },
          "regionResolution": {
            "title": "Region Breakdown Level",
            "enum": [
              "REGION",
              "COUNTRY",
              "CITY",
              "DMA"
            ],
            "type": "string",
            "description": "Granularity of the 'interest by region' table: sub-regions (states or provinces), countries, cities or US metro areas (DMA). Which levels exist depends on the Region above (for example DMA is US-only, and worldwide data is by country). Used only when 'Interest by region' is selected.",
            "default": "REGION"
          },
          "language": {
            "title": "Language (hl)",
            "type": "string",
            "description": "Interface language of Google Trends (for example en-US, de, fr), sent as 'hl'. It changes names and labels such as region names, not which searches are counted. Pick a code from the list or type another one.",
            "default": "en-US"
          },
          "timezoneOffset": {
            "title": "Time Zone Offset (minutes)",
            "type": "integer",
            "description": "Time zone used for the time points, sent as Google Trends' 'tz' parameter in minutes. Google's convention counts minutes behind UTC: 0 is UTC, 360 is UTC-6 (US Central), -60 is UTC+1 (Central Europe).",
            "default": 0
          },
          "fetchDetails": {
            "title": "Fetch Curves For Related Items",
            "type": "boolean",
            "description": "Give each related query or topic its own interest-over-time curve plus peak date and value, average and latest value. This needs 2 extra requests per item, and Google Trends rate-limits aggressively, so only the first items are detailed (see the limit below). A 429 or 403 answer stops the run for that host; what was gathered is kept.",
            "default": true
          },
          "detailLimit": {
            "title": "Max Detailed Related Items Per Search Term",
            "minimum": 0,
            "type": "integer",
            "description": "How many related queries or topics per search term get their own curve (2 requests each). Related items beyond the limit are still returned with 'detailStatus' set to 'skipped'. 0 means no limit, which usually runs into Google's rate limit. Used only while 'Fetch Curves For Related Items' is on.",
            "default": 5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}