{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper & API: Related Queries, Trending Now",
    "description": "Compare up to 5 keywords on Google Trends for any country, time range, category and search type (web, news, images, YouTube, Shopping). Get interest over time, interest by region, top and rising related queries and topics, plus Trending Now by country. $3 per 1,000 search terms, no start fee.",
    "version": "1.0",
    "x-build-id": "8YWTMBcOSKByBkcsf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tidewell~google-trends-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tidewell-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/tidewell~google-trends-api/runs": {
      "post": {
        "operationId": "runs-sync-tidewell-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/tidewell~google-trends-api/run-sync": {
      "post": {
        "operationId": "run-sync-tidewell-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": {
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "One comparison per line. Put up to 5 terms on one line, separated by commas, to compare them on the same 0-100 scale (e.g. 'chatgpt, gemini, claude'). A line with one term is fetched on its own. Topic IDs such as /m/0dl567 work too. Each term that returns data is one charged result.",
            "items": {
              "type": "string"
            }
          },
          "geo": {
            "title": "Country / region",
            "type": "string",
            "description": "Two-letter country code (US, GB, DE, IN), a region code (US-CA, GB-ENG), or leave empty for Worldwide. Separate several with commas to run every comparison for each one, e.g. 'US, GB, DE'.",
            "default": ""
          },
          "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"
            ],
            "type": "string",
            "description": "The period to fetch. Google picks the resolution: minutes or hours for 'now' ranges, days up to 9 months, weeks up to 5 years, months beyond that.",
            "default": "today 12-m"
          },
          "customTimeframe": {
            "title": "Custom time range",
            "type": "string",
            "description": "Overrides 'Time range'. Dates as 'YYYY-MM-DD YYYY-MM-DD' (e.g. '2024-01-01 2024-12-31'), or hourly as 'YYYY-MM-DDTHH YYYY-MM-DDTHH' for windows up to 7 days."
          },
          "category": {
            "title": "Category",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category ID to narrow the meaning of a term. 0 = all categories. Top-level IDs: 3 Arts & Entertainment, 5 Computers & Electronics, 7 Finance, 8 Games, 11 Home & Garden, 12 Business & Industrial, 13 Internet & Telecom, 16 News, 18 Shopping, 20 Sports, 29 Real Estate, 44 Beauty & Fitness, 45 Health, 47 Autos & Vehicles, 65 Hobbies & Leisure, 66 Pets & Animals, 67 Travel, 71 Food & Drink, 174 Science, 958 Jobs & Education. Sub-categories work too (see the README).",
            "default": 0
          },
          "property": {
            "title": "Search type",
            "enum": [
              "",
              "news",
              "images",
              "youtube",
              "froogle"
            ],
            "type": "string",
            "description": "Which Google search to measure.",
            "default": ""
          },
          "includeInterestOverTime": {
            "title": "Interest over time",
            "type": "boolean",
            "description": "The 0-100 time series, with average, peak and latest values.",
            "default": true
          },
          "includeInterestByRegion": {
            "title": "Interest by region",
            "type": "boolean",
            "description": "Interest per country (Worldwide) or per subregion (country). When comparing terms, also the share of each term per region.",
            "default": true
          },
          "regionResolution": {
            "title": "Region resolution",
            "enum": [
              "auto",
              "COUNTRY",
              "REGION",
              "DMA",
              "CITY"
            ],
            "type": "string",
            "description": "Level of the interest-by-region breakdown. 'Auto' uses Google's default (countries for Worldwide, subregions for a country). Metro (DMA) is US only.",
            "default": "auto"
          },
          "includeLowSearchVolumeRegions": {
            "title": "Include low-volume regions",
            "type": "boolean",
            "description": "Also list regions with low search volume, as the checkbox on the Trends page does.",
            "default": false
          },
          "includeRelatedQueries": {
            "title": "Related queries (top and rising)",
            "type": "boolean",
            "description": "Top and rising related searches per term, with 'Breakout' flags.",
            "default": true
          },
          "includeRelatedTopics": {
            "title": "Related topics (top and rising)",
            "type": "boolean",
            "description": "Top and rising related topics per term. When comparing several terms this needs one extra explore per term. Google often returns an empty list here for automated requests.",
            "default": true
          },
          "trendingGeos": {
            "title": "Trending Now countries",
            "type": "array",
            "description": "Country codes, one per line (e.g. US, GB, DE, IN). Returns the current trending searches with approximate search volume, start time and the news articles behind each. Charged per trending search.",
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "perTerm",
              "rows"
            ],
            "type": "string",
            "description": "'One row per search term' keeps each term's time series, regions and related queries together (best for JSON and APIs). 'One row per data point' writes long-format rows (date / region / query) that open directly in Excel, Sheets and BI tools. The price is the same: you pay per search term, not per row.",
            "default": "perTerm"
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Language for region names and topic titles, e.g. en-US, en-GB, de, fr, ja.",
            "default": "en-US"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify Proxy is recommended for runs with more than a few comparisons.",
            "default": {
              "useApifyProxy": true
            }
          },
          "requestDelaySecs": {
            "title": "Delay between requests (seconds)",
            "minimum": 0.2,
            "maximum": 30,
            "type": "number",
            "description": "Minimum gap between requests to Google. Lower is faster but more likely to be rate-limited.",
            "default": 1
          },
          "maxRetries": {
            "title": "Max retries per request",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Retries for rate-limited (429) or failed requests, with exponential backoff.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}