{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper – Keywords, Regions, Related & Trending",
    "description": "Reliable Google Trends API: interest over time, by region, related queries, compare unlimited keywords on one scale, plus daily trending searches. Automatic retries, no platform fees.",
    "version": "1.0",
    "x-build-id": "DU6gy3SiCQ9pfUVAT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datataskflow~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datataskflow-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/datataskflow~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-datataskflow-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/datataskflow~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-datataskflow-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": "What to scrape",
            "enum": [
              "keywords",
              "trending"
            ],
            "type": "string",
            "description": "Keyword trends: interest over time (plus optional regions and related queries) for your search terms. Trending now: what people are searching for right now in a country.",
            "default": "keywords"
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords to analyze, one per line. Up to 500 per run. Each term is charged once, only if Google returns data for it.",
            "default": [
              "bitcoin"
            ],
            "items": {
              "type": "string"
            }
          },
          "geo": {
            "title": "Country or region",
            "type": "string",
            "description": "Two-letter country code (US, GB, DE, SI) or a sub-region code such as US-CA. Leave empty for worldwide. In 'Trending now' mode the default is US.",
            "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 analyze. Shorter ranges give finer granularity (minutes, hours, days); longer ranges give weeks or months.",
            "default": "today 12-m"
          },
          "customTimeRange": {
            "title": "Custom date range (optional)",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2} \\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Overrides 'Time range'. Format: YYYY-MM-DD YYYY-MM-DD, for example 2025-01-01 2025-06-30."
          },
          "compareTerms": {
            "title": "Compare all terms on one scale",
            "type": "boolean",
            "description": "Off: every term is scaled 0–100 on its own. On: all terms share one 0–100 scale so you can compare them directly. Google allows only 5 terms per comparison; above 5 this Actor chains comparisons through an anchor term so any number of terms ends up on the same scale.",
            "default": false
          },
          "anchorTerm": {
            "title": "Anchor term (optional, for comparing more than 5 terms)",
            "type": "string",
            "description": "Term included in every comparison group to link them together. Choose a term of medium popularity. Defaults to the first search term."
          },
          "includeInterestByRegion": {
            "title": "Interest by region",
            "type": "boolean",
            "description": "Adds where the term is most popular (countries, regions or cities). Charged as an add-on per term.",
            "default": false
          },
          "regionResolution": {
            "title": "Region level",
            "enum": [
              "auto",
              "COUNTRY",
              "REGION",
              "CITY",
              "DMA"
            ],
            "type": "string",
            "description": "Auto: countries for worldwide, sub-regions for a country. DMA (metro areas) works only for the US.",
            "default": "auto"
          },
          "includeRelatedQueries": {
            "title": "Related queries (top and rising)",
            "type": "boolean",
            "description": "Adds the top and rising searches related to each term. Charged as an add-on per term.",
            "default": false
          },
          "includeTimeline": {
            "title": "Include full timeline",
            "type": "boolean",
            "description": "Include every data point of interest over time. Turn off if you only need the summary (average, peak, trend).",
            "default": true
          },
          "category": {
            "title": "Category ID",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category ID (0 = all categories). Example: 7 = Finance, 5 = Computers & Electronics.",
            "default": 0
          },
          "searchProperty": {
            "title": "Search type",
            "enum": [
              "",
              "images",
              "news",
              "froogle",
              "youtube"
            ],
            "type": "string",
            "description": "Which Google search to measure.",
            "default": ""
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Language for region names and related queries, e.g. en-US, de-DE.",
            "default": "en-US"
          },
          "maxItems": {
            "title": "Max trending searches",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Only for 'Trending now' mode. Google's live feed currently lists about 10–20 trending searches per country at a time.",
            "default": 20
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "The default works for most users. If Google blocks a request, the Actor retries automatically with a new IP and falls back to residential proxies at no extra cost to you.",
            "default": {
              "useApifyProxy": true
            }
          },
          "maxRetries": {
            "title": "Max retries per request",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many times to retry with a fresh IP when Google blocks a request.",
            "default": 8
          },
          "maxConcurrency": {
            "title": "Parallel terms",
            "minimum": 1,
            "maximum": 6,
            "type": "integer",
            "description": "How many terms to process at the same time.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}