{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Bulk Scraper",
    "description": "Google Trends for hundreds of keywords in one run, all on one 0-100 scale (no 5-term limit). Interest over time, by region, related queries, comparisons and Trending Now. You only pay for queries that succeed.",
    "version": "0.10",
    "x-build-id": "ATbOASr0Z2hU3GIk1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cornflower_vision~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cornflower_vision-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/cornflower_vision~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-cornflower_vision-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/cornflower_vision~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-cornflower_vision-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",
              "trendingNow"
            ],
            "type": "string",
            "description": "<b>Explore keywords</b>: interest over time, by region and related searches for your search terms.<br><b>Trending Now</b>: the searches trending right now in one or more countries.",
            "default": "explore"
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "One search term per line. Each term is processed separately and counts as one query.",
            "items": {
              "type": "string"
            }
          },
          "comparisonGroups": {
            "title": "Comparison groups",
            "type": "array",
            "description": "Compare 2 to 5 terms on the same scale, like the Compare button on Google Trends. One group per line, terms separated by commas, for example <code>bitcoin, ethereum, solana</code>. Each group counts as one query. A term cannot contain a comma, because the comma separates the terms (the same rule as on Google Trends).",
            "items": {
              "type": "string"
            }
          },
          "compareAllTerms": {
            "title": "Compare all search terms on one scale",
            "type": "boolean",
            "description": "Google Trends compares at most 5 terms at a time, and every request has its own 0-100 scale. Turn this on to put <b>all</b> your search terms on one scale, so you can rank hundreds of them. The Actor adds an <b>anchor term</b> to every group of 4 terms and rescales the groups through it. Only interest over time is supported in this mode. Each group of 4 terms counts as one query.",
            "default": false
          },
          "anchorTerm": {
            "title": "Anchor term",
            "type": "string",
            "description": "Used with <i>Compare all search terms on one scale</i>. Pick a term of <b>medium popularity</b> compared with your other terms: if the anchor is tiny next to them, the results lose precision (the output then shows a precision warning). Leave empty to use the first search term.",
            "default": ""
          },
          "geo": {
            "title": "Location",
            "pattern": "^([A-Za-z]{2}(-[A-Za-z0-9]{1,3}){0,2})?$",
            "type": "string",
            "description": "Country or region code, for example <code>US</code>, <code>VN</code>, <code>GB</code> or <code>US-CA</code>. Use the code, not the name: <code>VN</code>, not <code>Vietnam</code>. 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",
              "custom"
            ],
            "type": "string",
            "description": "Google decides the data granularity: hourly for short ranges, daily, weekly or monthly for longer ones.",
            "default": "today 12-m"
          },
          "customTimeRange": {
            "title": "Custom time range",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2} \\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Only used when Time range is <i>Custom range</i>. Format: <code>YYYY-MM-DD YYYY-MM-DD</code>, for example <code>2024-01-01 2024-12-31</code>."
          },
          "category": {
            "title": "Category",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category ID. 0 means all categories. You can find the ID in the <code>cat=</code> part of a Google Trends URL.",
            "default": 0
          },
          "searchType": {
            "title": "Search type",
            "enum": [
              "web",
              "images",
              "news",
              "youtube",
              "shopping"
            ],
            "type": "string",
            "description": "Which Google property the searches come from.",
            "default": "web"
          },
          "includeInterestOverTime": {
            "title": "Interest over time",
            "type": "boolean",
            "description": "Search interest (0-100) for each day, week or month in the time range.",
            "default": true
          },
          "includeInterestByRegion": {
            "title": "Interest by region",
            "type": "boolean",
            "description": "Search interest per country, region, city or metro area.",
            "default": false
          },
          "includeRelatedQueries": {
            "title": "Related queries",
            "type": "boolean",
            "description": "Top and rising searches related to each term.",
            "default": false
          },
          "includeRelatedTopics": {
            "title": "Related topics",
            "type": "boolean",
            "description": "Top and rising topics related to each term. Google often returns this list empty; not available for comparison groups.",
            "default": false
          },
          "regionResolution": {
            "title": "Region detail",
            "enum": [
              "AUTO",
              "COUNTRY",
              "REGION",
              "CITY",
              "DMA"
            ],
            "type": "string",
            "description": "How to split <i>Interest by region</i>. <b>Automatic</b> uses countries for worldwide and subregions for a country. <b>Cities</b> and <b>Metro areas</b> need a location; metro areas exist only for the US.",
            "default": "AUTO"
          },
          "includeLowVolumeRegions": {
            "title": "Include low-volume regions",
            "type": "boolean",
            "description": "Also return regions where Google has too little data (value 0).",
            "default": false
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "nested",
              "flat"
            ],
            "type": "string",
            "description": "<b>Nested</b>: one item per query with all data inside, best for JSON and APIs.<br><b>Flat</b>: one row per data point with the same columns everywhere, best for Excel and CSV.",
            "default": "nested"
          },
          "trendingGeos": {
            "title": "Countries",
            "type": "array",
            "description": "Two-letter country codes, one per line, for example <code>US</code> or <code>VN</code>.",
            "default": [
              "US"
            ],
            "items": {
              "type": "string"
            }
          },
          "language": {
            "title": "Language",
            "pattern": "^[a-z]{2,3}(-[A-Za-z]{2,4})?$",
            "type": "string",
            "description": "Language for Google's labels, for example <code>en-US</code> or <code>vi</code>. It does not change the numbers.",
            "default": "en-US"
          },
          "maxConcurrency": {
            "title": "Parallel sessions",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many queries run at the same time, each from its own proxy IP and cookies. The default of 5 is the fastest in our tests: with 10, Google blocked so many more requests that the run got slower and more expensive.",
            "default": 5
          },
          "maxAttemptsPerQuery": {
            "title": "Attempts per query",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many times a query is tried (with a fresh IP when Google blocks) before it is reported as failed. Failed queries are not charged.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Google rate-limits by IP address, so a proxy is strongly recommended.",
            "default": {
              "useApifyProxy": true
            }
          },
          "residentialFallback": {
            "title": "Switch to residential proxies when blocked",
            "type": "boolean",
            "description": "Google blocks many datacenter IPs. When a query is blocked, it is retried through Apify residential proxies, which Google blocks far less. This keeps the success rate high and costs you nothing extra: you still pay per successful query.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}