{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper — Interest, Regions & Queries",
    "description": "Extract all 5 Google Trends data types: keyword interest over time, by region, related queries, related topics & daily trending searches. No API key.",
    "version": "1.3",
    "x-build-id": "4NXPUsCYCz0VVt69g"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-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/khadinakbar~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-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/khadinakbar~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-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": {
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "List of 1–5 search terms to analyze on Google Trends. Use this when the user provides specific keywords, topics, or brand names to compare (e.g. ['ChatGPT', 'Gemini', 'Copilot']). Required when requesting interest_over_time / interest_by_region / related_queries / related_topics. Not required when only fetching trending_searches. Maximum 5 keywords — Google enforces this limit on comparison.",
            "items": {
              "type": "string"
            }
          },
          "geo": {
            "title": "Geographic Region",
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code to filter trends by location (e.g. 'US', 'GB', 'IN', 'DE'). Use '' (empty string) for worldwide. This also picks the residential proxy country, which is critical for reliability — Google blocks mismatched IP/geo pairs."
          },
          "timeframe": {
            "title": "Timeframe",
            "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": "Date range for trend data. Past month / 3 months / 12 months are the most reliable; 'all' (since 2004) is the slowest. Overridden by customTimeRange if provided.",
            "default": "today 12-m"
          },
          "property": {
            "title": "Property / Search Type",
            "enum": [
              "web",
              "news",
              "images",
              "youtube",
              "froogle"
            ],
            "type": "string",
            "description": "Which Google property to analyze. 'web' is normal Google Search (default and most reliable). Other properties return narrower data — for instance YouTube returns YouTube-specific interest curves, which differ from web search.",
            "default": "web"
          },
          "category": {
            "title": "Category ID",
            "type": "integer",
            "description": "Google Trends category to filter results. Use 0 for all categories (default). Full list at trends.google.com/trends/api/explore (categories list).",
            "default": 0
          },
          "dataTypes": {
            "title": "Data Types to Extract",
            "uniqueItems": true,
            "type": "array",
            "description": "Which Google Trends data types to fetch in one run. interest_over_time = temporal curve (0–100 relative). interest_by_region = geographic breakdown. related_queries = top/rising search terms. related_topics = top/rising Knowledge Graph topics. trending_searches = daily top searches by country (does not need keywords). Pick as many as you need — they share one session, so adding more is cheap.",
            "items": {
              "type": "string",
              "enum": [
                "interest_over_time",
                "interest_by_region",
                "related_queries",
                "related_topics",
                "trending_searches"
              ],
              "enumTitles": [
                "Interest over time",
                "Interest by region",
                "Related queries",
                "Related topics",
                "Trending searches (daily, by country)"
              ]
            },
            "default": [
              "interest_over_time",
              "related_queries"
            ]
          },
          "trendingSearchesGeo": {
            "title": "Trending Searches Country",
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code for daily trending searches (only used when 'trending_searches' is in dataTypes). Example: 'US', 'GB', 'IN'. Defaults to the value of geo. Trending searches are not available for every country — US/GB/IN/JP/DE are the most reliable."
          },
          "maxResults": {
            "title": "Max Results",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Maximum total number of records to return across all dataTypes. The actor stops + charges once this limit is hit. Default 500 covers typical use; raise it for full multi-keyword exports.",
            "default": 500
          },
          "customTimeRange": {
            "title": "Custom Date Range",
            "type": "string",
            "description": "Override 'timeframe' with a specific date range. Format: 'YYYY-MM-DD YYYY-MM-DD' (e.g. '2023-01-01 2024-01-01'). Leave empty to use the timeframe enum. NOT a single date — must be two dates separated by a space."
          },
          "outputFormat": {
            "title": "Output Format",
            "enum": [
              "flat",
              "summary"
            ],
            "type": "string",
            "description": "How to structure output. 'flat' = one record per data point (default — best for CSV exports and AI/LLM pipelines). 'summary' = same flat structure today (reserved for future grouped output).",
            "default": "flat"
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}