{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Compare: Unlimited Keywords, One Scale",
    "description": "Compare unlimited keywords on one consistent Google Trends 0-100 scale (Google caps at 5), any country or worldwide, with daily history for any range back to 2004. Auto datacenter + residential fallback. Pay per keyword series.",
    "version": "0.1",
    "x-build-id": "7jkLPIWzhHxGKL4Vh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/latentlark~google-trends-compare/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-latentlark-google-trends-compare",
        "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/latentlark~google-trends-compare/runs": {
      "post": {
        "operationId": "runs-sync-latentlark-google-trends-compare",
        "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/latentlark~google-trends-compare/run-sync": {
      "post": {
        "operationId": "run-sync-latentlark-google-trends-compare",
        "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",
            "minItems": 1,
            "type": "array",
            "description": "Any number of search terms (Google's own UI caps at 5). All of them come back on ONE shared 0-100 scale, so 40 brands or products are directly comparable. Each keyword x country = one billed keyword series ($0.004 on the Free plan).",
            "items": {
              "type": "string"
            }
          },
          "geos": {
            "title": "Countries",
            "type": "array",
            "description": "ISO country codes (US, GB, DE, BR, IN, JP...) or WORLDWIDE. Each country gets its own consistent scale. Empty = US.",
            "default": [
              "US"
            ],
            "items": {
              "type": "string"
            }
          },
          "timeRange": {
            "title": "Time range",
            "type": "string",
            "description": "Presets: today 1-m, today 3-m, today 12-m, today 5-y, all (since 2004), or today N-y / N-m / N-d, or an explicit range \"YYYY-MM-DD YYYY-MM-DD\". Google picks daily (<~8 months), weekly (<5 years) or monthly resolution unless you choose daily-stitched.",
            "default": "today 12-m"
          },
          "resolution": {
            "title": "Resolution",
            "enum": [
              "auto",
              "daily-stitched"
            ],
            "type": "string",
            "description": "auto = whatever Google returns for the range (daily/weekly/monthly; cheapest). daily-stitched = daily points for ANY range via overlapping 240-day windows; adds daily-history-year events ($0.003 per keyword x country x year on the Free plan) when the range is longer than 240 days.",
            "default": "auto"
          },
          "scaleMode": {
            "title": "Scale mode",
            "enum": [
              "accurate",
              "fast"
            ],
            "type": "string",
            "description": "accurate (recommended) = pre-rank pass + size-based tiers chained through shared link terms, so small keywords stay precise next to giants. fast = one shared anchor keyword (fewer requests, less precise for small terms). Same price.",
            "default": "accurate"
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "long",
              "wide"
            ],
            "type": "string",
            "description": "long = one row per keyword x country x date (easiest to filter/chart). wide = one row per country x date with a values{keyword: value} object (much smaller dataset for big keyword sets). Same price.",
            "default": "long"
          },
          "anchorKeyword": {
            "title": "Pre-rank anchor (optional)",
            "type": "string",
            "description": "Keyword used for the pre-rank pass. Empty = first keyword. Use a mid-volume term in your niche if your first keyword is tiny or huge."
          },
          "verifySample": {
            "title": "Verify against a real 5-term Google chart",
            "type": "boolean",
            "description": "Makes one extra real 5-keyword Google request across tiers and stores the mean absolute error of the stitched scale vs Google's own chart in the QA record (typically 0.05-0.25 points). Free.",
            "default": false
          },
          "category": {
            "title": "Category id",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category id (0 = all categories, e.g. 71 = Food & Drink, 7 = Finance). Disambiguates words like \"apple\".",
            "default": 0
          },
          "property": {
            "title": "Search property",
            "enum": [
              "",
              "images",
              "news",
              "froogle",
              "youtube"
            ],
            "type": "string",
            "description": "Which Google search property to measure.",
            "default": ""
          },
          "proxyMode": {
            "title": "Proxy",
            "enum": [
              "auto",
              "datacenter",
              "residential",
              "none"
            ],
            "type": "string",
            "description": "Datacenter by default; switches to residential automatically after repeated datacenter failures.",
            "default": "auto"
          },
          "datacenterGroups": {
            "title": "Datacenter proxy groups",
            "type": "array",
            "description": "Empty = Apify auto datacenter selection.",
            "items": {
              "type": "string"
            }
          },
          "residentialCountry": {
            "title": "Residential proxy country",
            "type": "string",
            "description": "Optional ISO country for residential exits."
          },
          "pacingSecs": {
            "title": "Seconds between Google requests (min 1.5)",
            "minimum": 1.5,
            "type": "number",
            "description": "Minimum gap between Google requests (never below 1.5 s).",
            "default": 1.5
          },
          "maxAttempts": {
            "title": "Max attempts per request",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Retries with 2/4/8/16 s backoff; new IP after the 2nd failure.",
            "default": 5
          },
          "fallbackAfterFailures": {
            "title": "Switch to residential after N datacenter failures",
            "minimum": 1,
            "type": "integer",
            "description": "Datacenter failures before switching to residential (auto mode).",
            "default": 6
          },
          "tierMaxRatio": {
            "title": "Max size ratio inside a tier",
            "minimum": 2,
            "type": "number",
            "description": "A tier only admits keywords within this size ratio of its top keyword (precision for small terms).",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}