{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper: Multi-Country + Trending",
    "description": "Compare a keyword's interest over time across up to 15 countries on one 0-100 scale in a single run, and get today's trending searches for any supported country. Presets: SEA, ASEAN, APAC, EU5, ANGLO, G7. Optional related queries, province-level breakdowns and a category filter.",
    "version": "0.1",
    "x-build-id": "tLoykfckfiOfmsrqs"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/asia-data-desk~google-trends-sea/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-asia-data-desk-google-trends-sea",
        "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/asia-data-desk~google-trends-sea/runs": {
      "post": {
        "operationId": "runs-sync-asia-data-desk-google-trends-sea",
        "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/asia-data-desk~google-trends-sea/run-sync": {
      "post": {
        "operationId": "run-sync-asia-data-desk-google-trends-sea",
        "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": [
              "trending_now",
              "compare"
            ],
            "type": "string",
            "description": "trending_now: the current trending searches per country (about 10 per country). compare: interest over time per keyword and country, with optional related queries.",
            "default": "trending_now"
          },
          "countryPreset": {
            "title": "Country preset",
            "enum": [
              "SEA",
              "ASEAN",
              "APAC",
              "EU5",
              "ANGLO",
              "G7"
            ],
            "type": "string",
            "description": "A ready-made group of countries, used when the Countries field below is empty. SEA: SG MY ID TH VN PH. ASEAN: SG MY ID TH VN PH BN KH LA MM. APAC: AU CN HK IN ID JP KR MY NZ PH SG TH TW VN. EU5: DE ES FR IT NL. ANGLO: AU CA GB IE NZ US. G7: CA DE FR GB IT JP US.",
            "default": "SEA"
          },
          "countries": {
            "title": "Countries (overrides the preset)",
            "maxItems": 15,
            "type": "array",
            "description": "Optional. Up to 15 two-letter ISO 3166-1 country codes, for example US, GB, SG, JP (the United Kingdom is GB). If you list any, the preset is ignored. Leave empty to use the preset. Compare mode needs one extra request for every four countries beyond the first five.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords (compare mode)",
            "type": "array",
            "description": "1 to 5 search terms, used only in compare mode. Each keyword is compared across the chosen countries on its own 0-100 scale, so keywords are not compared with each other.",
            "items": {
              "type": "string"
            }
          },
          "timeframe": {
            "title": "Timeframe (compare mode)",
            "type": "string",
            "description": "One of: 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, or a custom range written as 'YYYY-MM-DD YYYY-MM-DD'. Short windows give hourly or minute data; today 12-m gives weekly data.",
            "default": "today 12-m"
          },
          "includeRelated": {
            "title": "Include related queries (compare mode)",
            "type": "boolean",
            "description": "Add one related-queries record (top and rising) per keyword and country. This adds one request per keyword and country, so runs take longer and cost more.",
            "default": false
          },
          "includeSubregions": {
            "title": "Include interest by subregion (compare mode)",
            "type": "boolean",
            "description": "Add one record per keyword and country with the interest of each subregion, strongest first, billed as a subregion-set. Values run 0-100 within each country only: they cannot be compared between countries. Countries Google maps only by city (for example Singapore) give no record and cost nothing.",
            "default": false
          },
          "category": {
            "title": "Category (compare mode)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Google Trends category id; 0 means all categories. Narrows the interest, related and subregion results to one category, for example 71 is Food & Drink. Ignored in trending_now mode.",
            "default": 0
          },
          "maxRelatedPerList": {
            "title": "Max related queries per list",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "Cap on entries in each of the top and rising lists of a related-queries record.",
            "default": 25
          },
          "maxItems": {
            "title": "Max billable records for the whole run",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap on billable records (trending items, interest series and related sets together). The default keeps a first run under about US$1.",
            "default": 100
          },
          "proxyConfiguration": {
            "title": "Proxy (optional)",
            "type": "object",
            "description": "Off by default. If Google rate-limits the shared platform IP, switch on Apify Proxy and choose a datacenter group. Residential proxies are refused. Custom proxy URLs are not supported.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}