{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper - Interest, Regions, Related & Trending",
    "description": "Get Google Trends data: interest over time for up to 5 compared terms, interest by country, region, city or metro, related queries (top and rising), and trending searches now with news. Retries and switches address when Google rate-limits.",
    "version": "1.0",
    "x-build-id": "YdOdu8bNtrENYlWsy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pipiagent~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pipiagent-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/pipiagent~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-pipiagent-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/pipiagent~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-pipiagent-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",
            "type": "array",
            "description": "One line per search. To compare up to 5 terms on the same 0-100 scale (like the Compare button on Google Trends), put them on one line separated by commas, for example \"coffee, tea\". You can also paste a Google Trends explore URL; its location, dates and category are used for that line.",
            "items": {
              "type": "string"
            }
          },
          "dataTypes": {
            "title": "What data to get",
            "type": "array",
            "description": "Pick any combination. Each search term gives one result per data type. Trending now does not need search terms.",
            "items": {
              "type": "string",
              "enum": [
                "interestOverTime",
                "interestByRegion",
                "relatedQueries",
                "trendingNow"
              ],
              "enumTitles": [
                "Interest over time",
                "Interest by region",
                "Related queries (top and rising)",
                "Trending now (current trending searches per country)"
              ]
            },
            "default": [
              "interestOverTime",
              "relatedQueries"
            ]
          },
          "geos": {
            "title": "Locations",
            "type": "array",
            "description": "Leave empty for worldwide. Otherwise a 2-letter country code (US, GB, DE, JP), a region (US-CA, GB-ENG) or a US metro (US-CA-807). With several locations, every search line runs once per location.",
            "items": {
              "type": "string"
            }
          },
          "timeRange": {
            "title": "Time range",
            "enum": [
              "pastHour",
              "past4Hours",
              "pastDay",
              "past7Days",
              "past30Days",
              "past90Days",
              "past12Months",
              "past5Years",
              "all",
              "custom"
            ],
            "type": "string",
            "description": "Period to look at. Google picks the step size: minutes for the past hour, hours for the past day, days for up to 90 days, weeks for 12 months to 5 years, months for 2004 to now.",
            "default": "past12Months"
          },
          "startDate": {
            "title": "Start date (custom range)",
            "type": "string",
            "description": "Only used when Time range is \"Custom dates\". Format YYYY-MM-DD, not before 2004-01-01."
          },
          "endDate": {
            "title": "End date (custom range)",
            "type": "string",
            "description": "Only used when Time range is \"Custom dates\". Format YYYY-MM-DD. Leave empty for today."
          },
          "category": {
            "title": "Category",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category id to narrow the meaning of a term. 0 = all categories. Common ids: 3 Arts & Entertainment, 47 Autos & Vehicles, 44 Beauty & Fitness, 12 Business & Industrial, 5 Computers & Electronics, 7 Finance, 71 Food & Drink, 8 Games, 45 Health, 11 Home & Garden, 958 Jobs & Education, 16 News, 29 Real Estate, 174 Science, 18 Shopping, 20 Sports, 67 Travel. The id is the cat= number in a Google Trends URL.",
            "default": 0
          },
          "property": {
            "title": "Google search type",
            "enum": [
              "web",
              "images",
              "news",
              "youtube",
              "shopping"
            ],
            "type": "string",
            "description": "Which Google search to measure, like the \"Web search\" menu on Google Trends.",
            "default": "web"
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The run stops after saving this many results (all data types together).",
            "default": 1000
          },
          "regionLevel": {
            "title": "Region level",
            "enum": [
              "auto",
              "city",
              "metro"
            ],
            "type": "string",
            "description": "Interest by region only. Automatic gives countries for worldwide searches and states or provinces for a country. Cities works for most locations. Metro areas (DMA) exist only for the United States.",
            "default": "auto"
          },
          "includeLowVolumeRegions": {
            "title": "Include regions without data",
            "type": "boolean",
            "description": "Also list regions where Google has too little search volume (they get the value 0).",
            "default": false
          },
          "trendingGeos": {
            "title": "Trending now: countries",
            "type": "array",
            "description": "Countries (or regions like US-CA) to get current trending searches for. Defaults to US.",
            "items": {
              "type": "string"
            }
          },
          "trendingHours": {
            "title": "Trending time window",
            "enum": [
              "4",
              "24",
              "48",
              "168"
            ],
            "type": "string",
            "description": "Searches that started trending within this window.",
            "default": "24"
          },
          "maxTrendingPerCountry": {
            "title": "Max trending searches per country",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Google lists up to several hundred trending searches per country for 24 hours.",
            "default": 50
          },
          "trendingSortBy": {
            "title": "Sort trending searches by",
            "enum": [
              "relevance",
              "searchVolume",
              "newest"
            ],
            "type": "string",
            "description": "Relevance is the order Google shows on the Trending now page.",
            "default": "relevance"
          },
          "trendingCategories": {
            "title": "Trending categories",
            "type": "array",
            "description": "Keep only trending searches in these categories. Leave empty for all.",
            "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"
              ]
            }
          },
          "trendingActiveOnly": {
            "title": "Only searches still trending",
            "type": "boolean",
            "description": "Skip searches that Google marks as no longer trending.",
            "default": false
          },
          "includeTrendingNews": {
            "title": "Include news articles",
            "type": "boolean",
            "description": "Add up to 5 news articles (title, link, source, time, picture) that Google shows for each trending search.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. The Actor works without a proxy and switches to Apify's datacenter proxy by itself if Google rate-limits the server. Set a proxy here only if runs keep failing.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}