{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper: Interest, Regions, Related, Trending Now",
    "description": "Google Trends API alternative. Input keywords or country codes; get interest over time (0-100), by country, region or city, related queries (top, rising) and Trending now searches. Up to 5 keywords per comparison or 50 on one scale. Only-new mode for daily schedules. 429 retries built in.",
    "version": "0.1",
    "x-build-id": "fuviIk2rRp6REFj0L"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ctriolab~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ctriolab-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/ctriolab~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-ctriolab-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/ctriolab~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-ctriolab-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 (one comparison per line)",
            "type": "array",
            "description": "Each line is one Google Trends comparison: terms separated by commas are compared on the same 0-100 scale, e.g. \"coffee, tea, matcha\". Google allows 5 terms per comparison; with 6 to 50 terms on a line the Actor splits them into groups that share an anchor term and puts all of them on one scale (interest over time only). Use one term per line to get each term on its own scale. If searchTerms is omitted in API input, \"coffee, tea\" is used; send an empty list [] for a Trending now only run.",
            "items": {
              "type": "string"
            }
          },
          "anchorTerm": {
            "title": "Anchor term (lines with more than 5 terms)",
            "type": "string",
            "description": "Used only for lines with more than 5 terms. This term is added to every group of 4 terms so the groups can be matched to one 0-100 scale. Empty = the first term of the line. Pick a steady term of medium popularity; it does not have to be on the line (then it is not returned)."
          },
          "geo": {
            "title": "Location (geo code)",
            "type": "string",
            "description": "Country or subregion code as used by Google Trends: US, GB, DE, KR, JP, US-CA, GB-ENG ... Leave empty for worldwide. If omitted in API input, US is used."
          },
          "timeframe": {
            "title": "Time range",
            "enum": [
              "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",
              "custom"
            ],
            "type": "string",
            "description": "Default today 12-m (past 12 months). Google picks the data resolution from the range: minutes or hours for short ranges, days up to 9 months, weeks up to 5 years, months beyond.",
            "default": "today 12-m"
          },
          "customTimeRange": {
            "title": "Custom range",
            "type": "string",
            "description": "Used only when Time range is Custom. Format \"YYYY-MM-DD YYYY-MM-DD\", e.g. \"2024-01-01 2024-12-31\". Hourly: \"2024-01-01T10 2024-01-07T22\" (max 7 days)."
          },
          "categoryId": {
            "title": "Category ID",
            "type": "string",
            "description": "Google Trends category ID. Empty or 0 = all categories. In API input you can also send it as category (number or string). Examples: 7 Finance, 12 Business & Industrial, 18 Shopping, 44 Beauty & Fitness, 45 Health, 71 Food & Drink, 958 Jobs, 5 Computers & Electronics."
          },
          "gprop": {
            "title": "Search type",
            "enum": [
              "web",
              "images",
              "news",
              "youtube",
              "froogle"
            ],
            "type": "string",
            "description": "Which Google property to measure: web (default), images, news, youtube or froogle (Google Shopping).",
            "default": "web"
          },
          "includeInterestOverTime": {
            "title": "Interest over time",
            "type": "boolean",
            "description": "Timeline of relative interest for each term, saved as type interest_over_time. Values go from 0 to 100, where 100 is the highest point within the comparison; they are not absolute search volumes. On by default.",
            "default": true
          },
          "includeInterestByRegion": {
            "title": "Interest by region",
            "type": "boolean",
            "description": "Relative interest (0-100) per country, region or city for each term, saved as type interest_by_region. Off by default.",
            "default": false
          },
          "regionResolution": {
            "title": "Region level",
            "enum": [
              "auto",
              "COUNTRY",
              "REGION",
              "CITY",
              "DMA"
            ],
            "type": "string",
            "description": "Level of detail for Interest by region. auto (default) returns countries for worldwide, regions for a country code such as US and cities for a subregion code such as US-CA.",
            "default": "auto"
          },
          "includeLowVolumeRegions": {
            "title": "Include low search volume regions",
            "type": "boolean",
            "description": "Same as the checkbox on the Google Trends website.",
            "default": false
          },
          "includeRelatedQueries": {
            "title": "Related queries (top and rising)",
            "type": "boolean",
            "description": "Queries people also searched for, per term, saved as type related_queries: top (most searched, value 0-100) and rising (fastest growing, value is the percentage increase; formattedValue shows Breakout for very large increases). Off by default.",
            "default": false
          },
          "includeRelatedTopics": {
            "title": "Related topics (beta)",
            "type": "boolean",
            "description": "Topics people also searched for, per term. Beta: Google currently hides related topics from most automated clients, so this list is often empty. Empty results are not saved and not charged.",
            "default": false
          },
          "trendingNowCountries": {
            "title": "Trending now: countries",
            "type": "array",
            "description": "Country codes for the Google Trends 'Trending now' list (what is spiking in search right now), e.g. US, GB, KR, JP, IN, ID. Each trend is saved as type trending_now with title, searchVolume, increasePercentage, startedAt, categories and relatedQueries. Can be used with or without search terms. Empty by default.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "trendingNowHours": {
            "title": "Trending now: time window",
            "enum": [
              "4",
              "24",
              "48",
              "168"
            ],
            "type": "string",
            "description": "Trends that started within this window, in hours: 4, 24 (default), 48 or 168 (7 days).",
            "default": "24"
          },
          "maxTrendingPerCountry": {
            "title": "Trending now: max trends per country",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum trends saved per country. 0 (default) means all, usually 50 to 500 depending on country and window.",
            "default": 0
          },
          "onlyNewResults": {
            "title": "Only new results (for daily schedules)",
            "type": "boolean",
            "description": "Off by default. When on, the Actor remembers what earlier runs returned, per monitor name, in the named key-value store google-trends-state. Trending now: only trends whose title was not returned before for that country. Related queries: the rising list keeps only queries not returned before for the same term, location, time range, category and search type; the top list stays complete. Interest over time and by region are not filtered. The first run returns everything; a later run with nothing new succeeds and saves no results. Saved trends get isNew: true.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name for Only new results",
            "type": "string",
            "description": "Name of the memory used by Only new results, e.g. indonesia-daily or brand-watch. Use a different name for each schedule or project so their memories do not mix. Letters, numbers and hyphens; other characters become hyphens. Default: default.",
            "default": "default"
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "item-per-term",
              "row-per-point",
              "official"
            ],
            "type": "string",
            "description": "item-per-term (default) returns one result per term and data type. row-per-point returns one flat row per date, region or related query, which is easier in Google Sheets or Excel but produces more results. official returns the field names of apify/google-trends-scraper; it is the default when the input uses that Actor's format."
          },
          "language": {
            "title": "Language (hl)",
            "type": "string",
            "description": "Language for formatted dates, topic names and Trending now, e.g. en-US (default), de, ko, ja, id.",
            "default": "en-US"
          },
          "timezoneOffset": {
            "title": "Time zone offset (minutes)",
            "type": "integer",
            "description": "Same as Google's tz parameter: minutes behind UTC. 0 = UTC, 300 = New York (EST), -540 = Seoul.",
            "default": 0
          },
          "maxRetries": {
            "title": "Max retries per request",
            "minimum": 0,
            "maximum": 15,
            "type": "integer",
            "description": "On rate limits (HTTP 429) the actor rotates the session and proxy IP and waits with exponential backoff.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Google Trends rate-limits datacenter IPs. The default works for most runs.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}