{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper - Interest, Regions, Related, Trending",
    "description": "Scrape Google Trends via its JSON API, no browser. Input: search terms (or up to 5 compared), geo, time range, category, property; or countries for Trending Now. Output: one item per term or comparison with interest over time, by region, related queries and topics; or one per trending search.",
    "version": "1.0",
    "x-build-id": "XBgNOdsPYoWZt6cts"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/artificially~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-artificially-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/artificially~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-artificially-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/artificially~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-artificially-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "explore",
              "trendingNow"
            ],
            "type": "string",
            "description": "What to scrape. \"explore\": Google Trends data for your searchTerms (interest over time, interest by region, related queries and related topics). \"trendingNow\": the Trending Now list (daily trending searches) for the countries in trendingNowCountries; searchTerms is ignored.",
            "default": "explore"
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords to look up in explore mode, one per entry, max 100 characters each. A Google Knowledge Graph topic ID such as \"/m/0dr90d\" (Tesla, Inc.) also works. Each term returns its own item unless compareTerms is true. Example: [\"bitcoin\", \"ethereum\"].",
            "items": {
              "type": "string"
            }
          },
          "compareTerms": {
            "title": "Compare terms on one chart",
            "type": "boolean",
            "description": "Set to true to compare terms against each other like the Google Trends UI: terms are sent in groups of up to 5 and each group returns ONE item where all values share the same 0-100 scale (values arrays follow the order of searchTerms). Leave false to get one independent item per term (each scaled to its own peak of 100).",
            "default": false
          },
          "geo": {
            "title": "Location (geo)",
            "type": "string",
            "description": "Where the searches come from. A 2-letter country code (e.g. \"US\", \"GB\", \"DE\"), a subregion code (e.g. \"US-CA\", \"GB-ENG\"), a US metro code (e.g. \"US-NY-501\"), or leave empty for worldwide."
          },
          "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",
              "custom"
            ],
            "type": "string",
            "description": "Period to analyze. Past hour/4 hours/day return minute or hourly points, 7 days hourly, 1-3 months daily, 12 months and 5 years weekly, \"all\" (since 2004) monthly. Pick \"custom\" and fill customTimeRange for exact dates.",
            "default": "today 12-m"
          },
          "customTimeRange": {
            "title": "Custom time range",
            "type": "string",
            "description": "Used only when timeRange is \"custom\". Two dates \"YYYY-MM-DD YYYY-MM-DD\" (start end), from 2004-01-01 on. Example: \"2024-01-01 2024-06-30\". Ranges up to ~9 months give daily points, longer ranges weekly or monthly."
          },
          "category": {
            "title": "Category",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category ID to narrow ambiguous terms, 0 = all categories. Top-level IDs: 3 Arts & Entertainment, 47 Autos & Vehicles, 44 Beauty & Fitness, 22 Books & Literature, 12 Business & Industrial, 5 Computers & Electronics, 7 Finance, 71 Food & Drink, 8 Games, 45 Health, 65 Hobbies & Leisure, 11 Home & Garden, 13 Internet & Telecom, 958 Jobs & Education, 19 Law & Government, 16 News, 299 Online Communities, 14 People & Society, 66 Pets & Animals, 29 Real Estate, 533 Reference, 174 Science, 18 Shopping, 20 Sports, 67 Travel. Subcategory IDs from a Google Trends URL (cat=...) also work.",
            "default": 0
          },
          "property": {
            "title": "Search property",
            "enum": [
              "web",
              "images",
              "news",
              "youtube",
              "froogle"
            ],
            "type": "string",
            "description": "Which Google search to measure: web search (default), image search, news search, YouTube search or Google Shopping.",
            "default": "web"
          },
          "includeInterestOverTime": {
            "title": "Interest over time",
            "type": "boolean",
            "description": "Return the time series (0-100 relative interest per date) plus the average per term, in interestOverTime.",
            "default": true
          },
          "includeInterestByRegion": {
            "title": "Interest by region",
            "type": "boolean",
            "description": "Return interest per country (worldwide) or per subregion (inside a country), in interestByRegion. Change the level with regionResolution.",
            "default": true
          },
          "includeRelatedQueries": {
            "title": "Related queries",
            "type": "boolean",
            "description": "Return top and rising related search queries per term, in relatedQueries. Rising entries show growth such as \"+250%\" or \"Breakout\".",
            "default": true
          },
          "includeRelatedTopics": {
            "title": "Related topics",
            "type": "boolean",
            "description": "Return top and rising related topics (Knowledge Graph entities with mid and type) per term, in relatedTopics. Google leaves this list empty for many queries; an empty list is returned as-is.",
            "default": true
          },
          "regionResolution": {
            "title": "Region level",
            "enum": [
              "auto",
              "COUNTRY",
              "REGION",
              "CITY",
              "DMA"
            ],
            "type": "string",
            "description": "Granularity of interestByRegion. \"auto\" = countries for worldwide, subregions (states) inside a country. CITY and DMA (US metro areas) only work inside a country; DMA only for US. If Google rejects the level, the default level is returned instead.",
            "default": "auto"
          },
          "includeLowVolumeRegions": {
            "title": "Include low-volume regions",
            "type": "boolean",
            "description": "Set to true to also list regions with too little search volume (they come back with value 0), like the checkbox in the Google Trends UI.",
            "default": false
          },
          "maxRelatedPerList": {
            "title": "Max related entries per list",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Keep at most this many entries in each top/rising list of relatedQueries and relatedTopics (Google returns up to 25). Example: 10. Leave empty for all."
          },
          "trendingNowCountries": {
            "title": "Trending Now countries",
            "type": "array",
            "description": "Used only when mode is \"trendingNow\". 2-letter country codes, one item per trending search is returned for each. Example: [\"US\", \"GB\"].",
            "items": {
              "type": "string"
            }
          },
          "trendingNowHours": {
            "title": "Trending Now period",
            "enum": [
              "4",
              "24",
              "48",
              "168"
            ],
            "type": "string",
            "description": "Used only in trendingNow mode. Look-back window for trending searches.",
            "default": "24"
          },
          "trendingNowCategory": {
            "title": "Trending Now category",
            "enum": [
              "0",
              "1",
              "2",
              "3",
              "20",
              "4",
              "5",
              "6",
              "7",
              "8",
              "9",
              "10",
              "11",
              "13",
              "14",
              "15",
              "16",
              "17",
              "18",
              "19"
            ],
            "type": "string",
            "description": "Used only in trendingNow mode. Keep only trending searches in this category.",
            "default": "0"
          },
          "trendingNowActiveOnly": {
            "title": "Active trends only",
            "type": "boolean",
            "description": "Used only in trendingNow mode. Set to true to keep only trends that are still rising (isActive true).",
            "default": false
          },
          "trendingNowIncludeNews": {
            "title": "Include news articles",
            "type": "boolean",
            "description": "Used only in trendingNow mode. Adds a picture and the linked news articles for the trends that appear in Google's Trending Now feed (usually the top ~20); other trends get news null.",
            "default": true
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after saving this many dataset items in total (explore: one per term or comparison group; trendingNow: one per trending search). Example: 10. Leave empty for no limit (the run also stops at your maximum cost per run)."
          },
          "compactOutput": {
            "title": "Compact output (for AI agents)",
            "type": "boolean",
            "description": "Set to true to save slim items: explore items keep averages, a date+values timeline, the top 15 regions and the top 10 related queries/topics (rising with growth); trendingNow items keep term, rank, volume, increase, start time, categories and related searches. Recommended when an AI agent or LLM reads the results. Leave false for the full item.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Parallel sessions",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many queries run at the same time, each on its own proxy session, from 1 to 10. Requests inside a session are paced politely. Lower it if you see many rate-limit retries.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Google rate-limits Trends per IP. The default Apify datacenter proxy works for most runs; the actor switches to a fresh proxy session whenever Google answers 429. Select the RESIDENTIAL group if a run reports many rate-limited or failed queries.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}