{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper — Real-Time Trends & YouTube",
    "description": "The fastest Google Trends API on Apify. Scrape interest over time, geographic breakdowns, rising queries, and real-time trending searches for 125+ countries across Web, YouTube, News, Images & Shopping with direct publisher links. 256 MB RAM, <1.5s per run.",
    "version": "1.0",
    "x-build-id": "rbf5eTonwWF2iQwNX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datasiphon~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datasiphon-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/datasiphon~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-datasiphon-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/datasiphon~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-datasiphon-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": "Google Trends Feature / Section",
            "enum": [
              "explore",
              "compare",
              "trending"
            ],
            "type": "string",
            "description": "Select how you want to use Google Trends: Explore single/multiple keywords, Compare 2-5 keywords side-by-side, or get the live Trending Now feed with news publisher links.",
            "default": "explore"
          },
          "searchTerms": {
            "title": "Search Terms / Keywords",
            "type": "array",
            "description": "Enter the search term(s) or topic(s) you want to analyze on Google Trends. In 'Compare' mode, enter 2 to 5 terms to benchmark them side-by-side.",
            "default": [
              "artificial intelligence"
            ],
            "items": {
              "type": "string"
            }
          },
          "geo": {
            "title": "Geography / Country",
            "enum": [
              "",
              "US",
              "GB",
              "CA",
              "AU",
              "DE",
              "FR",
              "IN",
              "JP",
              "BR",
              "ES",
              "IT",
              "MX",
              "NL",
              "SG",
              "ZA",
              "AE",
              "SA",
              "PK",
              "TR",
              "ID",
              "custom"
            ],
            "type": "string",
            "description": "Location dropdown matching Google Trends. Select 'Worldwide' or pick a country. To specify a state or subregion (e.g. US-CA), select 'Other / Custom Region' and enter it below.",
            "default": "US"
          },
          "customGeo": {
            "title": "Custom Region / Subregion Code",
            "type": "string",
            "description": "Optional: Enter a subregion, state, or country code (e.g. 'US-CA' for California, 'US-NY' for New York, 'GB-ENG' for England). Used when Geography is set to 'Other / Custom Region'."
          },
          "timeRange": {
            "title": "Time Period",
            "enum": [
              "today 12-m",
              "now 1-H",
              "now 4-H",
              "now 1-d",
              "now 7-d",
              "today 1-m",
              "today 3-m",
              "today 5-y",
              "all",
              "now 1-h",
              "now 4-h",
              "custom"
            ],
            "type": "string",
            "description": "Time range dropdown matching the options available on Google Trends. Select 'Custom time range' to choose exact start and end dates from the calendar pickers below.",
            "default": "today 12-m"
          },
          "startDate": {
            "title": "Custom Start Date (Calendar)",
            "type": "string",
            "description": "Pick the start date from the calendar for custom time range (e.g. 2024-01-01). Used when 'Custom time range' is selected or dates are provided."
          },
          "endDate": {
            "title": "Custom End Date (Calendar)",
            "type": "string",
            "description": "Pick the end date from the calendar for custom time range (e.g. 2024-12-31). Used when 'Custom time range' is selected or dates are provided."
          },
          "category": {
            "title": "Category",
            "enum": [
              "0",
              "8",
              "67",
              "12",
              "22",
              "3",
              "44",
              "7",
              "71",
              "174",
              "45",
              "65",
              "11",
              "299",
              "958",
              "19",
              "16",
              "14",
              "66",
              "29",
              "533",
              "18",
              "20",
              "31"
            ],
            "type": "string",
            "description": "Dropdown matching Google Trends categories. Narrow your search interest to a specific vertical.",
            "default": "0"
          },
          "searchProperty": {
            "title": "Search Type / Property",
            "enum": [
              "web",
              "images",
              "news",
              "froogle",
              "youtube"
            ],
            "type": "string",
            "description": "Dropdown matching the 5 Google Trends search types: Web Search, Image Search, News Search, Google Shopping, or YouTube Search.",
            "default": "web"
          },
          "includeInterestOverTime": {
            "title": "Include Interest Over Time",
            "type": "boolean",
            "description": "Extract historical timeline datapoints with timestamps, formatted dates, relative interest values (0-100), and partial period flags.",
            "default": true
          },
          "includeInterestByRegion": {
            "title": "Include Regional Popularity",
            "type": "boolean",
            "description": "Extract geographic breakdown showing popularity across countries, states/provinces, and subregions.",
            "default": true
          },
          "includeRelatedQueries": {
            "title": "Include Related Queries",
            "type": "boolean",
            "description": "Extract Top and Rising related search queries with automatic identification of breakout surges (+5000%).",
            "default": true
          },
          "includeRelatedTopics": {
            "title": "Include Related Topics",
            "type": "boolean",
            "description": "Extract Top and Rising related entity topics from the Google Knowledge Graph with Topic MIDs.",
            "default": true
          },
          "trendingCountry": {
            "title": "Trending Searches Country",
            "enum": [
              "US",
              "GB",
              "CA",
              "AU",
              "IN",
              "DE",
              "FR",
              "JP",
              "BR",
              "ES",
              "IT",
              "MX",
              "NL",
              "SG",
              "ZA",
              "AE",
              "SA",
              "PK",
              "TR",
              "ID"
            ],
            "type": "string",
            "description": "Select country for the Trending Now feed. Over 125 countries supported.",
            "default": "US"
          },
          "trendingTimeframe": {
            "title": "Trending Timeframe",
            "enum": [
              "4",
              "24",
              "48",
              "168"
            ],
            "type": "string",
            "description": "Time period for real-time trending searches matching Google Trends UI.",
            "default": "24"
          },
          "trendingCategory": {
            "title": "Trending Category",
            "enum": [
              "all",
              "b",
              "e",
              "m",
              "t",
              "s",
              "h"
            ],
            "type": "string",
            "description": "Filter trending searches by category matching Google Trends Trending Now tabs.",
            "default": "all"
          },
          "maxTrendingItems": {
            "title": "Max Trending Items",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of trending search stories to return (1 to 500).",
            "default": 50
          },
          "startUrls": {
            "title": "Direct Google Trends URLs (Optional)",
            "type": "array",
            "description": "Paste any direct Google Trends Explore or Trending URL (e.g. 'https://trends.google.com/trends/explore?q=bitcoin&geo=US'). The scraper will automatically extract keywords, geography, timeframe, and category.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings. Apify Proxy with RESIDENTIAL group or auto proxy is recommended for high-volume automated runs.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}