{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper — Bulk Keyword Compare",
    "description": "Compare up to 200 Google Trends keywords on one scale, with trend analysis: rising or falling, peak month, share of search. Regions and related queries.",
    "version": "1.1",
    "x-build-id": "FKiluIoRkXcaCFBeq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khalilbenali~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khalilbenali-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/khalilbenali~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khalilbenali-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/khalilbenali~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khalilbenali-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "keywords",
              "trendingNow"
            ],
            "type": "string",
            "description": "Keywords collects data for the keywords below. Trending now lists what people are searching for right now in one country (set it in the Trending now section). Example: choose Trending now to get today's top searches in the US.",
            "default": "keywords"
          },
          "keywords": {
            "title": "Keywords",
            "maxItems": 200,
            "type": "array",
            "description": "Search terms or Google topic IDs, one per line. Up to 200 per run. Whitespace is trimmed, and duplicates and empty lines are ignored. Used in Keywords mode. Example: coffee, iced tea, /m/0dl5d (a topic ID).",
            "default": [
              "coffee",
              "tea"
            ],
            "items": {
              "type": "string"
            }
          },
          "dataTypes": {
            "title": "Data to collect",
            "type": "array",
            "description": "Interest over time returns the timeline, interest by region the breakdown by country, state or city, and related queries the top and rising searches. Each keyword and data type is one result. Example: select all three to get 3 results per keyword.",
            "items": {
              "type": "string",
              "enum": [
                "interestOverTime",
                "interestByRegion",
                "relatedQueries"
              ],
              "enumTitles": [
                "Interest over time",
                "Interest by region",
                "Related queries"
              ]
            },
            "default": [
              "interestOverTime"
            ]
          },
          "regionResolution": {
            "title": "Region detail",
            "enum": [
              "COUNTRY",
              "REGION",
              "CITY",
              "DMA"
            ],
            "type": "string",
            "description": "Level of detail for Interest by region. Country is for worldwide searches. Region (states), City and DMA (US metro areas) work for a country such as US. If Google rejects a combination, the Actor uses Google's default breakdown for that region instead and logs a warning. Example: set Region to US and this to City to get the top US cities.",
            "default": "COUNTRY"
          },
          "compareMode": {
            "title": "Compare mode",
            "enum": [
              "separate",
              "compareAll"
            ],
            "type": "string",
            "description": "Separate: every keyword gets its own 0-100 scale (its own peak is 100). Compare all: every keyword is placed on one common scale. Up to 5 keywords use a single Google comparison; more than 5 are linked through an anchor keyword. Example: with coffee and tea on Compare all, the more searched keyword peaks at 100 and the other shows its lower values on the same scale.",
            "default": "separate"
          },
          "anchorKeyword": {
            "title": "Anchor keyword",
            "type": "string",
            "description": "Only used with Compare all and more than 5 keywords. This keyword is included in every batch to link the batches onto one scale. Pick a keyword with steady, mid-to-high interest. Leave empty to use the first keyword. Example: coffee.",
            "default": ""
          },
          "geo": {
            "title": "Region",
            "type": "string",
            "description": "Region code: US, GB, FR, DE... or a sub-region such as US-CA. Leave empty for worldwide. Example: FR for France, US-CA for California.",
            "default": ""
          },
          "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",
              "custom"
            ],
            "type": "string",
            "description": "The period to analyse. Shorter ranges give finer resolution (minutes or hours up to 7 days, days up to 3 months, weeks up to 5 years). Choose Custom range to set exact dates. Example: Past 30 days for a recent trend, 2004 - present for the long view.",
            "default": "today 12-m"
          },
          "customTimeRange": {
            "title": "Custom range",
            "type": "string",
            "description": "Used only when Time range is Custom range. Format: start and end date separated by a space, YYYY-MM-DD YYYY-MM-DD, for example 2025-01-01 2025-06-30. Data starts in 2004 and the end date cannot be in the future.",
            "default": ""
          },
          "category": {
            "title": "Category",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category ID. 0 means all categories. Examples: 0 = all categories, 3 = Arts and entertainment, 7 = Finance, 20 = Sports, 71 = Food and drink, 174 = Science.",
            "default": 0
          },
          "searchProperty": {
            "title": "Search property",
            "enum": [
              "web",
              "youtube",
              "news",
              "images",
              "froogle"
            ],
            "type": "string",
            "description": "Which Google search to analyse. Example: choose YouTube search to see what people look up on YouTube instead of Google web search.",
            "default": "web"
          },
          "trendingGeo": {
            "title": "Trending now: country",
            "type": "string",
            "description": "Country code for Trending now mode. Example: US, GB or FR.",
            "default": "US"
          },
          "trendingHours": {
            "title": "Trending now: window (hours)",
            "enum": [
              "4",
              "24",
              "48",
              "168"
            ],
            "type": "string",
            "description": "How far back Trending now looks: 4, 24, 48 or 168 hours (7 days). Example: 24 for the last day's trending searches.",
            "default": "24"
          },
          "trendingMaxItems": {
            "title": "Trending now: maximum items",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of trending searches to save, highest ranked first. Example: 100 saves the top 100.",
            "default": 100
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Interface language code, for example en-US, fr or de. It affects labels and related query wording, not the underlying numbers.",
            "default": "en-US"
          },
          "timezoneOffsetMinutes": {
            "title": "Timezone offset (minutes)",
            "minimum": -1439,
            "maximum": 1439,
            "type": "integer",
            "description": "Offset from UTC in minutes, as returned by JavaScript's getTimezoneOffset (UTC-5 is 300, UTC+1 is -60). It only matters for hourly and minute data.",
            "default": 0
          },
          "maxConcurrency": {
            "title": "Parallel sessions",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "How many sessions run in parallel, each with its own cookies and (on the Apify platform) its own proxy session. Every session waits at least two seconds between requests. 1 to 5. Example: 2 (the default) is a good balance of speed and politeness.",
            "default": 2
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}