{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends API — interest over time, region, related queries",
    "description": "Google Trends data as JSON: interest over time, interest by region, related queries/topics for any keyword, plus trending searches per country. HTTP-only, correct multi-keyword semantics, no infinite retries. Pay per keyword×widget.",
    "version": "0.1",
    "x-build-id": "hheE4a1gofa2AcVBz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/alxlin~google-trends-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-alxlin-google-trends-api",
        "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/alxlin~google-trends-api/runs": {
      "post": {
        "operationId": "runs-sync-alxlin-google-trends-api",
        "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/alxlin~google-trends-api/run-sync": {
      "post": {
        "operationId": "run-sync-alxlin-google-trends-api",
        "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": {
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Search terms, e.g. \"bitcoin\" or \"/m/05p0rrx\" (topic id). Each keyword is fetched on its own (own 0–100 scale) unless \"Compare keywords\" is on. Not needed if you only want trending_now.",
            "items": {
              "type": "string"
            }
          },
          "widgets": {
            "title": "Data to fetch",
            "type": "array",
            "description": "Which Google Trends widgets to fetch. One dataset item (and one keyword-widget charge) per keyword × widget; trending_now is charged per trend item.",
            "items": {
              "type": "string",
              "enum": [
                "interest_over_time",
                "interest_by_region",
                "related_queries",
                "related_topics",
                "trending_now"
              ],
              "enumTitles": [
                "Interest over time (time series)",
                "Interest by region (map data)",
                "Related queries (top + rising)",
                "Related topics (top + rising; often empty for logged-out sessions)",
                "Trending now (RSS, needs no keyword)"
              ]
            },
            "default": [
              "interest_over_time",
              "interest_by_region",
              "related_queries",
              "related_topics"
            ]
          },
          "geo": {
            "title": "Location",
            "type": "string",
            "description": "ISO 3166 country code (US, GB, DE), region (US-CA) or empty for worldwide.",
            "default": ""
          },
          "timeframe": {
            "title": "Time range",
            "type": "string",
            "description": "Google Trends syntax: 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 custom range \"2024-01-01 2024-12-31\".",
            "default": "today 12-m"
          },
          "category": {
            "title": "Category id",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category id (0 = all categories; e.g. 7 = Finance, 5 = Computers & Electronics). Same numbers as the cat= parameter in Trends URLs.",
            "default": 0
          },
          "gprop": {
            "title": "Search type",
            "enum": [
              "",
              "images",
              "news",
              "youtube",
              "froogle"
            ],
            "type": "string",
            "description": "Which Google search vertical to pull Trends data from ('' = regular web search).",
            "default": ""
          },
          "compare": {
            "title": "Compare keywords (shared scale)",
            "type": "boolean",
            "description": "ON: up to 5 keywords go into ONE Trends request and share a single 0–100 scale, exactly like the Trends compare view (values across keywords are comparable; region data becomes each keyword's share in %). OFF (default): one request per keyword, each normalised to its own peak = 100 — numbers are NOT comparable across keywords. This is the isMultiple behaviour other actors get wrong.",
            "default": false
          },
          "resolution": {
            "title": "Region resolution",
            "enum": [
              "",
              "COUNTRY",
              "REGION",
              "CITY",
              "DMA"
            ],
            "type": "string",
            "description": "Granularity for interest_by_region.",
            "default": ""
          },
          "hl": {
            "title": "Language",
            "type": "string",
            "description": "UI language for labels and related lists, e.g. en-US, de-DE, ja-JP.",
            "default": "en-US"
          },
          "trending_geo": {
            "title": "Trending-now country",
            "type": "string",
            "description": "Country code for the trending_now widget (US, GB, IN, BR, …).",
            "default": "US"
          },
          "maxAttemptsPerKeyword": {
            "title": "Max sessions per keyword",
            "minimum": 1,
            "maximum": 6,
            "type": "integer",
            "description": "How many fresh sessions (new proxy IP + cookie) to try per keyword before giving up on the widgets that are still missing. Partial results are always kept.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Google throttles by IP (~10–15 API calls per burst). Residential proxies with one session per keyword are the reliable setting. Without any proxy the actor runs direct with pacing and exponential backoff.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}