{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper - Timeline, Regions, Queries",
    "description": "Scrape Google Trends: interest over time, interest by region, related queries and topics (top & rising) for up to 5 compared terms and big keyword batches, plus Trending now. Any country, time range, category, web/YouTube/News/Images/Shopping. Automatic retries and session rotation.",
    "version": "1.0",
    "x-build-id": "DC0oIDAl3LgHpNDzC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sharkinho~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sharkinho-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/sharkinho~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sharkinho-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/sharkinho~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sharkinho-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 line per query. Put up to 5 terms on one line separated by commas to compare them on the same 0-100 scale (e.g. \"coffee, tea, matcha\"). Add as many lines as you like for batch runs. Google Topic IDs such as /m/02vqfm also work.",
            "default": [
              "coffee, tea"
            ],
            "items": {
              "type": "string"
            }
          },
          "geo": {
            "title": "Location (geo)",
            "type": "string",
            "description": "ISO country code (US, GB, BR, DE...), or a region code like US-CA or BR-SP. Leave empty for worldwide.",
            "default": ""
          },
          "timeRange": {
            "title": "Time range",
            "enum": [
              "past-hour",
              "past-4-hours",
              "past-day",
              "past-7-days",
              "past-30-days",
              "past-90-days",
              "past-12-months",
              "past-5-years",
              "all",
              "custom"
            ],
            "type": "string",
            "description": "Period to analyse. Shorter ranges give finer resolution (minute/hour/day), longer ones give weekly or monthly points.",
            "default": "past-12-months"
          },
          "startDate": {
            "title": "Custom start date",
            "type": "string",
            "description": "Only for time range \"Custom\". Format YYYY-MM-DD (earliest 2004-01-01)."
          },
          "endDate": {
            "title": "Custom end date",
            "type": "string",
            "description": "Only for time range \"Custom\". Format YYYY-MM-DD."
          },
          "customTimeRange": {
            "title": "Raw Google time string (advanced)",
            "type": "string",
            "description": "Overrides the time range with a raw Google Trends value, e.g. \"today 3-m\", \"now 7-d\", \"2024-01-01 2024-03-31\" or \"2024-05-01T10 2024-05-03T10\" (hourly). Leave empty normally."
          },
          "category": {
            "title": "Category ID",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category ID to narrow ambiguous terms. 0 = all categories. Examples: 3 Arts & Entertainment, 5 Computers & Electronics, 7 Finance, 18 Shopping, 44 Beauty & Fitness, 45 Health, 47 Autos & Vehicles, 67 Travel, 71 Food & Drink, 958 Jobs & Education, 20 Sports. The cat= number in a Google Trends URL is the ID.",
            "default": 0
          },
          "searchProperty": {
            "title": "Search property",
            "enum": [
              "web",
              "images",
              "news",
              "youtube",
              "shopping"
            ],
            "type": "string",
            "description": "Which Google search to measure.",
            "default": "web"
          },
          "outputs": {
            "title": "Data to collect",
            "type": "array",
            "description": "Each selected output for each term is one billed data block. Blocks where Google has no data are free.",
            "items": {
              "type": "string",
              "enum": [
                "interestOverTime",
                "interestByRegion",
                "relatedQueries",
                "relatedTopics"
              ],
              "enumTitles": [
                "Interest over time",
                "Interest by region",
                "Related queries (top & rising)",
                "Related topics (top & rising)"
              ]
            },
            "default": [
              "interestOverTime",
              "interestByRegion",
              "relatedQueries"
            ]
          },
          "relatedRankTypes": {
            "title": "Related queries/topics lists",
            "type": "array",
            "description": "Top = most popular overall; Rising = fastest growing (\"Breakout\" = grew more than 5000%).",
            "items": {
              "type": "string",
              "enum": [
                "top",
                "rising"
              ],
              "enumTitles": [
                "Top",
                "Rising"
              ]
            },
            "default": [
              "top",
              "rising"
            ]
          },
          "dropUnrelatedBreakouts": {
            "title": "Drop unrelated \"Breakout\" queries",
            "type": "boolean",
            "description": "Google Trends often adds rising \"Breakout\" queries that have nothing to do with your term (e.g. \"hotel booking\" for \"air fryer\"). When on, rising Breakout queries that share no word with the search term are removed. Turn off to get the raw list.",
            "default": true
          },
          "maxRelatedItems": {
            "title": "Max related items per list",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Google returns up to about 25 items per list.",
            "default": 25
          },
          "regionResolution": {
            "title": "Region resolution",
            "enum": [
              "auto",
              "COUNTRY",
              "REGION",
              "DMA",
              "CITY"
            ],
            "type": "string",
            "description": "Granularity of interest by region.",
            "default": "auto"
          },
          "includeLowSearchVolumeRegions": {
            "title": "Include low search volume regions",
            "type": "boolean",
            "description": "Also return regions where Google has too little data (value 0).",
            "default": false
          },
          "includePartialData": {
            "title": "Include the incomplete latest period",
            "type": "boolean",
            "description": "The latest point of a timeline is often still incomplete; it is flagged with isPartial=true. Uncheck to drop it.",
            "default": true
          },
          "includeTrendingNow": {
            "title": "Also scrape Trending now",
            "type": "boolean",
            "description": "Adds the current trending searches of a country (the Google Trends 'Trending now' page). Can be used with no search terms.",
            "default": false
          },
          "trendingGeo": {
            "title": "Trending country",
            "type": "string",
            "description": "Country code for Trending now, e.g. US, GB, DE, BR, IN.",
            "default": "US"
          },
          "trendingHours": {
            "title": "Trending window",
            "enum": [
              "4",
              "24",
              "48",
              "168"
            ],
            "type": "string",
            "description": "How far back trending searches go.",
            "default": "24"
          },
          "trendingCategory": {
            "title": "Trending 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": "Only keep trending searches in this category.",
            "default": "0"
          },
          "trendingActiveOnly": {
            "title": "Only active trends",
            "type": "boolean",
            "description": "Skip trends that have already ended.",
            "default": false
          },
          "trendingIncludeNews": {
            "title": "Attach news articles",
            "type": "boolean",
            "description": "Adds news headlines, sources and links (available for the top trends).",
            "default": true
          },
          "maxTrendingItems": {
            "title": "Max trending searches",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Maximum number of trending searches to save (each one is billed as one trending-search result).",
            "default": 50
          },
          "outputLayout": {
            "title": "Output layout",
            "enum": [
              "rows",
              "blocks"
            ],
            "type": "string",
            "description": "Rows: one dataset item per timeline point, region or related query. Blocks: one dataset item per term and output with the data in an array. Price is the same.",
            "default": "rows"
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Language for region and topic names, e.g. en-US, de, pt-BR.",
            "default": "en-US"
          },
          "timezoneOffsetMinutes": {
            "title": "Timezone offset (minutes)",
            "type": "integer",
            "description": "Affects how hourly/daily buckets are cut. Same sign as JavaScript getTimezoneOffset(): 300 = New York (UTC-5), -60 = Berlin (UTC+1). Output dates are always ISO in UTC.",
            "default": 0
          },
          "maxConcurrency": {
            "title": "Parallel term groups",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many term lines to process at once. Higher is faster but Google throttles harder; use 3-5 only with a proxy.",
            "default": 2
          },
          "maxRetries": {
            "title": "Max attempts per request",
            "minimum": 3,
            "maximum": 15,
            "type": "integer",
            "description": "Throttled requests are retried with exponential backoff and a fresh session each time.",
            "default": 8
          },
          "autoProxyFallback": {
            "title": "Automatic proxy fallback",
            "type": "boolean",
            "description": "When running without a proxy and Google throttles repeatedly, switch to Apify datacenter proxy automatically.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Not needed in most cases. If you scrape thousands of terms, Apify datacenter proxy helps; residential is rarely needed.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}