{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper - Compare 100 Keywords",
    "description": "Google Trends scraper & API that compares up to 100 keywords on ONE 0-100 scale (Google allows 5). Every run is self-checked against a direct Google query. Country, region, metro, custom dates, Web/YouTube/News/Shopping. CSV/JSON. Pay only for keywords delivered.",
    "version": "1.0",
    "x-build-id": "9ypYGTzcFHeDtRzb6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/satin_armeria~google-trends-advanced-comparator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-satin_armeria-google-trends-advanced-comparator",
        "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/satin_armeria~google-trends-advanced-comparator/runs": {
      "post": {
        "operationId": "runs-sync-satin_armeria-google-trends-advanced-comparator",
        "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/satin_armeria~google-trends-advanced-comparator/run-sync": {
      "post": {
        "operationId": "run-sync-satin_armeria-google-trends-advanced-comparator",
        "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,
            "maxItems": 100,
            "type": "array",
            "description": "1-100 search terms to compare (duplicates are removed case/whitespace-insensitively). You are charged only for keywords that were successfully placed on the common scale.",
            "items": {
              "type": "string"
            }
          },
          "geo": {
            "title": "Location (geo)",
            "type": "string",
            "description": "Empty = worldwide. ISO country code (US, ES, DE...), region (US-CA, ES-MD) or US metro (US-NY-501).",
            "default": ""
          },
          "timeframe": {
            "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",
              "custom"
            ],
            "type": "string",
            "description": "Preset Google Trends period, or 'custom' to use Start date / End date. Live 'now' periods return hourly/minute data.",
            "default": "today 12-m"
          },
          "startDate": {
            "title": "Start date (custom range)",
            "type": "string",
            "description": "Used when Time range = custom. Format YYYY-MM-DD, not earlier than 2004-01-01."
          },
          "endDate": {
            "title": "End date (custom range)",
            "type": "string",
            "description": "Used when Time range = custom. Format YYYY-MM-DD. Defaults to today."
          },
          "gprop": {
            "title": "Google property",
            "enum": [
              "web",
              "news",
              "youtube",
              "images",
              "froogle"
            ],
            "type": "string",
            "description": "Which Google search to measure.",
            "default": "web"
          },
          "category": {
            "title": "Category ID",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category ID (0 = all categories; e.g. 5 = Computers & Electronics, 7 = Finance, 71 = Food & Drink).",
            "default": 0
          },
          "language": {
            "title": "Interface language (hl)",
            "type": "string",
            "description": "Google Trends interface language, affects related-query labels only.",
            "default": "en-US"
          },
          "selfCheck": {
            "title": "Validate with a direct Google query (self-check)",
            "type": "boolean",
            "description": "After chaining, re-query up to 5 of the keywords together in one direct Google Trends request and report the point-by-point error of the chained values. Costs 2 extra requests, no extra charge.",
            "default": true
          },
          "includeRelatedQueries": {
            "title": "Include related queries (top & rising)",
            "type": "boolean",
            "description": "Fetch related queries for every keyword (1 extra request each, charged as 'keyword-extra-data'). Saved to the RELATED_QUERIES record.",
            "default": false
          },
          "includeInterestByRegion": {
            "title": "Include interest by region",
            "type": "boolean",
            "description": "Fetch each keyword's interest by sub-region (own 0-100 scale per keyword; 1 extra request each, charged as 'keyword-extra-data'). Saved to the INTEREST_BY_REGION record.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Google rate-limits shared IPs. Residential proxy is recommended for reliable runs.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "maxRefinementRounds": {
            "title": "Max refinement rounds",
            "minimum": 0,
            "maximum": 4,
            "type": "integer",
            "description": "Extra rounds that re-measure keywords whose magnitude is far from the anchor (ladder batches). 0 = star chaining only (cheaper, less precise for long-tail terms).",
            "default": 2
          },
          "maxConcurrency": {
            "title": "Max parallel sessions",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "0 = auto (3 with proxy, 1 without).",
            "default": 0
          },
          "requestDelayMs": {
            "title": "Delay between requests per session (ms)",
            "minimum": 0,
            "maximum": 30000,
            "type": "integer",
            "description": "Politeness delay per session. Lower values are faster but raise HTTP 429 risk.",
            "default": 1500
          },
          "maxRetries": {
            "title": "Max retries per request",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Retries for HTTP 429/5xx/timeouts with bounded exponential backoff (4s, 8s, 16s... max 60s).",
            "default": 4
          },
          "maxRequests": {
            "title": "Hard cap on HTTP requests",
            "minimum": 4,
            "maximum": 2000,
            "type": "integer",
            "description": "The run stops fetching when this many requests were made (results so far are still normalized and saved).",
            "default": 400
          },
          "maxRuntimeSeconds": {
            "title": "Hard cap on runtime (seconds)",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "Stops fetching after this time and saves what was measured.",
            "default": 900
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}