{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper: Interest Over Time, Regions & Related",
    "description": "Reliable Google Trends scraper: interest over time, interest by region or city, related queries (top and rising), compare up to 5 terms, plus Trending Now. Retries with a new IP on every 429 and returns partial results instead of failing. $0.30 per 1,000 rows.",
    "version": "1.0",
    "x-build-id": "ETxLfIFpGAd76fVUK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fairfetch~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fairfetch-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/fairfetch~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-fairfetch-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/fairfetch~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-fairfetch-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": "One term per line; each term is fetched on its own (its own 0-100 scale). Commas also separate terms, as on Google Trends.\n- Plain terms: coffee, iphone 17\n- Topic IDs: /m/02vqfm (the Coffee topic)\n- Google Trends explore URLs, e.g. https://trends.google.com/trends/explore?q=coffee,tea&geo=US&date=today%205-y. Location, time range, category and property in the URL override the fields below for that URL.",
            "items": {
              "type": "string"
            }
          },
          "comparisonGroups": {
            "title": "Comparison groups (up to 5 terms on one scale)",
            "type": "array",
            "description": "One group per line, terms separated by commas, e.g. \"coffee, tea, matcha\". Terms in a group are compared on one shared 0-100 scale, exactly like the Compare button on Google Trends. Google allows at most 5 terms per group.",
            "items": {
              "type": "string"
            }
          },
          "geo": {
            "title": "Location",
            "pattern": "^$|^[A-Za-z]{2}([-_][A-Za-z0-9]{1,3}([-_][0-9]{3})?)?$",
            "type": "string",
            "description": "Two-letter country code (US, GB, DE, IN, ...), a region code (US-CA, GB-SCT) or a US metro code (US-NY-501). Leave empty for worldwide.",
            "default": ""
          },
          "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": "Google Trends time range (Past 12 months when left empty). The time range also sets the resolution: minutes for the past hour / 4 hours, 8 minutes for the past day, hours for 7 days, days for 30 / 90 days, weeks for 12 months / 5 years, months for 2004 - present. Choose \"Custom\" to use the custom range below."
          },
          "customTimeRange": {
            "title": "Custom time range",
            "type": "string",
            "description": "Start and end date as \"YYYY-MM-DD YYYY-MM-DD\" (e.g. \"2024-01-01 2024-12-31\"), or hours within the past week as \"2026-10-15T10 2026-10-16T10\". Used only when Time range is Custom (or not set at all, e.g. in an API call)."
          },
          "category": {
            "title": "Category",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category ID; 0 = all categories. Common IDs: 3 Arts & Entertainment, 5 Computers & Electronics, 7 Finance, 12 Business & Industrial, 16 News, 18 Shopping, 20 Sports, 44 Beauty & Fitness, 45 Health, 47 Autos & Vehicles, 67 Travel, 71 Food & Drink, 174 Science. The ID is the cat= value in a Google Trends URL.",
            "default": 0
          },
          "property": {
            "title": "Search property",
            "enum": [
              "web",
              "news",
              "images",
              "youtube",
              "shopping"
            ],
            "type": "string",
            "description": "Which Google search to measure, like the \"Web Search\" menu on Google Trends.",
            "default": "web"
          },
          "includeInterestOverTime": {
            "title": "Interest over time",
            "type": "boolean",
            "description": "One row per time point and term (value 0-100).",
            "default": true
          },
          "includeInterestByRegion": {
            "title": "Interest by region",
            "type": "boolean",
            "description": "One row per region (country, state or city) and term. Single terms: 0-100 per region. Comparison groups: each term's share of the region (the terms add up to 100%). Regions without data are never returned and never charged.",
            "default": true
          },
          "regionResolution": {
            "title": "Region resolution",
            "enum": [
              "auto",
              "COUNTRY",
              "REGION",
              "DMA",
              "CITY"
            ],
            "type": "string",
            "description": "Auto uses Google's default: countries for worldwide, states / regions for a country. City works for countries and regions; Metro (DMA) only for the US.",
            "default": "auto"
          },
          "includeLowVolumeRegions": {
            "title": "Include low search volume regions",
            "type": "boolean",
            "description": "Like the checkbox on Google Trends: also return regions with low search volume (more rows). Regions where Google has no data at all are still skipped and not charged.",
            "default": false
          },
          "includeRelatedQueries": {
            "title": "Related queries",
            "type": "boolean",
            "description": "Up to 25 top and 25 rising related searches per term.",
            "default": true
          },
          "includeRelatedTopics": {
            "title": "Related topics",
            "type": "boolean",
            "description": "Up to 25 top and 25 rising related topics per term (single terms only). Off by default because the list is usually empty: Google sends related topics to automated requests only rarely. Empty lists cost nothing. Related queries are not affected.",
            "default": false
          },
          "relatedRanking": {
            "title": "Related queries / topics: ranking",
            "enum": [
              "both",
              "top",
              "rising"
            ],
            "type": "string",
            "description": "Return the Top list, the Rising list (fastest-growing, including \"Breakout\"), or both.",
            "default": "both"
          },
          "includeTrendingNow": {
            "title": "Trending now",
            "type": "boolean",
            "description": "Also return the searches trending right now in a country (the trends.google.com/trending list): search volume, growth, start time, categories and related searches. Works without search terms.",
            "default": false
          },
          "trendingGeo": {
            "title": "Trending now: country",
            "pattern": "^$|^[A-Za-z]{2}([-_][A-Za-z0-9]{1,3})?$",
            "type": "string",
            "description": "Two-letter country code (or region code such as US-CA). Defaults to Location (a US metro code is cut to its state, e.g. US-NY-501 to US-NY), or US when Location is worldwide."
          },
          "trendingTimeRange": {
            "title": "Trending now: time range",
            "enum": [
              "4",
              "24",
              "48",
              "168"
            ],
            "type": "string",
            "description": "Trends started within this window.",
            "default": "24"
          },
          "trendingMaxItems": {
            "title": "Trending now: max trends",
            "minimum": 0,
            "type": "integer",
            "description": "Google often lists several hundred trends for a big country. Returns the first N in Google's order; 0 = all.",
            "default": 50
          },
          "maxItems": {
            "title": "Max rows (cost cap)",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many dataset rows in total (each row is one charged result). 0 = no limit. You can also set a maximum cost per run in the run options.",
            "default": 0
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "On by default (Apify residential proxy, included in the price). Google Trends rate-limits cloud and datacenter IPs hard; every throttled request is retried on a new residential IP. Runs use only a few KB of proxy traffic per term.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Language for region names, topic titles and date labels (hl parameter), e.g. en-US, de, fr, pt-BR, ja.",
            "default": "en-US"
          },
          "maxConcurrency": {
            "title": "Queries in parallel",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many queries run at the same time, each on its own proxy IP. Without a proxy everything runs one by one.",
            "default": 3
          },
          "maxRetries": {
            "title": "Max retries per request",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Retries for throttling (HTTP 429, each on a new IP), server errors and network errors.",
            "default": 6
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Timeout for a single HTTP request.",
            "default": 25
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}