{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper & API: pytrends Alternative",
    "description": "Google Trends API and pytrends alternative: interest over time, by region, city or US metro, rising related queries, keyword comparison, plus Trending Now searches by country with volume. Empty or refused terms are free. $1.90/1k terms, $0.80/1k trends. Unofficial.",
    "version": "0.1",
    "x-build-id": "BfTGA8vT7JFZ2ZOMS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hiver~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hiver-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/hiver~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-hiver-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/hiver~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-hiver-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": "One term per line, for example `ai agents`. Each term is looked up on its own, unless you switch on **Compare terms** below. Leave empty if you only want Trending Now.",
            "items": {
              "type": "string"
            }
          },
          "compareTerms": {
            "title": "Compare terms on one chart",
            "type": "boolean",
            "description": "On: terms are grouped five at a time and scored against each other on Google's shared 0-100 scale (the same as typing several terms into Google Trends). Off: every term gets its own 0-100 scale.",
            "default": false
          },
          "geo": {
            "title": "Country or region",
            "type": "string",
            "description": "Two-letter country code (`US`, `GB`, `DE`, `JP`) or a region code like `US-CA` or `GB-ENG`. Leave empty for worldwide.",
            "default": ""
          },
          "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": "How far back the interest-over-time chart goes. Shorter ranges give hourly or daily points; longer ones weekly or monthly.",
            "default": "today 12-m"
          },
          "customTimeRange": {
            "title": "Custom date range (optional)",
            "type": "string",
            "description": "Overrides the time range. Format `YYYY-MM-DD YYYY-MM-DD`, for example `2025-01-01 2025-06-30`."
          },
          "searchProperty": {
            "title": "Where people searched",
            "enum": [
              "web",
              "youtube",
              "news",
              "shopping",
              "images"
            ],
            "type": "string",
            "description": "Google web search, or one of the other Google search sites that Trends separates out.",
            "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": "Narrow the search to one Google Trends category. Helps with ambiguous words like `apple` or `python`.",
            "default": "0"
          },
          "outputs": {
            "title": "What to collect for each term",
            "type": "array",
            "description": "Every item is one search term with the parts you pick. Google returned empty relatedTopics in our 11-term cloud tests; that output is optional and unverified. Fewer parts means fewer requests. Pay per populated term, not per part.",
            "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",
              "relatedTopics"
            ]
          },
          "regionResolution": {
            "title": "Region detail",
            "enum": [
              "COUNTRY",
              "REGION",
              "CITY",
              "DMA"
            ],
            "type": "string",
            "description": "Interest by region: countries, regions (states), cities or metro areas. Which levels exist depends on the country you chose.",
            "default": "REGION"
          },
          "includeLowVolumeRegions": {
            "title": "Include regions with low search volume",
            "type": "boolean",
            "description": "Google hides regions with little data by default. Turn on to list them too (values are less reliable).",
            "default": false
          },
          "startUrls": {
            "title": "Google Trends URLs (optional)",
            "type": "array",
            "description": "Paste Explore links such as `https://trends.google.com/trends/explore?q=python,rust&geo=US&date=today 12-m`. Terms, country, time range, category and search type are read from the URL. The Actor does not open the page; it calls the data behind it.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "trendingGeos": {
            "title": "Trending Now: countries",
            "type": "array",
            "description": "Two-letter country codes (`US`, `GB`, `IN`) or `US-CA` style regions. One item per trending search, with when it started, approximate search volume, growth and related searches. Leave empty to skip Trending Now.",
            "items": {
              "type": "string"
            }
          },
          "trendingHours": {
            "title": "Trending Now: time window",
            "enum": [
              "4",
              "24",
              "48",
              "168"
            ],
            "type": "string",
            "description": "How far back Trending Now looks.",
            "default": "24"
          },
          "trendingCategories": {
            "title": "Trending Now: categories (optional)",
            "type": "array",
            "description": "Keep only trends in these Google Trends Now categories. Empty keeps all.",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9",
                "10",
                "14",
                "15",
                "16",
                "17",
                "18",
                "19",
                "20",
                "13"
              ],
              "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",
                "Politics",
                "Science",
                "Shopping",
                "Sports",
                "Technology",
                "Travel and Transportation",
                "Climate",
                "Pets and Animals"
              ]
            }
          },
          "trendingMaxItemsPerCountry": {
            "title": "Trending Now: max items per country",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Highest search volume first.",
            "default": 50
          },
          "trendingIncludeNews": {
            "title": "Trending Now: add news links",
            "type": "boolean",
            "description": "Requests up to three news links (title, publisher URL, source) from each selected trend's public Trending Now panel. Country/category filters and row caps apply first. Serial batches of at most 25 trends use the same direct session and pacing. Missing or failed news stays an empty array; no extra news charge. Off skips news requests.",
            "default": true
          },
          "language": {
            "title": "Language of labels",
            "type": "string",
            "description": "Language code for topic names and related-query labels, for example `en-US`, `de`, `es`.",
            "default": "en-US"
          },
          "timezoneOffsetMinutes": {
            "title": "Time zone offset (minutes)",
            "type": "integer",
            "description": "Offset used for hourly points, as in the Google Trends URL `tz` value. 0 is UTC; -480 is UTC+8.",
            "default": 0
          },
          "maxItems": {
            "title": "Max items (cost cap)",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Caps non-error rows (search terms plus trending searches). Uncharged error rows may be additional; this is not a dollar cap on platform usage.",
            "default": 1000
          },
          "maxConcurrency": {
            "title": "Concurrency (legacy, ignored)",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Accepted for compatibility. All jobs run serially on one direct session. Plain HTTP 429 permits at most two Retry-After waits per run within a 160-second source budget; other explicit refusals stop traffic.",
            "default": 1
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Legacy compatibility setting, ignored. The Actor uses one direct session, honours bounded Retry-After waits on plain HTTP 429, and never uses proxies to bypass blocks.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}