{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper & API: Unlimited Keywords, Regions",
    "description": "Google Trends interest over time for any number of keywords or Knowledge Graph topics on one 0-100 scale, interest by region, related and rising queries, a rising-queries watcher for schedules, and live trending searches. Retries with session rotation handle Google's rate limits; no login.",
    "version": "0.2",
    "x-build-id": "jtBrrn6oYJfouwgeO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/varnmill~google-trends-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-varnmill-google-trends-api",
        "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/varnmill~google-trends-api/runs": {
      "post": {
        "operationId": "runs-sync-varnmill-google-trends-api",
        "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/varnmill~google-trends-api/run-sync": {
      "post": {
        "operationId": "run-sync-varnmill-google-trends-api",
        "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 fetch",
            "enum": [
              "keywords",
              "risingWatcher",
              "trendingNow"
            ],
            "type": "string",
            "description": "keywords: interest over time (plus optional regions and related queries) for your keywords or topics. risingWatcher: only the rising related queries that earlier runs have not reported yet, for schedules. trendingNow: Google's live trending searches with traffic and news.",
            "default": "keywords"
          },
          "keywords": {
            "title": "Keywords or topics",
            "type": "array",
            "description": "Any number of search terms. More than 5 are automatically put on one shared 0-100 scale using an anchor keyword, so they stay comparable. To measure a Knowledge Graph topic instead of an exact phrase, enter its ID (/m/05z1_) or prefix the word with 'topic:' (topic:python). Add '|type' to pick a meaning, e.g. topic:jaguar|animal.",
            "items": {
              "type": "string"
            }
          },
          "geo": {
            "title": "Country or region",
            "type": "string",
            "description": "Two-letter country code (US, GB, DE) or a sub-region code (US-CA, US-NY). Leave empty for worldwide."
          },
          "timeframe": {
            "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": "Same ranges as the Google Trends website.",
            "default": "today 12-m"
          },
          "startDate": {
            "title": "Start date (custom range)",
            "type": "string",
            "description": "YYYY-MM-DD"
          },
          "endDate": {
            "title": "End date (custom range)",
            "type": "string",
            "description": "YYYY-MM-DD"
          },
          "searchType": {
            "title": "Search type",
            "enum": [
              "web",
              "news",
              "images",
              "youtube",
              "shopping"
            ],
            "type": "string",
            "description": "Which Google property to measure: web search, news, images, YouTube or Shopping.",
            "default": "web"
          },
          "category": {
            "title": "Category ID",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category number, 0 for all categories (e.g. 3 = Arts & Entertainment, 7 = Finance, 18 = Shopping).",
            "default": 0
          },
          "includeRelated": {
            "title": "Related queries and topics",
            "type": "boolean",
            "description": "Top and rising related searches and topics for each keyword.",
            "default": true
          },
          "dropUnrelatedRising": {
            "title": "Drop unrelated rising queries",
            "type": "boolean",
            "description": "Google's rising lists often include generic searches unrelated to your keyword (for example 'best restaurants near me' under python). Turn on to keep only rising queries that share a word with the keyword or topic title. Applies to related queries in keyword mode and to the rising queries watcher, where dropped queries are not charged. Off by default because it also drops related queries that use other words (such as 'sabrina carpenter' under taylor swift); every rising query carries matchesKeyword either way.",
            "default": false
          },
          "includeRegions": {
            "title": "Interest by region",
            "type": "boolean",
            "description": "Interest per country, or per state when a country is selected.",
            "default": false
          },
          "regionResolution": {
            "title": "Region level",
            "enum": [
              "COUNTRY",
              "REGION",
              "DMA",
              "CITY"
            ],
            "type": "string",
            "description": "Leave empty for the natural level of the selected geo."
          },
          "anchorKeyword": {
            "title": "Anchor keyword",
            "type": "string",
            "description": "Used to stitch more than 5 keywords onto one scale. Defaults to the first keyword; pick a steadily popular term."
          },
          "watchTimeframe": {
            "title": "Watcher time range",
            "enum": [
              "now 1-d",
              "now 7-d",
              "today 1-m",
              "today 3-m",
              "today 12-m"
            ],
            "type": "string",
            "description": "Rising-watcher mode: the window Google measures rising queries over. Past 7 days suits daily schedules, past 30 days weekly ones.",
            "default": "now 7-d"
          },
          "outputBaselineOnFirstRun": {
            "title": "Output current rising queries on the first run",
            "type": "boolean",
            "description": "Rising-watcher mode: on the first run for a keyword and region, output everything rising now (marked isBaseline). Turn off to only remember them silently and report from the second run on.",
            "default": true
          },
          "forgetAfterDays": {
            "title": "Forget queries after (days)",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "Rising-watcher mode: a query that has not been rising for this many days counts as new again if it comes back. 0 never forgets.",
            "default": 30
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Rising-watcher mode: named key-value store in your account that remembers what was already reported, one record per keyword and region. Use a different name to keep separate watch lists apart.",
            "default": "google-trends-rising-watcher"
          },
          "trendingGeos": {
            "title": "Countries for trending searches",
            "type": "array",
            "description": "Trending-now mode: country codes, e.g. US, GB, IN.",
            "items": {
              "type": "string"
            }
          },
          "maxTrendingPerGeo": {
            "title": "Max trending searches per country",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Max trending searches per country",
            "default": 50
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Google rate-limits Trends. Apify datacenter proxy with automatic session rotation works for most runs; switch to Residential for very large jobs.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}