{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper - Reliable, Pay Only for Results",
    "description": "Interest over time, interest by region, related queries (top + rising) and Trending Now from Google Trends. Automatic 429 recovery, compare up to 5 terms, many countries per run. Failed lookups are never charged.",
    "version": "1.1",
    "x-build-id": "kUhaCxNeG6z2mtmm5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tonyginkleheim~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tonyginkleheim-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/tonyginkleheim~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-tonyginkleheim-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/tonyginkleheim~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-tonyginkleheim-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",
              "trending"
            ],
            "type": "string",
            "description": "Explore analyses your keywords. Trending Now lists breakout searches with search volume, growth and related terms.",
            "default": "explore"
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "One keyword per line. Put up to 5 keywords on one line separated by commas to compare them on the same scale (e.g. nike, adidas, puma).",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Google Trends URLs",
            "type": "array",
            "description": "Paste Google Trends Explore URLs. Keywords, geo, time range, category and search type are taken from each URL.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "spreadsheetId": {
            "title": "Google Sheet",
            "type": "string",
            "description": "Sheet URL or ID. Keywords are read from the first column (row 1 is the header). Share the sheet as 'Anyone with the link can view'."
          },
          "compareTerms": {
            "title": "Compare single keywords in groups of 5",
            "type": "boolean",
            "description": "On: single keywords are batched 5 at a time on one relative scale. Off: every keyword gets its own 0-100 scale.",
            "default": false
          },
          "geos": {
            "title": "Countries / regions",
            "type": "array",
            "description": "Geo codes such as US, GB, DE, US-CA, or WORLDWIDE. Every keyword runs for every geo. Trending Now also accepts states and regions like US-CA or DE-BY.",
            "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",
              "custom"
            ],
            "type": "string",
            "description": "Explore mode only.",
            "default": "today 12-m"
          },
          "customTimeRange": {
            "title": "Custom time range",
            "pattern": "^([0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{4}-[0-9]{2}-[0-9]{2})?$",
            "type": "string",
            "description": "Used when Time range is Custom. Format: YYYY-MM-DD YYYY-MM-DD"
          },
          "timezone": {
            "title": "Timezone offset (minutes)",
            "minimum": -840,
            "maximum": 840,
            "type": "integer",
            "description": "Google's timezone offset for timeline dates, e.g. 0 = UTC, 300 = US Eastern standard time, -60 = Central Europe.",
            "default": 0
          },
          "category": {
            "title": "Category",
            "enum": [
              "0",
              "3",
              "47",
              "44",
              "22",
              "12",
              "5",
              "7",
              "71",
              "8",
              "45",
              "65",
              "11",
              "13",
              "958",
              "19",
              "16",
              "299",
              "14",
              "66",
              "29",
              "533",
              "174",
              "18",
              "20",
              "67"
            ],
            "type": "string",
            "description": "Limit Explore results to a Google Trends category.",
            "default": "0"
          },
          "searchProperty": {
            "title": "Search type",
            "enum": [
              "web",
              "images",
              "news",
              "froogle",
              "youtube"
            ],
            "type": "string",
            "description": "Which Google search property to analyse.",
            "default": "web"
          },
          "includeInterestOverTime": {
            "title": "Interest over time",
            "type": "boolean",
            "description": "Timeline of 0-100 interest values plus the average.",
            "default": true
          },
          "includeInterestByRegion": {
            "title": "Interest by region",
            "type": "boolean",
            "description": "Breakdown by country, state, metro or city.",
            "default": true
          },
          "includeRelatedQueries": {
            "title": "Related queries",
            "type": "boolean",
            "description": "Top and rising related searches. Rising = breakout opportunities.",
            "default": true
          },
          "regionResolution": {
            "title": "Region resolution",
            "enum": [
              "AUTO",
              "COUNTRY",
              "REGION",
              "DMA",
              "CITY"
            ],
            "type": "string",
            "description": "If a resolution is not available for a geo, the best available one is used instead of failing.",
            "default": "AUTO"
          },
          "trendingTimeframe": {
            "title": "Trending window",
            "enum": [
              "4",
              "24",
              "48",
              "168"
            ],
            "type": "string",
            "description": "Trending Now mode only.",
            "default": "24"
          },
          "trendingCategories": {
            "title": "Trending categories",
            "uniqueItems": true,
            "type": "array",
            "description": "Only return trends in these categories. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9",
                "10",
                "11",
                "13",
                "14",
                "15",
                "16",
                "17",
                "18",
                "19",
                "20"
              ],
              "enumTitles": [
                "Autos and Vehicles",
                "Beauty and Fashion",
                "Business and Finance",
                "Entertainment",
                "Food and Drink",
                "Games",
                "Health",
                "Hobbies and Leisure",
                "Jobs and Education",
                "Law and Government",
                "Other",
                "Pets and Animals",
                "Politics",
                "Science",
                "Shopping",
                "Sports",
                "Technology",
                "Travel and Transportation",
                "Climate"
              ]
            },
            "default": []
          },
          "trendStatus": {
            "title": "Trend status",
            "enum": [
              "all",
              "active",
              "ended"
            ],
            "type": "string",
            "description": "Filter by whether the trend is still active.",
            "default": "all"
          },
          "includeNews": {
            "title": "Attach news articles",
            "type": "boolean",
            "description": "Adds the news stories Google links to each trend, where available.",
            "default": true
          },
          "maxTrendsPerGeo": {
            "title": "Max trends per geo",
            "minimum": 0,
            "type": "integer",
            "description": "0 = all available.",
            "default": 0
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many results in total. 0 = no limit.",
            "default": 0
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Interface language, e.g. en-US, de, fr, ja.",
            "default": "en-US"
          },
          "viewedFrom": {
            "title": "View Trends from country",
            "type": "string",
            "description": "Two-letter country code for the proxy location (e.g. US, DE). Leave empty for automatic."
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Parallel sessions, each with its own IP.",
            "default": 10
          },
          "maxRetries": {
            "title": "Max retries per request",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Each retry uses a fresh IP and session.",
            "default": 8
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Residential proxies give the lowest failure rate.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}