{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper: Related Queries & Trending Searches",
    "description": "Google Trends data as JSON: interest over time, interest by region and top and rising related queries for up to 5 keywords per comparison, any geo, time range, category or search type. Plus Trending Now by country. $1 per 1,000 comparisons, failures free. Final test: 58 of 58 ok.",
    "version": "1.0",
    "x-build-id": "fubiWz7f0pSaRzk4K"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/heyitsgautham~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-heyitsgautham-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/heyitsgautham~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-heyitsgautham-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/heyitsgautham~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-heyitsgautham-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": {
          "comparisons": {
            "title": "Keyword comparisons",
            "type": "array",
            "description": "One comparison per line, with 1 to 5 keywords separated by commas, exactly like the compare box on trends.google.com. Turn on More than 5 keywords on one scale below for up to 50. Each comparison returns interest over time, interest by region and related queries. Through the API you can also pass objects such as {\"keywords\": [\"tea\", \"coffee\"], \"geo\": \"GB\", \"timeRange\": \"today 5-y\"} to override the settings below per comparison.",
            "items": {
              "type": "string"
            }
          },
          "geo": {
            "title": "Location",
            "type": "string",
            "description": "Country code such as US, GB or IN, or a region such as 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",
              "custom"
            ],
            "type": "string",
            "description": "Same choices as the Google Trends website. Pick Custom to use the custom date range below.",
            "default": "today 12-m"
          },
          "customTimeRange": {
            "title": "Custom date range",
            "type": "string",
            "description": "Start and end date as YYYY-MM-DD YYYY-MM-DD, for example 2024-01-01 2024-06-30. Used when the time range is Custom. Data starts in 2004."
          },
          "category": {
            "title": "Category",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category id. 0 means all categories. Common ids are 3 Arts and Entertainment, 5 Computers and Electronics, 7 Finance, 12 Business and Industrial, 18 Shopping, 20 Sports, 45 Health, 71 Food and Drink. The id is the cat= value in a trends.google.com URL.",
            "default": 0
          },
          "property": {
            "title": "Search type",
            "enum": [
              "web",
              "youtube",
              "news",
              "images",
              "shopping"
            ],
            "type": "string",
            "description": "Which Google search the data comes from.",
            "default": "web"
          },
          "includeInterestByRegion": {
            "title": "Include interest by region",
            "type": "boolean",
            "description": "Adds one row per comparison with countries (for worldwide) or subregions (for a country).",
            "default": true
          },
          "includeRelatedQueries": {
            "title": "Include related queries",
            "type": "boolean",
            "description": "Adds one row per keyword with the top and rising related searches.",
            "default": true
          },
          "regionResolution": {
            "title": "Region breakdown",
            "enum": [
              "default",
              "city",
              "metro"
            ],
            "type": "string",
            "description": "Default gives countries for worldwide and subregions such as US states for a country. City gives cities. Metro gives US metro areas (Nielsen DMA), only for US locations. Applies to the interest by region row.",
            "default": "default"
          },
          "moreThanFiveKeywords": {
            "title": "More than 5 keywords on one scale",
            "type": "boolean",
            "description": "Lets a comparison hold 6 to 50 keywords. Google compares at most 5, so the scraper fetches them in batches that share one anchor keyword and puts every keyword on one 0 to 100 scale. Each batch Google returns data for is one charged keyword comparison, so 9 keywords cost 2 and 13 cost 3.",
            "default": false
          },
          "trendsUrls": {
            "title": "Google Trends URLs",
            "type": "array",
            "description": "Paste links from trends.google.com. An explore link (trends.google.com/trends/explore?q=...) runs that comparison with its own location, time range, category and search type. A trending link (trends.google.com/trending?geo=US) returns Trending Now for that country, window and category.",
            "items": {
              "type": "string"
            }
          },
          "researchKeywords": {
            "title": "Research keywords",
            "type": "array",
            "description": "One keyword per line. For each one the scraper fetches its timeline, regions and related queries, then each related query's own timeline with its growth: the average of the last quarter of the time range against the quarter before (for 12 months, the last 3 months against the 3 before). Uses the location, time range, category and search type above. The keyword and each related query with data are one charged keyword comparison each.",
            "items": {
              "type": "string"
            }
          },
          "researchMaxRelated": {
            "title": "Related queries to research per keyword",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "How many related queries get their own timeline, at most 25. This caps the cost of one research keyword at 1 plus this number of keyword comparisons.",
            "default": 10
          },
          "researchRelatedType": {
            "title": "Which related queries to research",
            "enum": [
              "both",
              "rising",
              "top"
            ],
            "type": "string",
            "description": "Rising first then top, rising only, or top only.",
            "default": "both"
          },
          "trendingCountries": {
            "title": "Trending Now countries",
            "type": "array",
            "description": "Two-letter country codes such as US, IN or DE. Returns the searches trending right now in each country, like trends.google.com/trending.",
            "items": {
              "type": "string"
            }
          },
          "trendingHours": {
            "title": "Trending window",
            "enum": [
              "4",
              "24",
              "48",
              "168"
            ],
            "type": "string",
            "description": "Searches that started trending within this many hours.",
            "default": "24"
          },
          "trendingCategories": {
            "title": "Trending categories",
            "type": "array",
            "description": "Only keep trending searches in these categories. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9",
                "10",
                "11",
                "13",
                "14",
                "15",
                "16",
                "17",
                "18",
                "19",
                "20"
              ],
              "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",
                "Other",
                "Pets and Animals",
                "Politics",
                "Science",
                "Shopping",
                "Sports",
                "Technology",
                "Travel and Transportation",
                "Climate"
              ]
            }
          },
          "trendingActiveOnly": {
            "title": "Active trends only",
            "type": "boolean",
            "description": "Drop searches whose trend has already ended.",
            "default": false
          },
          "trendingMaxItems": {
            "title": "Max trending searches per country",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Keeps the top N trending searches for each country. Each returned search is one charged trending_search event.",
            "default": 50
          },
          "onlyNewSinceLastRun": {
            "title": "Only new trending searches since the last run",
            "type": "boolean",
            "description": "For scheduled runs. Returns only the trending searches, among each country's top N above, that this actor has not returned to you before for the same country and categories. A search that starts trending again later counts as new. The first run returns the usual list and remembers it. Applies to Trending Now only, not to keyword comparisons. The memory is a key-value store named google-trends-scraper-monitor in your Apify account.",
            "default": false
          },
          "language": {
            "title": "Interface language",
            "type": "string",
            "description": "Language for region names, dates and categories, for example en-US, de or ja.",
            "default": "en-US"
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many comparisons and countries to fetch in parallel.",
            "default": 5
          },
          "useProxy": {
            "title": "Use residential proxy",
            "type": "boolean",
            "description": "Leave on. Google Trends blocks cloud IPs.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}