{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends",
    "description": "Google Trends for any keyword — interest over time, top and rising related searches, interest by region — and the top and rising searches of any of Google's 928 categories, in any country or region, over any time range.",
    "version": "0.1",
    "x-build-id": "7u3KQkk65O7bFM1DI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/autofacts~google-trends/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-autofacts-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/autofacts~google-trends/runs": {
      "post": {
        "operationId": "runs-sync-autofacts-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/autofacts~google-trends/run-sync": {
      "post": {
        "operationId": "run-sync-autofacts-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",
            "type": "array",
            "description": "Searches to look up, each on its own, in every place and time range below: its interest over time, its top and rising related searches, and where it is searched most.",
            "items": {
              "type": "string"
            }
          },
          "keywordCategory": {
            "title": "Category for keywords",
            "type": "string",
            "description": "Look the keywords up within one category, to tell one meaning from another: jaguar the car in Autos & Vehicles. Its id, name or path, such as 47, Autos & Vehicles or Shopping > Apparel. Empty: all categories."
          },
          "categories": {
            "title": "Categories to rank",
            "type": "array",
            "description": "The categories whose top and rising searches to read, with no keyword: an id, a name or a path, such as 18, Shopping or Shopping > Apparel, down to the third level of Google's category tree; 0 for all categories together.",
            "items": {
              "type": "string"
            }
          },
          "subcategories": {
            "title": "Include subcategories",
            "type": "boolean",
            "description": "Rank each category's subcategories too, down to the third level.",
            "default": false
          },
          "allCategories": {
            "title": "Every category",
            "type": "boolean",
            "description": "Rank all 928 categories down to the third level, and all categories together, whatever Categories to rank says. That is 929 rankings for each place and time range, about an hour and a half: give the run a timeout of two hours or more.",
            "default": false
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Where to look: a two-letter country code (US, GB, DE …), a region inside a country (US-CA, GB-SCT), or Worldwide. Each keyword and each category is read for every place.",
            "default": [
              "US"
            ],
            "items": {
              "type": "string"
            }
          },
          "windows": {
            "title": "Time ranges",
            "type": "array",
            "description": "How far back to look, each range read on its own. Category rankings exist only over the past 7 days, 30 days, 90 days and 12 months.",
            "items": {
              "type": "string",
              "enum": [
                "1h",
                "4h",
                "24h",
                "7d",
                "30d",
                "90d",
                "12m",
                "5y",
                "all"
              ],
              "enumTitles": [
                "Past hour",
                "Past 4 hours",
                "Past 24 hours",
                "Past 7 days",
                "Past 30 days",
                "Past 90 days",
                "Past 12 months",
                "Past 5 years",
                "2004 – present"
              ]
            },
            "default": [
              "12m"
            ]
          },
          "maxItemsPerList": {
            "title": "Maximum searches per ranking",
            "minimum": 0,
            "type": "integer",
            "description": "At most this many searches from each top or rising list, the first ones first. 0 keeps all that Google gives.",
            "default": 0
          },
          "maxItems": {
            "title": "Maximum results in total",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many results in the whole run: lookups and ranked searches together. 0 means no limit.",
            "default": 0
          },
          "proxy": {
            "title": "Proxy",
            "type": "object",
            "description": "Used for every request. Apify's residential proxies by default: Google refuses keyword and category requests from datacenter addresses more often. A refused request is sent again from another address, and what is still refused is tried once more at the end of the run.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}