{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper — Trending Now, timelines & queries",
    "description": "Google Trends scraper on Google's own JSON API, no browser: interest over time, by region, related queries, compare up to 5 terms, custom date ranges back to 2004, and the live Trending Now board with search volume. Pay per delivered row; a failed fetch is listed in ERRORS, never charged.",
    "version": "0.0",
    "x-build-id": "Ke0ZY8wZET7dGK8Us"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/memo23~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-memo23-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/memo23~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-memo23-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/memo23~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-memo23-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": {
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords or Google topic ids (e.g. `/m/05p0rrx`) to query. Leave empty if you only want the Trending Now feed.",
            "items": {
              "type": "string"
            }
          },
          "compareKeywords": {
            "title": "Compare terms against each other",
            "type": "boolean",
            "description": "Query all search terms in ONE request (groups of up to 5) so their interest values are relative to each other — same as the compare view on trends.google.com. Off = each term scored independently on its own 0–100 scale.",
            "default": false
          },
          "geos": {
            "title": "Locations",
            "type": "array",
            "description": "Locations to query: ISO country codes (`US`, `GB`, `DE`), region codes (`US-CA`), or an empty string for worldwide. Each term is queried once per location.",
            "items": {
              "type": "string"
            }
          },
          "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": "Preset window for the interest data, the same choices as the Trends site, from the past hour to 2004–present. Default: Past 12 months. Ignored when Custom time range is set.",
            "default": "today 12-m"
          },
          "customTimeRange": {
            "title": "Custom time range",
            "pattern": "^\\s*(\\d{4}-\\d{2}-\\d{2}\\s+\\d{4}-\\d{2}-\\d{2})?\\s*$",
            "type": "string",
            "description": "Optional fixed date window, start then end: `YYYY-MM-DD YYYY-MM-DD`, e.g. `2024-01-01 2024-06-30`. Earliest start is 2004-01-01. When set it replaces Time range for every term and location. Google picks the timeline resolution from the window length (daily for short windows, weekly or monthly for longer ones). Leave empty to use Time range."
          },
          "category": {
            "title": "Category id",
            "type": "integer",
            "description": "Google Trends category id to narrow results (0 = all categories). Find ids in the category dropdown URLs on trends.google.com (e.g. 7 = Finance, 71 = Food & Drink).",
            "default": 0
          },
          "property": {
            "title": "Search property",
            "enum": [
              "",
              "images",
              "news",
              "youtube",
              "froogle"
            ],
            "type": "string",
            "description": "Which Google property to measure search interest on.",
            "default": ""
          },
          "includeInterestOverTime": {
            "title": "Interest over time",
            "type": "boolean",
            "description": "Extract the interest timeline (0–100 relative search interest per time point) for the selected time range.",
            "default": true
          },
          "includeInterestByRegion": {
            "title": "Interest by region",
            "type": "boolean",
            "description": "Extract the geographic breakdown — every country or subregion scored 0–100 for the term.",
            "default": true
          },
          "includeRelatedQueries": {
            "title": "Related queries",
            "type": "boolean",
            "description": "Extract top and rising related search queries, including breakout terms and their growth percentages.",
            "default": true
          },
          "includeRelatedTopics": {
            "title": "Related topics",
            "type": "boolean",
            "description": "Extract top and rising related topics (Google entities). Google serves the topics feed only to sessions it classifies as regular users, so it often comes back empty — then no row is written, nothing is charged, and the miss is named in the run's ERRORS record as `topics_gated`. Related queries are unaffected.",
            "default": false
          },
          "trendingNow": {
            "title": "Scrape Trending Now",
            "type": "boolean",
            "description": "Also scrape the live Trending Now feed: one dataset row per trending topic with search volume, growth, start time, and related queries.",
            "default": false
          },
          "trendingNowGeo": {
            "title": "Trending Now country",
            "type": "string",
            "description": "ISO country code for the Trending Now feed (e.g. `US`, `GB`, `DE`).",
            "default": "US"
          },
          "trendingNowHours": {
            "title": "Trending Now window",
            "enum": [
              "4",
              "24",
              "48",
              "168"
            ],
            "type": "string",
            "description": "Time window for the Trending Now feed.",
            "default": "24"
          },
          "maxItems": {
            "title": "Max dataset rows",
            "type": "integer",
            "description": "Hard cap on the number of dataset rows produced (billing cap). One row = one term × location × data type, or one trending topic. Results the cap stops are listed in the run's ERRORS record as `budget_cap`, not charged.",
            "default": 1000
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "type": "integer",
            "description": "How many Trends queries run in parallel. Keep modest — Google rate-limits aggressive parallelism.",
            "default": 5
          },
          "maxRequestRetries": {
            "title": "Max retries per query",
            "type": "integer",
            "description": "How many times a query whose token request failed is retried on a fresh proxy session before being dropped. A query that still fails is named in the run's ERRORS record with its reason and is not charged.",
            "default": 3
          },
          "proxy": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Custom proxy override. By default the actor routes through built-in residential proxies — you normally don't need to change this."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}