{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper",
    "description": "Google Trends interest over time, by region, related queries and topics, plus Trending now. Up to 5 terms per comparison, retries on 429, no start fee.",
    "version": "0.1",
    "x-build-id": "Qh05cbabUFm7yBGzk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/telkontar44~google-trends/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-telkontar44-google-trends",
        "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/telkontar44~google-trends/runs": {
      "post": {
        "operationId": "runs-sync-telkontar44-google-trends",
        "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/telkontar44~google-trends/run-sync": {
      "post": {
        "operationId": "run-sync-telkontar44-google-trends",
        "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": {
          "terms": {
            "title": "Search terms",
            "type": "array",
            "description": "Search terms to look up. With \"Compare terms\" on, up to 5 terms are compared in one chart (values scaled together, like the Trends UI); more terms are split into groups of 5. Not needed for a Trending-now-only run.",
            "items": {
              "type": "string"
            }
          },
          "compareTerms": {
            "title": "Compare terms",
            "type": "boolean",
            "description": "On: terms are compared together (max 5 per comparison). Off: every term is looked up on its own, so each is scaled 0-100 against itself.",
            "default": true
          },
          "dataTypes": {
            "title": "What to collect",
            "type": "array",
            "description": "Pick any of: interest over time, interest by region, related queries, related topics, Trending now.",
            "items": {
              "type": "string",
              "enum": [
                "interestOverTime",
                "interestByRegion",
                "relatedQueries",
                "relatedTopics",
                "trendingNow"
              ],
              "enumTitles": [
                "Interest over time",
                "Interest by region",
                "Related queries",
                "Related topics",
                "Trending now"
              ]
            },
            "default": [
              "interestOverTime",
              "interestByRegion",
              "relatedQueries",
              "relatedTopics"
            ]
          },
          "geo": {
            "title": "Location (geo)",
            "type": "string",
            "description": "Empty = worldwide. ISO country (\"US\", \"DE\"), region (\"US-CA\") or US metro (\"US-CA-807\"). The region map resolution follows from it: worldwide -> countries, country -> regions, region -> cities.",
            "default": ""
          },
          "timeframe": {
            "title": "Time range",
            "type": "string",
            "description": "Google Trends format: \"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\", or a date range \"2024-01-01 2024-06-30\". Aliases like \"past 90 days\" work too.",
            "default": "today 12-m"
          },
          "category": {
            "title": "Category id",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category id (0 = all categories). Example: 71 = Food & Drink, 5 = Computers & Electronics. The id is the \"cat=\" value in a trends.google.com URL.",
            "default": 0
          },
          "property": {
            "title": "Search property",
            "enum": [
              "web",
              "youtube",
              "news",
              "images",
              "froogle"
            ],
            "type": "string",
            "description": "Which Google search to measure.",
            "default": "web"
          },
          "maxRelated": {
            "title": "Max related items per list",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Cap for the top and rising lists in related queries/topics rows (Google returns up to ~25).",
            "default": 25
          },
          "maxRegions": {
            "title": "Max regions per row",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Cap for the regions list in interest-by-region rows (sorted by value).",
            "default": 250
          },
          "trendingGeo": {
            "title": "Trending now: country",
            "type": "string",
            "description": "Country (or US state, e.g. \"US-NY\") for Trending now. Defaults to the Location above, or US."
          },
          "trendingHours": {
            "title": "Trending now: window",
            "enum": [
              "4",
              "24",
              "48",
              "168"
            ],
            "type": "string",
            "description": "4 = realtime (past 4 hours), 24 = daily, 48, or 168 = past 7 days.",
            "default": "24"
          },
          "trendingNewsCount": {
            "title": "Trending now: news articles per trend",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "0 to 10 linked news articles per trending search.",
            "default": 3
          },
          "maxTrending": {
            "title": "Trending now: max trends",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of trending searches (one row each).",
            "default": 50
          },
          "language": {
            "title": "Language (hl)",
            "type": "string",
            "description": "Interface language for labels and topic names, e.g. \"en-US\", \"de\", \"ja\".",
            "default": "en-US"
          },
          "timezoneOffset": {
            "title": "Timezone offset (Google tz)",
            "minimum": -840,
            "maximum": 840,
            "type": "integer",
            "description": "Google's tz parameter in minutes, positive west of UTC (300 = US Eastern standard time, -60 = CET). Only shifts labels; dates in the output are UTC.",
            "default": 0
          },
          "requestDelayMs": {
            "title": "Delay between requests (ms)",
            "minimum": 300,
            "maximum": 30000,
            "type": "integer",
            "description": "Minimum pause between two requests, with jitter. Google Trends rate-limits hard; going below ~1000 ms invites 429s.",
            "default": 1500
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Retries per request on 429 / captcha / 5xx. Each 429 or captcha also switches to a new proxy session (new IP) with exponential backoff.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Strongly recommended. Google Trends answers 429 quickly to shared/datacenter IPs. Use Apify Proxy RESIDENTIAL (or your own rotating proxies).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}