{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper – Reliable Interest Over Time API",
    "description": "Reliable Google Trends API: interest over time, related queries and interest by region for many keywords, countries and search types (web, YouTube, news, images, shopping). Compare up to 5 terms. Pay only for successful results.",
    "version": "1.0",
    "x-build-id": "bF0EiRFgYTb93SSWz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/brightleaf_data~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-brightleaf_data-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/brightleaf_data~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-brightleaf_data-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/brightleaf_data~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-brightleaf_data-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",
        "required": [
          "searchTerms"
        ],
        "properties": {
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords to look up, one per line. Each term becomes one result.<br><br>Optional <b>per-term location</b>: add <code>| COUNTRY</code>, e.g. <code>cricket | IN</code> or <code>tesco | GB</code>. Terms without it use the default location below.<br><br>With <b>Compare terms</b> enabled, write up to 5 terms separated by commas on one line, e.g. <code>coffee, tea, matcha | US</code>.",
            "items": {
              "type": "string"
            }
          },
          "isMultiple": {
            "title": "Compare terms (comma = compare)",
            "type": "boolean",
            "description": "When enabled, commas in a search-terms line separate up to 5 terms that are compared against each other on the same 0-100 scale (like adding terms on trends.google.com). The whole line returns one result. When disabled, commas are part of the search term.",
            "default": false
          },
          "geo": {
            "title": "Default location",
            "type": "string",
            "description": "Two-letter country code (e.g. <code>US</code>, <code>IN</code>, <code>GB</code>, <code>DE</code>) or a region like <code>US-CA</code>. Leave empty for <b>Worldwide</b>. Individual terms can override this with <code>| COUNTRY</code>.",
            "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": "Period to fetch. Data resolution depends on the range (e.g. weekly points for 12 months, daily for 90 days, hourly for 7 days).",
            "default": ""
          },
          "customTimeRange": {
            "title": "Custom time range",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2} \\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional exact period in the format <code>YYYY-MM-DD YYYY-MM-DD</code>, e.g. <code>2024-01-01 2024-12-31</code>. Overrides <b>Time range</b>."
          },
          "property": {
            "title": "Search type",
            "enum": [
              "web",
              "youtube",
              "news",
              "images",
              "shopping"
            ],
            "type": "string",
            "description": "Which Google property to measure interest on — same as the 'Web search / YouTube search / ...' switch on trends.google.com.",
            "default": "web"
          },
          "category": {
            "title": "Category ID",
            "minimum": 0,
            "type": "integer",
            "description": "Optional Google Trends category to narrow the topic (0 = all categories). Examples: 3 = Arts & Entertainment, 7 = Finance, 45 = Health, 71 = Food & Drink, 958 = Jobs & Education. Find more IDs in the <code>cat=</code> part of a trends.google.com URL.",
            "default": 0
          },
          "includeInterestOverTime": {
            "title": "Interest over time",
            "type": "boolean",
            "description": "Time series of search interest on a 0-100 scale.",
            "default": true
          },
          "includeRelatedQueries": {
            "title": "Related queries (top + rising)",
            "type": "boolean",
            "description": "Top and rising related searches for each term (up to 25 each). In compare mode, returned per term.",
            "default": true
          },
          "includeInterestByRegion": {
            "title": "Interest by region",
            "type": "boolean",
            "description": "Interest per country (worldwide) or per state/region (when a country is set).",
            "default": false
          },
          "proxyStrategy": {
            "title": "Proxy strategy",
            "enum": [
              "auto",
              "datacenter",
              "residential",
              "none"
            ],
            "type": "string",
            "description": "<b>Auto (recommended)</b>: fast, low-cost datacenter proxies first; if Google rate-limits a term, it is retried automatically via residential proxies. <b>Datacenter only</b> / <b>Residential only</b> force one pool. Proxy costs are included in the price.",
            "default": "auto"
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "How many terms are fetched in parallel (1-5). Higher is faster; 2 is the tested sweet spot for reliability.",
            "default": 2
          },
          "maxRequestRetries": {
            "title": "Max retries per term",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Retries after the first attempt when Google rate-limits or blocks a request. Each retry uses a new session and IP with exponential backoff.",
            "default": 4
          },
          "termTimeoutSecs": {
            "title": "Timeout per term (seconds)",
            "minimum": 30,
            "maximum": 900,
            "type": "integer",
            "description": "Hard time limit for one term including retries. When it is hit, the term is returned with status \"failed\" and a reason (and is not charged).",
            "default": 150
          },
          "maxItems": {
            "title": "Max terms",
            "minimum": 0,
            "type": "integer",
            "description": "Process at most this many search-term lines (0 = no limit). Useful for test runs.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}