{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper: Compare Keywords, Trending Now, API",
    "description": "Google Trends scraper and API: interest over time, interest by region, related queries and Trending Now for any number of keywords. Compares more than 5 terms on one scale. $1 per 1,000 results, pay per result, no rental. No login, no browser.",
    "version": "0.1",
    "x-build-id": "lAeDGS9k9uxgEjtsZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datagleaner~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datagleaner-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/datagleaner~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-datagleaner-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/datagleaner~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-datagleaner-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": [
              "search",
              "trendingNow"
            ],
            "type": "string",
            "description": "search: interest data for your search terms. trendingNow: what is trending right now in each country.",
            "default": "search"
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Any number of terms. More than 5 are split into groups that share an anchor term (the first term), so values stay comparable across groups. You can also paste a Google Trends explore URL (trends.google.com/trends/explore?q=...): it runs with the terms, location, time range, category and property in that URL.",
            "items": {
              "type": "string"
            }
          },
          "geo": {
            "title": "Locations",
            "type": "array",
            "description": "Country or region codes such as US, GB, DE, US-CA, GB-ENG. Leave empty for worldwide (search mode). Trending now needs a country code and defaults to US.",
            "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"
            ],
            "type": "string",
            "description": "Preset range. Ignored when both custom dates are set.",
            "default": "today 12-m"
          },
          "customStartDate": {
            "title": "Custom start date",
            "type": "string",
            "description": "YYYY-MM-DD. Use together with the end date to override the preset."
          },
          "customEndDate": {
            "title": "Custom end date",
            "type": "string",
            "description": "YYYY-MM-DD."
          },
          "category": {
            "title": "Category ID",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category number. 0 is all categories; for example 5 is Computers & Electronics, 7 is Finance, 45 is Health.",
            "default": 0
          },
          "property": {
            "title": "Search property",
            "enum": [
              "web",
              "youtube",
              "news",
              "images",
              "froogle"
            ],
            "type": "string",
            "description": "Which Google search surface to measure.",
            "default": "web"
          },
          "outputs": {
            "title": "Outputs to include",
            "type": "array",
            "description": "One dataset item is written per term per location per output. A related queries or topics result that comes back empty is skipped, so you are not charged for it.",
            "items": {
              "type": "string",
              "enum": [
                "interestOverTime",
                "interestByRegion",
                "relatedQueries",
                "relatedTopics"
              ],
              "enumTitles": [
                "Interest over time",
                "Interest by region",
                "Related queries (top and rising)",
                "Related topics (beta: Google often withholds them; empty results are skipped and not charged)"
              ]
            },
            "default": [
              "interestOverTime"
            ]
          },
          "outputShape": {
            "title": "Output shape",
            "enum": [
              "perOutput",
              "perTerm"
            ],
            "type": "string",
            "description": "perOutput: one dataset item per term per location per output (a series, a region list and related queries are separate items, each charged). perTerm: one item per term per location holding every output you selected, charged once.",
            "default": "perOutput"
          },
          "regionResolution": {
            "title": "Region resolution",
            "enum": [
              "COUNTRY",
              "REGION",
              "CITY",
              "DMA"
            ],
            "type": "string",
            "description": "Level of detail for interest by region. Country-level searches support REGION, CITY and DMA; worldwide supports COUNTRY.",
            "default": "REGION"
          },
          "includeLowSearchVolumeRegions": {
            "title": "Include low search volume regions",
            "type": "boolean",
            "description": "Also list regions where Google has too little data (value 0).",
            "default": false
          },
          "trendingHours": {
            "title": "Trending window (hours)",
            "type": "integer",
            "description": "Trending now mode: Google offers 4 (close to real time), 24 (the daily list), 48 and 168 (a week).",
            "default": 24
          },
          "trendingSortBy": {
            "title": "Trending order",
            "enum": [
              "searchVolume",
              "startedAt"
            ],
            "type": "string",
            "description": "Trending now mode: rank by search volume (biggest trends first) or by start time (newest first).",
            "default": "searchVolume"
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Interface language code that shapes related query and topic names, for example en-US, de, ja.",
            "default": "en-US"
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many dataset items (each one is charged). 0 means no limit. Useful in Trending now mode, where one country can return several hundred trends.",
            "default": 0
          },
          "requestDelaySeconds": {
            "title": "Delay between requests (seconds)",
            "minimum": 0,
            "type": "number",
            "description": "Pause between requests to Google. Raise it if you see many 429 retries.",
            "default": 1.5
          },
          "maxRetries": {
            "title": "Retries per request",
            "minimum": 1,
            "maximum": 15,
            "type": "integer",
            "description": "On HTTP 429 or a network error the Actor waits with exponential backoff, gets a fresh cookie (and a new proxy session) and retries.",
            "default": 6
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional, off by default. The run's own IP handled 260 requests in testing, while Apify's shared datacenter proxy got HTTP 429 on most of them. Use a residential proxy only if a large batch keeps hitting 429."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}