{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper — Forecast, Seasonality & Countries",
    "description": "Google Trends for many keywords and countries on one comparable scale, plus what other scrapers don't give: seasonality (peak months), year-over-year growth, spike detection and a 12-month forecast with its measured error. Related queries, regions, trending now.",
    "version": "0.1",
    "x-build-id": "1AndPr9sbbQ32bVzo"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/angelrxdriguez~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-angelrxdriguez-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/angelrxdriguez~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-angelrxdriguez-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/angelrxdriguez~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-angelrxdriguez-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "explore",
              "trendingNow"
            ],
            "type": "string",
            "description": "<b>explore</b>: interest over time, by region, related queries and the forecast & seasonality analysis for your keywords. <b>trendingNow</b>: what people are searching for right now in one or more countries.",
            "default": "explore"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Search terms to analyze, e.g. air fryer, bitcoin, yoga mat. Every keyword is analyzed in every location.",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Locations",
            "type": "array",
            "description": "Two-letter country codes (US, GB, DE, ES, IN...), regions such as US-CA, or worldwide. Leave empty for the United States.",
            "items": {
              "type": "string"
            }
          },
          "timeRange": {
            "title": "Time range",
            "enum": [
              "past hour",
              "past 4 hours",
              "past day",
              "past 7 days",
              "past 30 days",
              "past 90 days",
              "past 12 months",
              "past 5 years",
              "since 2004"
            ],
            "type": "string",
            "description": "Period for interest over time, by region and related queries. The forecast & seasonality analysis always uses the past 5 years.",
            "default": "past 12 months"
          },
          "startDate": {
            "title": "Custom start date",
            "type": "string",
            "description": "Optional (YYYY-MM-DD). With an end date, replaces the time range."
          },
          "endDate": {
            "title": "Custom end date",
            "type": "string",
            "description": "Optional (YYYY-MM-DD). Defaults to today when only a start date is set."
          },
          "dataTypes": {
            "title": "Data to collect",
            "type": "array",
            "description": "Each type is one result per keyword and location. <b>Analysis</b> adds seasonality (peak and low months), year-over-year growth, momentum, spike detection and a 12-month forecast with its measured error.",
            "items": {
              "type": "string",
              "enum": [
                "interestOverTime",
                "interestByRegion",
                "relatedQueries",
                "analysis"
              ],
              "enumTitles": [
                "Interest over time",
                "Interest by region",
                "Related queries (top & rising)",
                "Forecast & seasonality analysis"
              ]
            },
            "default": [
              "interestOverTime",
              "interestByRegion",
              "relatedQueries",
              "analysis"
            ]
          },
          "compareMode": {
            "title": "Scale",
            "enum": [
              "together",
              "separate"
            ],
            "type": "string",
            "description": "<b>One shared scale</b>: every keyword and location on the same 0-100 scale, so you can compare them directly (more than 5 are linked through a reference term). <b>Own scale</b>: each keyword and location scaled 0-100 on its own.",
            "default": "together"
          },
          "forecastMonths": {
            "title": "Forecast months",
            "minimum": 0,
            "maximum": 12,
            "type": "integer",
            "description": "How many months ahead to forecast (0 = no forecast, only seasonality and growth).",
            "default": 12
          },
          "searchType": {
            "title": "Search type",
            "enum": [
              "web",
              "images",
              "news",
              "youtube",
              "shopping"
            ],
            "type": "string",
            "description": "Google property, as in the Google Trends menu.",
            "default": "web"
          },
          "category": {
            "title": "Category",
            "enum": [
              "0",
              "3",
              "47",
              "44",
              "22",
              "12",
              "5",
              "7",
              "71",
              "8",
              "45",
              "65",
              "11",
              "13",
              "958",
              "19",
              "16",
              "299",
              "14",
              "66",
              "29",
              "533",
              "174",
              "18",
              "20",
              "67"
            ],
            "type": "string",
            "description": "Limit results to a category, e.g. Shopping or Health.",
            "default": "0"
          },
          "regionResolution": {
            "title": "Region detail",
            "enum": [
              "auto",
              "COUNTRY",
              "REGION",
              "CITY",
              "DMA"
            ],
            "type": "string",
            "description": "Detail of interest by region: countries (for worldwide), regions or states, cities, or metro areas (US DMA).",
            "default": "auto"
          },
          "includeLowVolumeRegions": {
            "title": "Include low-volume regions",
            "type": "boolean",
            "description": "Also return regions where search volume is low.",
            "default": false
          },
          "trendingCountries": {
            "title": "Countries for trending now",
            "type": "array",
            "description": "Two-letter country codes, e.g. US, GB, IN, BR. Leave empty for the United States.",
            "items": {
              "type": "string"
            }
          },
          "onlyNewTrends": {
            "title": "Only new trends",
            "type": "boolean",
            "description": "Skip trends already returned in previous runs with the same State key. Ideal for scheduled alerts: you only pay for what is new.",
            "default": false
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Name of the memory used by Only new trends. Use a different key for each scheduled task.",
            "default": "default"
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "nested",
              "flat"
            ],
            "type": "string",
            "description": "<b>Nested</b>: one row per keyword, location and data type, with arrays (best for JSON and APIs). <b>Flat</b>: one row per date, region, query and forecast month (best for Excel and Google Sheets). The price is the same.",
            "default": "nested"
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Google Trends interface language for region names, e.g. en-US, es, de, fr.",
            "default": "en-US"
          },
          "secondsBetweenRequests": {
            "title": "Seconds between requests",
            "minimum": 1.5,
            "maximum": 30,
            "type": "number",
            "description": "Pause between requests to Google Trends. The scraper slows down by itself if Google asks it to.",
            "default": 2
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}