{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper & API - Bulk Keywords, Daily Data",
    "description": "Google Trends API and pytrends alternative: interest over time for hundreds of keywords on one comparable scale, daily historical data for multi-year ranges, interest by region, related queries and Trending Now searches.",
    "version": "0.1",
    "x-build-id": "qysTDsinXkxuPyhWD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/headply~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-headply-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/headply~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-headply-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/headply~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-headply-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": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "interestOverTime",
              "trendingNow"
            ],
            "type": "string",
            "description": "<b>Interest over time</b> returns a time series (and optionally regions and related queries) for your keywords. <b>Trending now</b> returns what is spiking in Google Search right now, with search volume.",
            "default": "interestOverTime"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "One search term per line. No limit of five: add up to 500 and they are all returned on one comparable scale. Topic IDs such as <b>/m/07bsy</b> also work. Used in <i>Interest over time</i> mode.",
            "items": {
              "type": "string"
            }
          },
          "geos": {
            "title": "Locations",
            "type": "array",
            "description": "Country or region codes, one per line: <b>US</b>, <b>GB</b>, <b>US-CA</b> (California), <b>US-NY-501</b> (New York metro). Leave empty for worldwide. Each location is a separate set of results.",
            "items": {
              "type": "string"
            }
          },
          "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": "The period to cover. Pick <b>Custom</b> to set exact dates below.",
            "default": "today 12-m"
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "First day of a custom range, from 2004-01-01."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Last day of a custom range. Leave empty for today."
          },
          "dailyResolution": {
            "title": "Daily data for long ranges",
            "type": "boolean",
            "description": "Google only gives daily points for ranges up to about nine months, then switches to weekly or monthly. Turn this on to get one daily point per day over any range, even 2004 to today. Each window is calibrated against the full-range series so the levels stay consistent across years.",
            "default": false
          },
          "normalizeAcrossBatches": {
            "title": "Put all keywords on one scale",
            "type": "boolean",
            "description": "Google compares at most five keywords at a time and scales each comparison on its own. With this on, keywords beyond five are linked through shared keywords, so 100 means the same thing for every keyword in the run. Turn off to process independent groups of five.",
            "default": true
          },
          "includeInterestByRegion": {
            "title": "Interest by region",
            "type": "boolean",
            "description": "Add each keyword's interest per country, state, metro or city.",
            "default": false
          },
          "regionResolution": {
            "title": "Region level",
            "enum": [
              "auto",
              "COUNTRY",
              "REGION",
              "DMA",
              "CITY"
            ],
            "type": "string",
            "description": "The level for interest by region. <b>Auto</b> uses countries for worldwide and states or provinces for a country. Metro areas are available for the US.",
            "default": "auto"
          },
          "includeRelatedQueries": {
            "title": "Related and rising queries",
            "type": "boolean",
            "description": "Add the top related searches and the fastest-rising ones (including Breakouts) for each keyword.",
            "default": false
          },
          "includeTimeline": {
            "title": "Include the full time series",
            "type": "boolean",
            "description": "Turn off if you only need the summary numbers (average, peak, latest, change).",
            "default": true
          },
          "category": {
            "title": "Category",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category ID to narrow the meaning of a keyword, for example <b>71</b> for Food & Drink or <b>12</b> for Business & Industrial. 0 means all categories.",
            "default": 0
          },
          "searchProperty": {
            "title": "Search type",
            "enum": [
              "web",
              "images",
              "news",
              "youtube",
              "shopping"
            ],
            "type": "string",
            "description": "Which Google search to measure.",
            "default": "web"
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Interface language for names of regions and topics, for example en-US or de-DE.",
            "default": "en-US"
          },
          "trendingGeos": {
            "title": "Trending now: countries",
            "type": "array",
            "description": "Country codes for <i>Trending now</i> mode, one per line.",
            "items": {
              "type": "string"
            }
          },
          "trendingHours": {
            "title": "Trending now: window",
            "enum": [
              "4",
              "24",
              "48",
              "168"
            ],
            "type": "string",
            "description": "How far back to look.",
            "default": "24"
          },
          "trendingActiveOnly": {
            "title": "Only trends still active",
            "type": "boolean",
            "description": "Skip trends that have already ended.",
            "default": false
          },
          "trendingMinVolume": {
            "title": "Minimum search volume",
            "minimum": 0,
            "type": "integer",
            "description": "Skip trends below this approximate number of searches.",
            "default": 0
          },
          "trendingCategories": {
            "title": "Categories",
            "type": "array",
            "description": "Keep only these categories. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "Autos and Vehicles",
                "Beauty and Fashion",
                "Business and Finance",
                "Climate",
                "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"
              ]
            }
          },
          "maxTrendingItems": {
            "title": "Maximum trends per country",
            "minimum": 0,
            "type": "integer",
            "description": "0 means all.",
            "default": 0
          },
          "maxConcurrency": {
            "title": "Parallel sessions",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "How many Google sessions run at once. Higher is faster for large keyword lists; each session uses its own IP.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Google throttles Trends per IP. Residential proxies give the most reliable results.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}