{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper - Reliable, Pay Only for Results",
    "description": "Get Google Trends interest over time, interest by region, related queries & topics and Trending Now for any keyword, country and time range. Built-in retries and proxy fallback; you're only charged for successful results.",
    "version": "0.1",
    "x-build-id": "xIXOTrsWYNPxqaZJT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zahidthani~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zahidthani-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/zahidthani~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-zahidthani-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/zahidthani~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-zahidthani-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 phrases to look up on Google Trends. Each term gets its own report (or turn on 'Compare terms' to put up to 5 on the same 0-100 scale).",
            "default": [
              "air fryer"
            ],
            "items": {
              "type": "string"
            }
          },
          "geo": {
            "title": "Country / region",
            "type": "string",
            "description": "Two-letter country code (US, GB, DE, IN...) or sub-region (US-CA, GB-ENG). 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"
            ],
            "type": "string",
            "description": "How far back to look. 'Past 5 years' is best for spotting long-term growth and seasonality; 'Past 7 days' or shorter gives hourly detail for news and spikes.",
            "default": "today 12-m"
          },
          "customTimeRange": {
            "title": "Custom time range (optional)",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2} \\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Overrides the preset. Format: YYYY-MM-DD YYYY-MM-DD, e.g. 2024-01-01 2024-12-31."
          },
          "compareTerms": {
            "title": "Compare terms (up to 5 per group)",
            "type": "boolean",
            "description": "Put terms side by side on the same 0-100 scale, exactly like comparing on trends.google.com. Terms are grouped in fives.",
            "default": false
          },
          "searchProperty": {
            "title": "Search type",
            "enum": [
              "web",
              "images",
              "news",
              "shopping",
              "youtube"
            ],
            "type": "string",
            "description": "Which Google search to measure: regular web search, Image, News, Google Shopping or YouTube.",
            "default": "web"
          },
          "category": {
            "title": "Category ID",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category (0 = all categories). Example: 71 = Food & Drink, 18 = Shopping, 12 = Business & Industrial.",
            "default": 0
          },
          "includeInterestOverTime": {
            "title": "Interest over time",
            "type": "boolean",
            "description": "Return the 0-100 interest timeline for each term, plus a summary (trend, % change, peak).",
            "default": true
          },
          "includeInterestByRegion": {
            "title": "Interest by region",
            "type": "boolean",
            "description": "Return where each term is most popular (countries, states, metros or cities).",
            "default": true
          },
          "includeRelatedQueries": {
            "title": "Related queries (top & rising)",
            "type": "boolean",
            "description": "Return the top and fastest-rising related searches for each term.",
            "default": true
          },
          "includeRelatedTopics": {
            "title": "Related topics (top & rising)",
            "type": "boolean",
            "description": "Return the top and fastest-rising related topics (entities) for each term.",
            "default": true
          },
          "regionResolution": {
            "title": "Region detail",
            "enum": [
              "",
              "COUNTRY",
              "REGION",
              "DMA",
              "CITY"
            ],
            "type": "string",
            "description": "Detail level for the regional breakdown. 'Automatic' picks countries for worldwide searches and states/regions inside a country.",
            "default": ""
          },
          "includeLowVolumeRegions": {
            "title": "Include low-search-volume regions",
            "type": "boolean",
            "description": "Also include regions with very little search volume (Google hides them by default).",
            "default": false
          },
          "trendingNowGeos": {
            "title": "Trending now - countries",
            "type": "array",
            "description": "Optional. Also fetch today's Trending Now searches (with approximate traffic and news links) for these country codes, e.g. US, GB.",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Interface language Google Trends uses for names of regions and topics, e.g. en-US, de, es.",
            "default": "en-US"
          },
          "timezoneOffset": {
            "title": "Timezone offset (minutes from UTC)",
            "type": "integer",
            "description": "Timezone for the timeline, as minutes offset from UTC (e.g. -300 for New York in winter). Leave 0 for UTC.",
            "default": 0
          },
          "maxRetries": {
            "title": "Max retries per request",
            "minimum": 1,
            "maximum": 15,
            "type": "integer",
            "description": "How many times to retry a request that Google rate-limits or blocks before giving up on that term. You are only charged for successful results.",
            "default": 8
          },
          "allowResidentialFallback": {
            "title": "Fall back to residential proxies if rate-limited",
            "type": "boolean",
            "description": "Google Trends often blocks datacenter IPs. When enabled, the Actor switches to residential proxies after repeated rate limits so the run still succeeds.",
            "default": true
          },
          "residentialFallbackAfter": {
            "title": "Switch to residential after N failed attempts",
            "minimum": 0,
            "type": "integer",
            "description": "After this many failed attempts on datacenter proxies, retry with residential proxies (more reliable, used only when needed). Set 0 to use residential from the start.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxies used to reach Google Trends. The default Apify Proxy works for most runs; the Actor rotates IPs automatically.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}