{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends API & Scraper",
    "description": "Find out what people search for, and when. For any keywords: growth, seasonal peaks and the date to publish by, breakout queries and top regions, compared on one scale. Plus Trending Now: every search trending in any country, with volume and related searches. Export to Excel or API.",
    "version": "0.1",
    "x-build-id": "WM8taFyGNSsTY99sP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kwerix~google-trends-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kwerix-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/kwerix~google-trends-api/runs": {
      "post": {
        "operationId": "runs-sync-kwerix-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/kwerix~google-trends-api/run-sync": {
      "post": {
        "operationId": "run-sync-kwerix-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "keywords",
              "trending"
            ],
            "type": "string",
            "description": "Keyword analysis studies the keywords you give. Trending Now lists every search trending in a country right now, with search volume, growth and related queries.",
            "default": "keywords"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Search terms to analyze (Keyword analysis mode). Each keyword is one result. Topic IDs such as /m/0dl567 are accepted too.",
            "items": {
              "type": "string"
            }
          },
          "trendsUrls": {
            "title": "Google Trends URLs",
            "type": "array",
            "description": "Optional. Paste Google Trends explore URLs (trends.google.com/trends/explore?q=...). Each keyword in the URL is analyzed with the URL's own location, time range, search type and category.",
            "items": {
              "type": "string"
            }
          },
          "geo": {
            "title": "Location",
            "type": "string",
            "description": "Country or region code (US, GB, ES, US-CA...). 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"
            ],
            "type": "string",
            "description": "Seasonality and year-over-year change need at least 2 years (Past 5 years or 2004–present).",
            "default": "today 5-y"
          },
          "customTimeRange": {
            "title": "Custom time range",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2} \\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Overrides Time range. Format: YYYY-MM-DD YYYY-MM-DD, e.g. 2020-01-01 2024-12-31."
          },
          "property": {
            "title": "Search type",
            "enum": [
              "",
              "images",
              "news",
              "froogle",
              "youtube"
            ],
            "type": "string",
            "description": "Which Google search to measure: web, images, news, Google Shopping or YouTube.",
            "default": ""
          },
          "category": {
            "title": "Category ID",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category ID (0 = all categories).",
            "default": 0
          },
          "includeRelatedQueries": {
            "title": "Related queries (top and rising)",
            "type": "boolean",
            "description": "Rising queries marked as Breakout grew more than 5000%.",
            "default": true
          },
          "includeInterestByRegion": {
            "title": "Interest by region",
            "type": "boolean",
            "description": "Relative interest per country, region, metro or city.",
            "default": false
          },
          "regionResolution": {
            "title": "Region resolution",
            "enum": [
              "AUTO",
              "COUNTRY",
              "REGION",
              "DMA"
            ],
            "type": "string",
            "description": "Granularity of the regional breakdown. Automatic follows the location (countries for worldwide, regions for a country). City level is not offered: Google returns no data for it.",
            "default": "AUTO"
          },
          "includeInterestOverTime": {
            "title": "Full interest-over-time timeline",
            "type": "boolean",
            "description": "Adds the raw timeline (and the common-scale timeline when comparing) to each result. Averages, trend, YoY and seasonality are always computed. Off by default to keep results compact for spreadsheets and AI agents; turn it on to chart the data.",
            "default": false
          },
          "compareKeywords": {
            "title": "Compare all keywords on one scale",
            "type": "boolean",
            "description": "Google Trends compares at most 5 terms. This batches keywords with a shared anchor term and rescales them onto one 0–100 scale, so any number of keywords can be ranked by relative popularity.",
            "default": false
          },
          "anchorKeyword": {
            "title": "Anchor keyword",
            "type": "string",
            "description": "Term shared by every batch. Pick one of medium popularity among your keywords. Defaults to the first keyword."
          },
          "seasonalityLeadDays": {
            "title": "Publish lead time (days)",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "publishBy = next seasonal peak minus this many days. 45 days lets new content collect rankings and user signals before demand peaks.",
            "default": 45
          },
          "trendingGeos": {
            "title": "Countries",
            "type": "array",
            "description": "Country codes for Trending Now (US, GB, ES, DE...). One request per country.",
            "items": {
              "type": "string"
            }
          },
          "trendingHours": {
            "title": "Trending in the last",
            "enum": [
              "4",
              "24",
              "48",
              "168"
            ],
            "type": "string",
            "description": "Time window of Trending Now. The US returns roughly 30 trends for 4 hours, 300 for 24 hours and 1,900 for 7 days.",
            "default": "24"
          },
          "trendingActiveOnly": {
            "title": "Only trends still active",
            "type": "boolean",
            "description": "Skip trends that have already ended.",
            "default": false
          },
          "trendingCategories": {
            "title": "Categories",
            "type": "array",
            "description": "Optional. Keep only trends in these categories.",
            "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"
              ]
            }
          },
          "maxTrendingPerGeo": {
            "title": "Max trends per country",
            "minimum": 0,
            "type": "integer",
            "description": "0 returns all of them. Each trend is one result.",
            "default": 0
          },
          "language": {
            "title": "Interface language",
            "type": "string",
            "description": "Language for dates and topic names, e.g. en-US, es-ES.",
            "default": "en-US"
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Keywords processed in parallel.",
            "default": 3
          },
          "tryWithoutProxyFirst": {
            "title": "Try without proxy first",
            "type": "boolean",
            "description": "Start on the server's own IP and switch to the proxy only when Google blocks it.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Used once Google rate-limits the direct connection. Residential proxies are the most reliable for Google Trends.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}