{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper: Interest, Regions, Related, Trending Now",
    "description": "Reliable Google Trends API alternative. Compare up to 5 keywords per comparison and many comparisons per run: interest over time, interest by country, region or city, related queries and Trending now by country. Built-in 429 handling.",
    "version": "0.1",
    "x-build-id": "y9bsch0dD3EnpSPpt"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ctriolab~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ctriolab-google-trends-scraper",
        "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/ctriolab~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-ctriolab-google-trends-scraper",
        "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/ctriolab~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-ctriolab-google-trends-scraper",
        "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 (one comparison per line)",
            "type": "array",
            "description": "Each line is one Google Trends comparison. Put up to 5 terms on a line separated by commas to compare them on the same 0-100 scale, e.g. \"coffee, tea, matcha\". Use one term per line to get each term on its own scale.",
            "default": [
              "coffee, tea"
            ],
            "items": {
              "type": "string"
            }
          },
          "geo": {
            "title": "Location (geo code)",
            "type": "string",
            "description": "Country or subregion code as used by Google Trends: US, GB, DE, KR, JP, US-CA, GB-ENG ... Leave empty for worldwide.",
            "default": "US"
          },
          "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": "Google picks the data resolution from the range: minutes or hours for short ranges, days up to 9 months, weeks up to 5 years, months beyond.",
            "default": "today 12-m"
          },
          "customTimeRange": {
            "title": "Custom range",
            "type": "string",
            "description": "Used only when Time range is Custom. Format \"YYYY-MM-DD YYYY-MM-DD\", e.g. \"2024-01-01 2024-12-31\". Hourly: \"2024-01-01T10 2024-01-07T22\" (max 7 days)."
          },
          "category": {
            "title": "Category ID",
            "minimum": 0,
            "type": "integer",
            "description": "0 = all categories. Examples: 7 Finance, 12 Business & Industrial, 18 Shopping, 44 Beauty & Fitness, 45 Health, 71 Food & Drink, 958 Jobs, 5 Computers & Electronics.",
            "default": 0
          },
          "gprop": {
            "title": "Search type",
            "enum": [
              "web",
              "images",
              "news",
              "youtube",
              "froogle"
            ],
            "type": "string",
            "description": "Which Google property to measure.",
            "default": "web"
          },
          "includeInterestOverTime": {
            "title": "Interest over time",
            "type": "boolean",
            "description": "Timeline of relative interest (0-100) for each term.",
            "default": true
          },
          "includeInterestByRegion": {
            "title": "Interest by region",
            "type": "boolean",
            "description": "Relative interest per country, region or city for each term.",
            "default": false
          },
          "regionResolution": {
            "title": "Region level",
            "enum": [
              "auto",
              "COUNTRY",
              "REGION",
              "CITY",
              "DMA"
            ],
            "type": "string",
            "description": "Level of detail for Interest by region.",
            "default": "auto"
          },
          "includeLowVolumeRegions": {
            "title": "Include low search volume regions",
            "type": "boolean",
            "description": "Same as the checkbox on the Google Trends website.",
            "default": false
          },
          "includeRelatedQueries": {
            "title": "Related queries (top and rising)",
            "type": "boolean",
            "description": "Queries people also searched for, per term.",
            "default": false
          },
          "includeRelatedTopics": {
            "title": "Related topics (beta)",
            "type": "boolean",
            "description": "Topics people also searched for, per term. Beta: Google currently hides related topics from most automated clients, so this list is often empty. Empty results are not saved and not charged.",
            "default": false
          },
          "trendingNowCountries": {
            "title": "Trending now: countries",
            "type": "array",
            "description": "Country codes for the Google Trends 'Trending now' list (what is spiking in search right now), e.g. US, GB, KR, JP, IN. Can be used with or without search terms.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "trendingNowHours": {
            "title": "Trending now: time window",
            "enum": [
              "4",
              "24",
              "48",
              "168"
            ],
            "type": "string",
            "description": "Trends that started within this window.",
            "default": "24"
          },
          "maxTrendingPerCountry": {
            "title": "Trending now: max trends per country",
            "minimum": 0,
            "type": "integer",
            "description": "0 means all (usually 50 to 500 depending on country and window).",
            "default": 0
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "item-per-term",
              "row-per-point"
            ],
            "type": "string",
            "description": "item-per-term returns one result per term and data type. row-per-point returns one flat row per date, region or related query, which is easier in Google Sheets or Excel but produces more results.",
            "default": "item-per-term"
          },
          "language": {
            "title": "Language (hl)",
            "type": "string",
            "description": "Language for formatted dates, topic names and Trending now, e.g. en-US, de, ko, ja.",
            "default": "en-US"
          },
          "timezoneOffset": {
            "title": "Time zone offset (minutes)",
            "type": "integer",
            "description": "Same as Google's tz parameter: minutes behind UTC. 0 = UTC, 300 = New York (EST), -540 = Seoul.",
            "default": 0
          },
          "maxRetries": {
            "title": "Max retries per request",
            "minimum": 0,
            "maximum": 15,
            "type": "integer",
            "description": "On rate limits (HTTP 429) the actor rotates the session and proxy IP and waits with exponential backoff.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Google Trends rate-limits datacenter IPs. The default works for most runs.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}