{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper: Timeline, Regions & Queries",
    "description": "Collect interest over time, regional breakdowns, and related topics or queries from Google Trends. Compare up to five terms per chart. Requests run sequentially and stop if Google rate-limits them.",
    "version": "0.1",
    "x-build-id": "aEx6cn4hnyhHhDyoE"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rar_888~google-trends/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rar_888-google-trends",
        "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/rar_888~google-trends/runs": {
      "post": {
        "operationId": "runs-sync-rar_888-google-trends",
        "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/rar_888~google-trends/run-sync": {
      "post": {
        "operationId": "run-sync-rar_888-google-trends",
        "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",
        "required": [
          "keywords"
        ],
        "properties": {
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "List of search terms to query on Google Trends (required). When 'compare' is false, each keyword is queried individually; when 'compare' is true, keywords are grouped into batches of up to 5.",
            "default": [
              "artificial intelligence",
              "machine learning",
              "python"
            ],
            "items": {
              "type": "string"
            }
          },
          "compare": {
            "title": "Compare Keywords (Groups of up to 5)",
            "type": "boolean",
            "description": "When true, groups keywords into batches of up to 5 in a single comparative query. When false (default), queries each keyword individually.",
            "default": false
          },
          "geo": {
            "title": "Geography (ISO Code)",
            "type": "string",
            "description": "Two-letter ISO country code (e.g., 'US', 'GB', 'ES', 'DE') or sub-region code (e.g., 'US-CA'). Leave empty ('') for Worldwide.",
            "default": "US"
          },
          "timeRange": {
            "title": "Time Range",
            "type": "string",
            "description": "Predefined window ('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 UTC date range 'YYYY-MM-DD YYYY-MM-DD'.",
            "default": "today 3-m"
          },
          "category": {
            "title": "Category ID",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends numeric category ID (0 = All categories, 3 = Arts & Entertainment, 5 = Computers & Electronics, 7 = Finance, 16 = News, etc.).",
            "default": 0
          },
          "property": {
            "title": "Google Property",
            "enum": [
              "",
              "images",
              "news",
              "youtube",
              "froogle"
            ],
            "type": "string",
            "description": "Google search surface: '' (Web Search), 'images' (Image Search), 'news' (News Search), 'youtube' (YouTube Search), or 'froogle' (Google Shopping).",
            "default": ""
          },
          "includeTimeline": {
            "title": "Include Interest Over Time (Timeline)",
            "type": "boolean",
            "description": "Fetch the Interest Over Time series (/trends/api/widgetdata/multiline).",
            "default": true
          },
          "includeRegions": {
            "title": "Include Interest by Region",
            "type": "boolean",
            "description": "Fetch the geographic breakdown (/trends/api/widgetdata/comparedgeo).",
            "default": false
          },
          "includeRelated": {
            "title": "Include Related Queries & Topics (Top & Rising)",
            "type": "boolean",
            "description": "Fetch both Related Queries and Related Topics (top and rising lists) via /trends/api/widgetdata/relatedsearches.",
            "default": false
          },
          "hl": {
            "title": "Interface Language (hl)",
            "type": "string",
            "description": "BCP-47 language tag for labels and related topics (e.g., 'en-US', 'es-ES', 'pt-BR').",
            "default": "en-US"
          },
          "maxItems": {
            "title": "Maximum Output Items",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of successful dataset items (terms or comparison groups) to output.",
            "default": 100
          },
          "proxyGroup": {
            "title": "Apify Proxy Group",
            "enum": [
              "DATACENTER",
              "RESIDENTIAL"
            ],
            "type": "string",
            "description": "Apify Proxy group to route requests through when proxy is enabled: 'DATACENTER' (default, fast and cost-effective) or 'RESIDENTIAL' (recommended if Google rate-limits datacenter IPs).",
            "default": "DATACENTER"
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Apify Proxy or custom proxy configuration. Uses datacenter/standard proxy by default on Apify; works directly without proxy in local environments.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}