{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper",
    "description": "Compare unlimited keywords on one Google Trends scale, not just five. Get interest over time with ready-made analysis (trend, change %, YoY, rank, share, peak, seasonality), interest by region down to city level, related searches with breakouts, and trending searches with volume and news.",
    "version": "1.0",
    "x-build-id": "yjfmrP00mo2BxQh1l"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/measured_mountainpass~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-measured_mountainpass-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/measured_mountainpass~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-measured_mountainpass-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/measured_mountainpass~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-measured_mountainpass-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": {
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Search terms to look up, one per line. Add as many as you like: all of them are put on one shared 0 to 100 scale, so you can rank 50 brands or 200 product ideas against each other. Google Trends itself stops at five. Leave empty if you only want trending searches.",
            "items": {
              "type": "string"
            }
          },
          "geo": {
            "title": "Locations",
            "type": "array",
            "description": "Where to measure interest, one per line. Use a country name or code (United States, US, Germany, DE), a region code (US-CA, GB-ENG) or worldwide. Every location gets its own full set of results, so three locations cost three times as much as one. Leave empty for worldwide.",
            "items": {
              "type": "string"
            }
          },
          "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_time"
            ],
            "type": "string",
            "description": "How far back to look. Longer ranges give coarser points: the past 7 days is hourly, 12 months is weekly, 5 years and all time are monthly. Year-over-year change and seasonality need more than one year, so pick 5 years for those.",
            "default": "past_12_months"
          },
          "startDate": {
            "title": "Custom start date",
            "type": "string",
            "description": "Optional. Set this to use your own date range instead of the time range above."
          },
          "endDate": {
            "title": "Custom end date",
            "type": "string",
            "description": "Optional. Only used together with a custom start date. Leave empty for today."
          },
          "searchType": {
            "title": "Search type",
            "enum": [
              "web",
              "images",
              "news",
              "youtube",
              "shopping"
            ],
            "type": "string",
            "description": "Which Google search to measure. YouTube shows video demand, Shopping shows buying intent.",
            "default": "web"
          },
          "category": {
            "title": "Category number",
            "minimum": 0,
            "type": "integer",
            "description": "Optional Google Trends category number to narrow an ambiguous keyword (for example 71 for Food and Drink so that apple means the fruit). 0 means all categories. The number is the cat= value in a Google Trends link.",
            "default": 0
          },
          "compareOnOneScale": {
            "title": "Put all keywords on one scale",
            "type": "boolean",
            "description": "On: every keyword is measured against the others, so values, rank and share of interest are comparable across the whole list. Off: each keyword gets its own 0 to 100 scale, like looking it up alone.",
            "default": true
          },
          "preciseValues": {
            "title": "Precise values for small keywords",
            "type": "boolean",
            "description": "On: small keywords keep a detailed curve even next to a giant, instead of Google's rounded 0, 1, 2 values. Uses one extra lookup per keyword. Turn off for the fastest possible run.",
            "default": true
          },
          "includeRegions": {
            "title": "Interest by region",
            "type": "boolean",
            "description": "Adds a ranked list of regions for every keyword. With two to five keywords you also get a region-by-region comparison showing which keyword leads where.",
            "default": false
          },
          "regionLevel": {
            "title": "Region detail",
            "enum": [
              "auto",
              "country",
              "region",
              "city",
              "metro"
            ],
            "type": "string",
            "description": "How fine the region list should be. Automatic gives countries for worldwide and states or provinces for a country. Metro areas exist for the United States only.",
            "default": "auto"
          },
          "includeRelatedQueries": {
            "title": "Related searches",
            "type": "boolean",
            "description": "Adds the top related searches and the fastest rising ones for every keyword, with growth in percent and a breakout flag for searches that grew more than 5,000%.",
            "default": false
          },
          "trendingCountries": {
            "title": "Countries for trending searches",
            "type": "array",
            "description": "Optional. Add country names or codes (US, Germany, JP) to get what people are searching for right now, with search volume, growth, start time, related searches, category and news. Works with or without keywords.",
            "items": {
              "type": "string"
            }
          },
          "trendingHours": {
            "title": "Trending in the past",
            "enum": [
              "4",
              "24",
              "48",
              "168"
            ],
            "type": "string",
            "description": "Time window for trending searches.",
            "default": "24"
          },
          "trendingCategory": {
            "title": "Trending category",
            "enum": [
              "0",
              "1",
              "2",
              "3",
              "20",
              "4",
              "5",
              "6",
              "7",
              "8",
              "9",
              "10",
              "11",
              "13",
              "14",
              "15",
              "16",
              "17",
              "18",
              "19"
            ],
            "type": "string",
            "description": "Only trending searches from this category.",
            "default": "0"
          },
          "trendingSort": {
            "title": "Sort trending searches by",
            "enum": [
              "google",
              "searchVolume",
              "newest",
              "growth"
            ],
            "type": "string",
            "description": "Order of the trending list before the limit below is applied.",
            "default": "google"
          },
          "trendingActiveOnly": {
            "title": "Only searches still trending",
            "type": "boolean",
            "description": "Skip searches whose spike has already ended.",
            "default": false
          },
          "maxTrendingPerCountry": {
            "title": "Max trending searches per country",
            "minimum": 0,
            "type": "integer",
            "description": "Google lists up to several hundred per country. Use 0 for all of them.",
            "default": 100
          },
          "includeTrendingNews": {
            "title": "Add news articles",
            "type": "boolean",
            "description": "Adds current news headlines with link, source and publication time to every trending search, so you can see why it is trending.",
            "default": true
          },
          "trendingNewsPerSearch": {
            "title": "News articles per trending search",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many headlines to attach to each trending search.",
            "default": 3
          },
          "outputFormat": {
            "title": "Output layout",
            "enum": [
              "nested",
              "flat"
            ],
            "type": "string",
            "description": "Nested: one row per keyword with the whole timeline inside it. Best for apps, JSON and AI agents. Flat: one row per date, region or related search. Best for Excel, Google Sheets and BI tools.",
            "default": "nested"
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Language for region names and related searches, as a code such as en-US, de, fr or ja.",
            "default": "en-US"
          },
          "maxConcurrency": {
            "title": "Parallel lookups",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many lookups run at the same time. The default is a safe speed; higher is faster but makes Google more likely to slow you down.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Leave as is. The Actor connects directly first (fastest and free) and switches to Apify datacenter proxy, then residential proxy, only if Google starts refusing requests. Pick specific proxy groups or your own proxies to force all lookups through them.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}