{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper & API: Compare Keywords & Regions",
    "description": "Track keyword search trends: see interest over time with peaks, compare up to 5 keywords or check 100, top regions and cities, rising related queries and Trending Now by country (tendencias de búsqueda).",
    "version": "0.1",
    "x-build-id": "WcHrQdOvbZcS5vVQm"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automatic~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automatic-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/automatic~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-automatic-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/automatic~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-automatic-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": "What to collect",
            "enum": [
              "searchTerms",
              "trending"
            ],
            "type": "string",
            "description": "Search terms: interest and related searches for the terms below. Trending searches: what is trending right now in the countries below.",
            "default": "searchTerms"
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Words or phrases to look up, one per line, such as brand names, products or topics. With Compare terms on, up to five timelines share one 0-100 scale so you can compare them directly. Each term's regional map and related queries have their own scales. A Google Trends topic id such as /m/02vqfm also works. An input without search terms or links returns a sample comparison of coffee and tea (two rows).",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "trendsUrls": {
            "title": "Google Trends links",
            "type": "array",
            "description": "Optional, for Search terms mode. Paste links copied from the Google Trends Explore page (https://trends.google.com/trends/explore?q=...), one per line. Each link is looked up exactly as it is set there: its terms (up to five compared), region, period, category and search type. The settings below apply to typed search terms; the data-to-include switches apply to both. Links that compare several regions or periods are skipped and listed in OUTPUT.skippedSearches.",
            "items": {
              "type": "string"
            }
          },
          "compareTerms": {
            "title": "Compare terms",
            "type": "boolean",
            "description": "On: up to five interest-over-time timelines share one scale. Off: each term (up to 100) has an independent timeline scale. Regional maps and related-query rankings are always normalized separately per term.",
            "default": true
          },
          "geo": {
            "title": "Region",
            "type": "string",
            "description": "Where the searches happened: a country code (US, GB, DE), a sub-region (US-CA, GB-SCT) or a US metro (US-NY-501). Leave empty for worldwide.",
            "default": ""
          },
          "timeRange": {
            "title": "Time range",
            "enum": [
              "past-hour",
              "past-4-hours",
              "past-day",
              "past-7-days",
              "past-30-days",
              "past-90-days",
              "past-12-months",
              "past-5-years",
              "all"
            ],
            "type": "string",
            "description": "The period to cover. Ignored when a start and end date are set below.",
            "default": "past-12-months"
          },
          "startDate": {
            "title": "Custom start date",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Optional custom range start (YYYY-MM-DD, from 2004-01-01). Set together with the end date; leave both empty to use the time range above."
          },
          "endDate": {
            "title": "Custom end date",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Optional custom range end (YYYY-MM-DD, not in the future). Set together with the start date."
          },
          "category": {
            "title": "Category",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Google Trends category id to narrow the searches (0 = all categories). Examples: 71 Food & Drink, 18 Shopping, 958 Jobs, 174 Sports, 7 Finance.",
            "default": 0
          },
          "searchProperty": {
            "title": "Search type",
            "enum": [
              "web",
              "images",
              "news",
              "youtube",
              "shopping"
            ],
            "type": "string",
            "description": "Which Google search the interest is measured on.",
            "default": "web"
          },
          "includeInterestOverTime": {
            "title": "Interest over time",
            "type": "boolean",
            "description": "The 0-100 interest timeline for each term, plus a summary with the peak, latest value, mean and whether interest is rising or falling.",
            "default": true
          },
          "includeInterestByRegion": {
            "title": "Interest by region",
            "type": "boolean",
            "description": "Each term's 0-100 interest per country, region, city or metro.",
            "default": true
          },
          "regionResolution": {
            "title": "Region level",
            "enum": [
              "auto",
              "COUNTRY",
              "REGION",
              "CITY",
              "DMA"
            ],
            "type": "string",
            "description": "Auto: countries for a worldwide search, sub-regions for a country. Countries only work worldwide; metros (DMA) only in the US; cities need a country.",
            "default": "auto"
          },
          "includeLowVolumeRegions": {
            "title": "Include low-volume regions",
            "type": "boolean",
            "description": "Also list regions with too little search volume to score (their value is empty).",
            "default": false
          },
          "includeRelatedQueries": {
            "title": "Related queries",
            "type": "boolean",
            "description": "Top and rising searches related to each term.",
            "default": true
          },
          "includeRelatedTopics": {
            "title": "Related topics",
            "type": "boolean",
            "description": "Top and rising topics related to each term. Google Trends currently returns no related topics for this kind of lookup; while that lasts the section is listed under missingSections and costs nothing extra.",
            "default": false
          },
          "trendingCountries": {
            "title": "Countries",
            "type": "array",
            "description": "Country codes whose trending searches to list (US, GB, IN, BR ...). Some countries also accept a sub-region such as US-CA.",
            "items": {
              "type": "string",
              "minLength": 2
            },
            "default": [
              "US"
            ]
          },
          "trendingTimeWindow": {
            "title": "Trending window",
            "enum": [
              "past-4-hours",
              "past-24-hours",
              "past-48-hours",
              "past-7-days"
            ],
            "type": "string",
            "description": "How far back trending searches are listed.",
            "default": "past-24-hours"
          },
          "trendingActiveOnly": {
            "title": "Only still-trending searches",
            "type": "boolean",
            "description": "Skip searches whose trend has already ended.",
            "default": false
          },
          "trendingSort": {
            "title": "Order",
            "enum": [
              "relevance",
              "searchVolume",
              "newest"
            ],
            "type": "string",
            "description": "Relevance keeps Google's own order; search volume puts the biggest first; newest puts the most recent first.",
            "default": "relevance"
          },
          "trendingCategories": {
            "title": "Only these categories",
            "type": "array",
            "description": "Optional. Keep only trending searches Google files under at least one of these categories, such as Sports or Technology. Leave empty for every category. Ranks are counted after this filter.",
            "items": {
              "type": "string",
              "enum": [
                "Autos and Vehicles",
                "Beauty and Fashion",
                "Business and Finance",
                "Climate",
                "Entertainment",
                "Food and Drink",
                "Games",
                "Health",
                "Hobbies and Leisure",
                "Jobs and Education",
                "Law and Government",
                "Other",
                "Pets and Animals",
                "Politics",
                "Science",
                "Shopping",
                "Sports",
                "Technology",
                "Travel and Transportation"
              ]
            }
          },
          "includeTrendingNews": {
            "title": "Attach news articles",
            "type": "boolean",
            "description": "Add the news articles and picture Google shows for the top trending searches.",
            "default": true
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Global dataset-row cap: one row per search term or trending search. Countries and separate terms run in input order; later subjects may be skipped once full. OUTPUT reports truncation and skipped subjects.",
            "default": 100
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Language for topic names and date labels, such as en-US, de, es or pt-BR.",
            "default": "en-US"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}