{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper & API",
    "description": "Get Google Trends data for hundreds of keywords: interest over time, related queries, regions and trending searches, plus real Wikipedia page views. No time-outs; pay only for data delivered.",
    "version": "0.4",
    "x-build-id": "8qV5jZYajxDnvfmRM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/messy_tangerine~google-trends/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-messy_tangerine-google-trends",
        "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/messy_tangerine~google-trends/runs": {
      "post": {
        "operationId": "runs-sync-messy_tangerine-google-trends",
        "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/messy_tangerine~google-trends/run-sync": {
      "post": {
        "operationId": "run-sync-messy_tangerine-google-trends",
        "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",
            "maxItems": 500,
            "type": "array",
            "description": "Search terms or Trends topic IDs to report on, for example [\"coffee\", \"/m/02vqfm\"]. Up to 500 per run. Needed unless you give Trends URLs.",
            "items": {
              "type": "string"
            }
          },
          "trendsUrls": {
            "title": "Trends URLs",
            "type": "array",
            "description": "Google Trends explore URLs to run as they are, for example [\"https://trends.google.com/trends/explore?q=coffee,tea&geo=US\"]. Region, timeframe, search type and category come from each URL; terms in one URL share one scale.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "scale": {
            "title": "Scale",
            "enum": [
              "independent",
              "shared"
            ],
            "type": "string",
            "description": "How values compare across keywords, for example \"shared\" to rank 50 keywords on one scale. Shared scale chains overlapping 5-term comparisons and marks low-precision values.",
            "default": "independent"
          },
          "geo": {
            "title": "Regions",
            "type": "array",
            "description": "Country or subregion codes, each run as its own report, for example [\"US\", \"IN-MH\"]. Leave empty for worldwide.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "timeframe": {
            "title": "Timeframe",
            "enum": [
              "past-hour",
              "past-4-hours",
              "past-day",
              "past-7-days",
              "past-30-days",
              "past-90-days",
              "past-12-months",
              "past-5-years",
              "all",
              "custom"
            ],
            "type": "string",
            "description": "Time range of the report, for example \"past-12-months\". Choose \"custom\" to use startDate and endDate.",
            "default": "past-12-months"
          },
          "startDate": {
            "title": "Start date (custom range)",
            "type": "string",
            "description": "First day of a custom range in YYYY-MM-DD, for example \"2024-01-01\". Used only when timeframe is \"custom\"."
          },
          "endDate": {
            "title": "End date (custom range)",
            "type": "string",
            "description": "Last day of a custom range in YYYY-MM-DD, for example \"2024-03-31\". Used only when timeframe is \"custom\"."
          },
          "searchType": {
            "title": "Search type",
            "enum": [
              "web",
              "images",
              "news",
              "youtube",
              "shopping"
            ],
            "type": "string",
            "description": "Which Google search to measure, the same options as on the Trends page, for example \"youtube\".",
            "default": "web"
          },
          "category": {
            "title": "Category",
            "minimum": 0,
            "type": "integer",
            "description": "Trends category ID to narrow the data, for example 71 for Food & Drink. 0 means all categories.",
            "default": 0
          },
          "sections": {
            "title": "Extra sections",
            "type": "array",
            "description": "Sections to add next to interest over time (always included), for example [\"relatedQueries\", \"regions\"]. Each is billed only when delivered. News needs your own NewsData.io API key in newsApiKey.",
            "items": {
              "type": "string",
              "enum": [
                "relatedQueries",
                "regions",
                "wikipediaPageviews",
                "news",
                "suggestions"
              ],
              "enumTitles": [
                "Related queries (top and rising)",
                "Regions (countries, subregions, metros or cities)",
                "Wikipedia pageviews",
                "News coverage and spike explainer (needs your NewsData.io key)",
                "Autocomplete suggestions"
              ]
            },
            "default": [
              "relatedQueries",
              "wikipediaPageviews"
            ]
          },
          "regionResolution": {
            "title": "Region level",
            "enum": [
              "auto",
              "COUNTRY",
              "REGION",
              "DMA",
              "CITY"
            ],
            "type": "string",
            "description": "Which level the regions section returns, for example \"CITY\" for cities in a country. Automatic picks the level below the region you chose.",
            "default": "auto"
          },
          "suggestionSources": {
            "title": "Suggestion sources",
            "type": "array",
            "description": "Where autocomplete suggestions come from when the suggestions section is on, for example [\"google\", \"youtube\"]. Each source is billed separately.",
            "items": {
              "type": "string",
              "enum": [
                "google",
                "youtube"
              ],
              "enumTitles": [
                "Google search",
                "YouTube"
              ]
            },
            "default": [
              "google"
            ]
          },
          "suggestionsLanguage": {
            "title": "Suggestions language",
            "type": "string",
            "description": "Language for autocomplete suggestions, for example \"hi\" for Hindi.",
            "default": "en"
          },
          "newsApiKey": {
            "title": "NewsData.io API key (for news)",
            "type": "string",
            "description": "Your own key from newsdata.io, needed for the news section and trending news, for example \"pub_123…\". A free key gives the last 48 hours of articles; paid plans add daily news volume and articles for each Trends spike. You pay NewsData directly; the key is never logged or saved in results."
          },
          "rowShape": {
            "title": "Row shape",
            "enum": [
              "keyword",
              "keywordDate"
            ],
            "type": "string",
            "description": "How results are laid out, for example \"keywordDate\" for one flat row per date that opens well in a spreadsheet. keywordDate adds a small date-rows charge per 100 rows.",
            "default": "keyword"
          },
          "wikipediaLanguage": {
            "title": "Wikipedia language",
            "type": "string",
            "description": "Language edition used to match keywords to Wikipedia articles and count pageviews, for example \"de\".",
            "default": "en"
          },
          "trendingCountries": {
            "title": "Trending: countries",
            "type": "array",
            "description": "Countries to list currently trending searches for, for example [\"US\", \"IN\"]. Leave empty to skip trending mode.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "trendingHours": {
            "title": "Trending: window",
            "enum": [
              "4",
              "24",
              "48",
              "168"
            ],
            "type": "string",
            "description": "How far back trending searches go, for example \"24\" for the past day.",
            "default": "24"
          },
          "trendingCategories": {
            "title": "Trending: category IDs",
            "type": "array",
            "description": "Only trends in these categories, for example [17] for Sports (1 Autos, 3 Business, 4 Entertainment, 7 Health, 10 Law and Government, 14 Politics, 17 Sports, 18 Technology). Empty means all.",
            "default": []
          },
          "trendingMaxItems": {
            "title": "Trending: max items per country",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Most trending searches to return per country, biggest first, for example 25. Each item is billed.",
            "default": 25
          },
          "trendingActiveOnly": {
            "title": "Trending: active only",
            "type": "boolean",
            "description": "If true, leave out trends that have already ended, for example true for a live dashboard.",
            "default": false
          },
          "trendingNews": {
            "title": "Trending: news articles (NewsData.io key)",
            "type": "boolean",
            "description": "If true, attach up to 5 recent news articles (with images) per trend from NewsData.io, for example true for a news digest. Needs newsApiKey; a free key works.",
            "default": false
          },
          "proxy": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy settings, for example {\"useApifyProxy\": true} for datacenter IPs, which work well for Google Trends.",
            "default": {
              "useApifyProxy": true
            }
          },
          "allowResidentialFallback": {
            "title": "Allow residential fallback",
            "type": "boolean",
            "description": "If true, new sessions switch to residential proxies after repeated blocks on datacenter IPs, for example false to stay on datacenter only. Google sometimes blocks whole datacenter ranges; the fallback keeps the run working at no extra charge to you.",
            "default": true
          },
          "mode": {
            "title": "Mode (developer)",
            "enum": [
              "keyword",
              "probe",
              "probe-matrix",
              "probe-resolution"
            ],
            "type": "string",
            "description": "Leave as \"keyword\". The probe modes check the Trends endpoints and store status codes in the key-value store.",
            "default": "keyword"
          },
          "debugGroupSize": {
            "title": "Comparison group size (developer)",
            "minimum": 2,
            "maximum": 5,
            "type": "integer",
            "description": "Leave at 5. Smaller values force chaining for accuracy checks, for example 3.",
            "default": 5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}