{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper API - Interest Over Time, Related Queries",
    "description": "Google Trends API and scraper with no Google account or API key: search interest over time, compare up to 5 keywords, interest by region, and top and rising related queries. Trending Now lists every trending search with news. A pytrends alternative for Python, n8n and AI agents. No start fee.",
    "version": "1.0",
    "x-build-id": "Sn8fct9oiWmUcvEcv"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/anshumanatrey~google-trends-api-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-anshumanatrey-google-trends-api-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/anshumanatrey~google-trends-api-scraper/runs": {
      "post": {
        "operationId": "runs-sync-anshumanatrey-google-trends-api-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/anshumanatrey~google-trends-api-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-anshumanatrey-google-trends-api-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": {
          "mode": {
            "title": "Report type (mode)",
            "enum": [
              "keywords",
              "compare",
              "trending",
              "suggestions"
            ],
            "type": "string",
            "description": "Choose the report type. keywords: each keyword on its own 0 to 100 scale. compare: 2 to 5 keywords on one shared scale, like typing them side by side on trends.google.com. trending: every Trending Now search in a country. suggestions: the topics Google matches each keyword to.",
            "default": "keywords"
          },
          "searchTerms": {
            "title": "Keywords (searchTerms)",
            "type": "array",
            "description": "Type the keywords to look up, one per line, for example bitcoin. \"bitcoin, ethereum\" on one line counts as two keywords, and you can paste a Google Trends link: its keywords, country and dates are used. In compare mode, enter 2 to 5. Not needed for Trending Now. Technical: search terms or topic ids such as /m/05p0rrx (Bitcoin); same as kw_list in pytrends and q in SerpApi.",
            "items": {
              "type": "string"
            }
          },
          "geo": {
            "title": "Country (geo)",
            "type": "string",
            "description": "Pick a country, or leave it on Worldwide (WW). You can also type a country name such as India or a two-letter code such as IN. Trending Now uses United States when this is empty. Technical: Google Trends geo, ISO 3166-1 alpha-2; states and cities are not supported.",
            "default": "WW"
          },
          "timeRange": {
            "title": "Time period (timeRange)",
            "pattern": "^(now (1-H|4-H|1-d|7-d)|today (1-m|3-m|12-m|5-y)|all|\\d{4}-\\d{2}-\\d{2} \\d{4}-\\d{2}-\\d{2})$",
            "type": "string",
            "description": "Pick the time period to look at, or type your own dates as two YYYY-MM-DD dates with a space, such as 2024-01-01 2024-06-30. Google picks the step: minutes for the past hour, hours for 7 days, days for 3 months, weeks for 12 months. Same as timeframe in pytrends and date in SerpApi.",
            "default": "today 12-m"
          },
          "dataTypes": {
            "title": "Data to fetch (dataTypes)",
            "type": "array",
            "description": "Choose the data to fetch for each keyword: interest over time, interest by region and related queries (top and rising). All three by default. Related queries are billed as their own event per keyword, see Pricing. Fewer parts also finish sooner. Same idea as data_type in SerpApi.",
            "items": {
              "type": "string",
              "enum": [
                "interestOverTime",
                "interestByRegion",
                "relatedQueries"
              ],
              "enumTitles": [
                "Timeline (interestOverTime)",
                "By region (interestByRegion)",
                "Related queries (relatedQueries)"
              ]
            },
            "default": [
              "interestOverTime",
              "interestByRegion",
              "relatedQueries"
            ]
          },
          "property": {
            "title": "Search type (property)",
            "enum": [
              "web",
              "news",
              "images",
              "youtube",
              "froogle"
            ],
            "type": "string",
            "description": "Pick the search type to measure: web search (the default), News, Images, YouTube or Google Shopping. Same as gprop in pytrends and SerpApi (froogle is Google's own code for Shopping).",
            "default": "web"
          },
          "category": {
            "title": "Subject area (category)",
            "minimum": 0,
            "type": "integer",
            "description": "Enter a subject area number to count only searches about one subject, or 0 for all subjects (the default). These are Google Trends category ids, for example 7 Finance, 5 Computers & Electronics, 71 Food & Drink, 20 Sports, 3 Arts & Entertainment. Same as cat in pytrends and SerpApi.",
            "default": 0
          },
          "regionLevel": {
            "title": "Region detail (regionLevel)",
            "enum": [
              "auto",
              "country",
              "region",
              "city"
            ],
            "type": "string",
            "description": "Choose the region detail for interest by region: countries, states or provinces, or cities. auto lets Google choose: countries for worldwide, states or provinces inside one country. Same as resolution in pytrends.",
            "default": "auto"
          },
          "trendingHours": {
            "title": "Trending period (trendingHours)",
            "enum": [
              "4",
              "24",
              "48",
              "168"
            ],
            "type": "string",
            "description": "Pick the trending period for Trending Now: the past 4, 24 or 48 hours, or the past 7 days (168 hours). Used only in trending mode. Same as hours in SerpApi's Trending Now API.",
            "default": "24"
          },
          "trendingCategory": {
            "title": "Trend topic (trendingCategory)",
            "enum": [
              "all",
              "autos",
              "beauty",
              "business",
              "climate",
              "entertainment",
              "food",
              "games",
              "health",
              "hobbies",
              "jobs",
              "law",
              "other",
              "pets",
              "politics",
              "science",
              "shopping",
              "sports",
              "technology",
              "travel"
            ],
            "type": "string",
            "description": "Pick a trend topic to keep only the trends Google files under it, such as sports, technology or politics. all keeps every trend (the default). These are Google's 19 Trending Now topics, a different list from the subject area numbers. Used only in trending mode. Same as category_id in SerpApi's Trending Now API, which takes Google's numbers (18 is technology).",
            "default": "all"
          },
          "newsPerTrend": {
            "title": "News stories (newsPerTrend)",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Enter how many news stories to attach to each trend, from 0 to 10. Default 3. News is included in the trend price. Used only in trending mode.",
            "default": 3
          },
          "maxItems": {
            "title": "Number of trends (maxItems)",
            "minimum": 0,
            "type": "integer",
            "description": "Enter the number of trends to save at most, to cap what a Trending Now run costs. 0 saves every trend (the default). Used only in trending mode.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}