{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper",
    "description": "Get Google Trends data for up to five compared search terms: interest over time, interest by country, region, city or metro, and top and rising related queries and topics. Any region, time range, category or search type, plus each country's trending searches.",
    "version": "0.1",
    "x-build-id": "mL1JHUobxOhaeXDMl"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/barefoot_grade~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-barefoot_grade-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/barefoot_grade~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-barefoot_grade-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/barefoot_grade~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-barefoot_grade-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. With 'Compare terms' on (the default) up to five terms are compared on one shared 0-100 scale, as on the Google Trends site. A Google Trends topic id such as /m/02vqfm also works.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "compareTerms": {
            "title": "Compare terms",
            "type": "boolean",
            "description": "On: up to five terms share one scale, so their values are directly comparable. Off: each term (up to 100) is looked up on its own and scaled 0-100 by itself.",
            "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."
          },
          "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)."
          },
          "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.",
            "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"
          },
          "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": "Cap on dataset rows: one row per search term, or one row per trending search.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}