{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper: Compare Keywords Over Time",
    "description": "Google Trends scraper: interest over time, by region and related queries for keyword lists. Accepts the official Actor's input, returns the same field names. Fails fast instead of hanging. $0.015 per keyword (+$0.005 with related data); $0 if nothing is delivered. No related topics or city data.",
    "version": "0.1",
    "x-build-id": "poWgx5XT0NLfaeh4g"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tallydata~google-trends-interest-over-time/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tallydata-google-trends-interest-over-time",
        "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/tallydata~google-trends-interest-over-time/runs": {
      "post": {
        "operationId": "runs-sync-tallydata-google-trends-interest-over-time",
        "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/tallydata~google-trends-interest-over-time/run-sync": {
      "post": {
        "operationId": "run-sync-tallydata-google-trends-interest-over-time",
        "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 look up, one per entry. Same field as apify/google-trends-scraper. With isMultiple on, a comma compares up to 5 terms on one scale.",
            "items": {
              "type": "string"
            }
          },
          "isMultiple": {
            "title": "Compare terms split by commas",
            "type": "boolean",
            "description": "On: \"iphone, samsung\" becomes one comparison of up to 5 terms. Off: the comma is part of the keyword.",
            "default": false
          },
          "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",
              "now 1-h",
              "now 4-h"
            ],
            "type": "string",
            "description": "Predefined range. Empty means the past 12 months.",
            "default": ""
          },
          "customTimeRange": {
            "title": "Custom time range",
            "type": "string",
            "description": "YYYY-MM-DD YYYY-MM-DD, or YYYY-MM-DDTHH YYYY-MM-DDTHH for a span of 7 days or less. Overrides the time range."
          },
          "geo": {
            "title": "Geo",
            "pattern": "^$|^[A-Za-z]{2}(-[A-Za-z0-9]{1,3}){0,2}$",
            "type": "string",
            "description": "ISO country or region code, such as US or US-CA. Empty means worldwide.",
            "default": ""
          },
          "viewedFrom": {
            "title": "Viewed from",
            "pattern": "^$|^[a-z]{2}$",
            "type": "string",
            "description": "Two-letter lower-case country the request is made from. Empty means US."
          },
          "category": {
            "title": "Category",
            "pattern": "^\\d*$",
            "type": "string",
            "description": "Numeric Google Trends category id. Empty means all categories.",
            "default": ""
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Google Trends explore URLs. Their q, geo, date, cat and gprop override the fields above for that URL.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "spreadsheetId": {
            "title": "Google Sheet id",
            "type": "string",
            "description": "Public sheet: keywords in the first column, with a header in row 1."
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum rows with data to deliver. 0 means no limit.",
            "default": 0
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "official",
              "full"
            ],
            "type": "string",
            "description": "official (default): exactly the fields of apify/google-trends-scraper. full: the same fields plus a meta object with a summary (peak, latest, average, top rising queries), the status of each data block and what the row cost. AI agents: use full and read meta; worldwide queries return a large interestBy list (~250 countries).",
            "default": "official"
          },
          "widgets": {
            "title": "Data blocks",
            "type": "array",
            "description": "Which blocks to fetch. Blocks left out stay empty and are not charged.",
            "items": {
              "type": "string",
              "enum": [
                "interestOverTime",
                "interestByRegion",
                "relatedQueries"
              ]
            },
            "default": [
              "interestOverTime",
              "interestByRegion",
              "relatedQueries"
            ]
          },
          "maxRunSecs": {
            "title": "Time budget (seconds)",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "Stop starting new queries after this long. Default is 270 for up to 25 queries, otherwise only the run timeout."
          },
          "maxConcurrency": {
            "title": "Max concurrency (ignored)",
            "type": "integer",
            "description": "Accepted for compatibility with the official input. Not used."
          },
          "maxRequestRetries": {
            "title": "Max request retries (ignored)",
            "type": "integer",
            "description": "Accepted for compatibility. Not used."
          },
          "pageLoadTimeoutSecs": {
            "title": "Page load timeout (ignored)",
            "type": "integer",
            "description": "Accepted for compatibility. Not used, there is no browser."
          },
          "skipDebugScreen": {
            "title": "Skip debug screen (ignored)",
            "type": "boolean",
            "description": "Accepted for compatibility. Not used."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration (ignored)",
            "type": "object",
            "description": "Accepted for compatibility. The proxy is included in the price."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}