{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends API: Bulk Trends, Trending Now & Change Monitor",
    "description": "Reliable Google Trends scraper: interest over time, by region, related queries & topics, 100+ keywords on one scale (anchor-normalized), Trending Now, and change-only monitoring. Agent/MCP-friendly output.",
    "version": "0.1",
    "x-build-id": "maIYkZ4KOEpd1eF5x"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/shan-abbas~google-trends-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-shan-abbas-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/shan-abbas~google-trends-api/runs": {
      "post": {
        "operationId": "runs-sync-shan-abbas-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/shan-abbas~google-trends-api/run-sync": {
      "post": {
        "operationId": "run-sync-shan-abbas-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": {
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords to analyze (or full trends.google.com/trends/explore URLs, whose geo/date/cat/gprop override the defaults below). Up to 5,000. Not needed for trendingNow-only runs.",
            "items": {
              "type": "string"
            }
          },
          "modes": {
            "title": "Modes",
            "type": "array",
            "description": "What to collect. interestOverTime / interestByRegion / relatedQueries / relatedTopics are merged into ONE report per keyword. compareMany = all keywords on one 0-100 scale via anchor chaining. trendingNow = daily trending searches (RSS) for trendingGeos. changedOnly = emit only keywords whose trend changed since the last run's snapshot.",
            "items": {
              "type": "string",
              "enum": [
                "interestOverTime",
                "interestByRegion",
                "relatedQueries",
                "relatedTopics",
                "compareMany",
                "trendingNow",
                "changedOnly"
              ],
              "enumTitles": [
                "Interest over time",
                "Interest by region",
                "Related queries",
                "Related topics",
                "Compare many (anchor-normalized)",
                "Trending now",
                "Changed only (monitoring)"
              ]
            },
            "default": [
              "interestOverTime"
            ]
          },
          "geo": {
            "title": "Location (geo)",
            "type": "string",
            "description": "ISO country or sub-region code, e.g. US, GB, PK, US-CA. Empty = 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"
            ],
            "type": "string",
            "description": "Preset or custom range \"YYYY-MM-DD YYYY-MM-DD\" (custom only via JSON/API).",
            "default": "today 12-m"
          },
          "category": {
            "title": "Category ID",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category id (0 = all categories; e.g. 71 = Food & Drink, 7 = Finance).",
            "default": 0
          },
          "property": {
            "title": "Search property",
            "enum": [
              "web",
              "news",
              "images",
              "youtube",
              "froogle"
            ],
            "type": "string",
            "description": "Which Google search property to measure.",
            "default": "web"
          },
          "language": {
            "title": "Language (hl)",
            "type": "string",
            "description": "Interface language for names of regions/topics, e.g. en-US, de, fr-FR.",
            "default": "en-US"
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "full",
              "compact",
              "agentSummary"
            ],
            "type": "string",
            "description": "agentSummary is ideal for AI agents / MCP: small, flat, token-cheap.",
            "default": "full"
          },
          "anchorKeyword": {
            "title": "Anchor keyword (compareMany)",
            "type": "string",
            "description": "Keyword included in every 5-term batch to chain scales. Choose a stable, mid-popularity term. Default: first search term."
          },
          "trendingGeos": {
            "title": "Trending Now countries",
            "type": "array",
            "description": "Country codes for trendingNow mode. Default: geo or US.",
            "items": {
              "type": "string"
            }
          },
          "snapshotStoreName": {
            "title": "Snapshot store name (changedOnly)",
            "type": "string",
            "description": "Named key-value store that keeps the previous run's values. Named stores persist between runs.",
            "default": "google-trends-snapshots"
          },
          "snapshotKey": {
            "title": "Snapshot key",
            "type": "string",
            "description": "Use different keys for different monitoring jobs sharing a store.",
            "default": "default"
          },
          "changeThresholdPct": {
            "title": "Change threshold (%)",
            "minimum": 0,
            "type": "integer",
            "description": "Emit a keyword when its latest or average interest moved at least this much vs the snapshot, or a new Breakout related query appeared.",
            "default": 20
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many dataset items (0 = no limit). Caps cost.",
            "default": 0
          },
          "maxConcurrency": {
            "title": "Max concurrency (sessions)",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Parallel sessions. Each session has its own cookie + proxy IP.",
            "default": 3
          },
          "requestDelayMs": {
            "title": "Delay between requests per session (ms)",
            "minimum": 0,
            "type": "integer",
            "description": "Per-session politeness delay (jittered).",
            "default": 800
          },
          "maxRequestRetries": {
            "title": "Max retries per keyword",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Each retry uses a fresh session (new cookie + IP) with exponential backoff. After half the retries, the residential fallback is used.",
            "default": 6
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy recommended for bulk runs. Datacenter groups are tried first.",
            "default": {
              "useApifyProxy": true
            }
          },
          "residentialFallback": {
            "title": "Residential fallback",
            "type": "boolean",
            "description": "If a keyword keeps getting rate-limited, retry it through Apify RESIDENTIAL proxy (billed per GB, ~35 KB/keyword).",
            "default": true
          },
          "timezoneOffset": {
            "title": "Timezone offset (minutes)",
            "minimum": -840,
            "maximum": 840,
            "type": "integer",
            "description": "Google's tz param (minutes behind UTC; 0 = UTC). Affects hourly/daily bucket boundaries.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}