{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper",
    "description": "Extract search interest data from Google Trends: interest over time, interest by region, related queries, and daily trending searches. Supports multiple keywords and countries in one run. No API key needed.",
    "version": "0.1",
    "x-build-id": "7Ge2FygyWgifs6k28"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rastriq~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rastriq-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/rastriq~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-rastriq-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/rastriq~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-rastriq-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": [
          "keywords"
        ],
        "properties": {
          "keywords": {
            "title": "🔍 Keywords",
            "type": "array",
            "description": "Search terms to analyze on Google Trends. Up to <b>5 keywords</b> are compared side by side in one batch.<br><br>You can enter:<br>• Plain keywords: <code>bitcoin</code>, <code>ethereum</code><br>• Google Trends topic IDs for precise matching: <code>/m/05z1_</code> (Python programming language)<br><br>💡 <b>Tip:</b> Topic IDs eliminate ambiguity. Find them in Google Trends autocomplete or by checking the URL after selecting a topic.",
            "items": {
              "type": "string"
            }
          },
          "geos": {
            "title": "🌍 Countries",
            "uniqueItems": true,
            "type": "array",
            "description": "Select one or more countries to analyze. The scraper runs a <b>separate analysis for each country</b>, so each one adds to the total results.<br><br>Leave empty for <b>worldwide</b> data.",
            "items": {
              "type": "string",
              "enumSuggestedValues": [
                "US",
                "GB",
                "DE",
                "FR",
                "ES",
                "IT",
                "NL",
                "BE",
                "PT",
                "AT",
                "CH",
                "BR",
                "MX",
                "AR",
                "CO",
                "CL",
                "JP",
                "KR",
                "IN",
                "CN",
                "AU",
                "CA",
                "SE",
                "NO",
                "DK",
                "FI",
                "PL",
                "CZ",
                "RO",
                "IE"
              ],
              "enumTitles": [
                "🇺🇸 United States",
                "🇬🇧 United Kingdom",
                "🇩🇪 Germany",
                "🇫🇷 France",
                "🇪🇸 Spain",
                "🇮🇹 Italy",
                "🇳🇱 Netherlands",
                "🇧🇪 Belgium",
                "🇵🇹 Portugal",
                "🇦🇹 Austria",
                "🇨🇭 Switzerland",
                "🇧🇷 Brazil",
                "🇲🇽 Mexico",
                "🇦🇷 Argentina",
                "🇨🇴 Colombia",
                "🇨🇱 Chile",
                "🇯🇵 Japan",
                "🇰🇷 South Korea",
                "🇮🇳 India",
                "🇨🇳 China",
                "🇦🇺 Australia",
                "🇨🇦 Canada",
                "🇸🇪 Sweden",
                "🇳🇴 Norway",
                "🇩🇰 Denmark",
                "🇫🇮 Finland",
                "🇵🇱 Poland",
                "🇨🇿 Czech Republic",
                "🇷🇴 Romania",
                "🇮🇪 Ireland"
              ]
            }
          },
          "maxResults": {
            "title": "💯 Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of data points to extract across all keywords and countries. Each keyword × country generates ~50–130 rows depending on the time range.<br><br>Recommended values:<br>• <b>10–20</b> — quick preview to see data format<br>• <b>200–500</b> — single keyword, full analysis<br>• <b>1000–5000</b> — multi-keyword or multi-country runs<br><br>💡 Leave empty for <b>unlimited</b> results (all available data).",
            "default": 500
          },
          "timeframe": {
            "title": "📅 Time range",
            "enum": [
              "now 1-H",
              "now 4-H",
              "now 7-d",
              "today 1-m",
              "today 3-m",
              "today 12-m",
              "today 5-y",
              "all"
            ],
            "type": "string",
            "description": "How far back to look. Shorter timeframes give <b>daily</b> data points, longer ones give <b>weekly</b> or <b>monthly</b>.<br><br>You can also type a <b>custom date range</b> like <code>2024-01-01 2024-12-31</code>.",
            "default": "today 12-m"
          },
          "category": {
            "title": "📂 Category filter",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category ID. Use <code>0</code> for all categories.<br><br>💡 Find category IDs at <a href='https://trends.google.com/trends/explore' target='_blank'>Google Trends</a>: select a category, then check the URL for the <code>cat=</code> parameter.<br><br>Common categories:<br>• <code>71</code> — Food & Drink<br>• <code>174</code> — Sports<br>• <code>5</code> — Computers & Electronics<br>• <code>7</code> — Finance",
            "default": 0
          },
          "property": {
            "title": "🔎 Google property",
            "enum": [
              "",
              "images",
              "news",
              "youtube",
              "froogle"
            ],
            "type": "string",
            "description": "Which Google service to analyze trends from.",
            "default": ""
          },
          "includeTrending": {
            "title": "🔥 Include daily trending searches",
            "type": "boolean",
            "description": "Also fetch today's <b>trending searches</b> for each country via Google's RSS feed.<br><br>Adds ~10–20 trending topics per country with:<br>• Approximate traffic volume<br>• Related news articles and sources<br><br>💡 Great for monitoring what's popular right now.",
            "default": false
          },
          "hl": {
            "title": "🌐 Language",
            "type": "string",
            "description": "Language for Google Trends results. Affects how related queries and topics are displayed.<br><br>Examples: <code>en-US</code>, <code>es</code>, <code>de</code>, <code>fr</code>, <code>ja</code>, <code>pt-BR</code>.",
            "default": "en-US"
          },
          "tz": {
            "title": "🕐 Timezone offset",
            "type": "integer",
            "description": "Offset from UTC in minutes. Affects how time periods are aligned.<br><br>Common values:<br>• <code>0</code> — UTC<br>• <code>-300</code> — US Eastern (EST)<br>• <code>-360</code> — US Central (CST)<br>• <code>60</code> — Central Europe (CET)<br>• <code>540</code> — Japan (JST)",
            "default": 0
          },
          "maxRetries": {
            "title": "🔄 Max retries",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "How many times to retry on rate limits (429) or server errors (5xx). Uses <b>exponential backoff</b> between retries.",
            "default": 3
          },
          "rotateProxyPerGeo": {
            "title": "🔀 Rotate proxy per country",
            "type": "boolean",
            "description": "Get a <b>fresh proxy IP</b> for each country. Reduces rate limiting on multi-country runs.<br><br>⚠️ Only works when proxy is configured below.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "🔒 Proxy configuration",
            "type": "object",
            "description": "Optional. Google Trends works <b>without proxies</b> for small runs (a few keywords and countries). Enable if you experience rate limiting after ~10–15 rapid requests, or for large-scale extraction."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}