{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends API: Trend Data and Breakout Alerts",
    "description": "Google Trends data for any search term or a comparison of up to 5: interest over time, interest by country or sub-region, top and rising related queries and topics, with breakout detection and a scheduled trend-change monitor. API-backed, no blocked runs.",
    "version": "0.1",
    "x-build-id": "KdpMi8AVOsu2lBeuu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/steady-scrape~google-trends-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-steady-scrape-google-trends-api",
        "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/steady-scrape~google-trends-api/runs": {
      "post": {
        "operationId": "runs-sync-steady-scrape-google-trends-api",
        "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/steady-scrape~google-trends-api/run-sync": {
      "post": {
        "operationId": "run-sync-steady-scrape-google-trends-api",
        "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",
        "required": [
          "searchTerms"
        ],
        "properties": {
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "One search term per line. To compare up to 5 terms on the same 0-100 scale (like the Google Trends compare view), put them on one line separated by commas, e.g. <code>iphone, samsung galaxy, google pixel</code>. You pay per term, so a 3-term comparison is 3 terms.",
            "items": {
              "type": "string"
            }
          },
          "dataMode": {
            "title": "Speed and price",
            "enum": [
              "standard",
              "live"
            ],
            "type": "string",
            "description": "<b>Standard</b> is the cheaper option: results come from the data provider's queue, usually within 1-2 minutes (rarely up to 45). <b>Live</b> returns results in seconds and costs more per term. Both return the same data.",
            "default": "standard"
          },
          "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_time"
            ],
            "type": "string",
            "description": "Preset time range. Ignored when you set a start or end date below.",
            "default": "past_12_months"
          },
          "startDate": {
            "title": "Custom start date",
            "type": "string",
            "description": "Optional custom range start (YYYY-MM-DD). Overrides the preset time range. Earliest: 2004-01-01 for web search, 2008-01-01 for other types."
          },
          "endDate": {
            "title": "Custom end date",
            "type": "string",
            "description": "Optional custom range end (YYYY-MM-DD). Defaults to today."
          },
          "region": {
            "title": "Region",
            "type": "string",
            "description": "Leave empty for worldwide. Otherwise a country code (US, GB, DE, IN...), a sub-region code (US-CA, GB-ENG, DE-BY...) or a country/region name.",
            "default": ""
          },
          "searchType": {
            "title": "Google property",
            "enum": [
              "web",
              "news",
              "youtube",
              "images",
              "shopping"
            ],
            "type": "string",
            "description": "Which Google search to measure.",
            "default": "web"
          },
          "category": {
            "title": "Category",
            "type": "string",
            "description": "Optional Google Trends category, by ID or exact name (e.g. 5 or 'Computers & Electronics', 71 or 'Food & Drink', 18 or 'Shopping'). Empty = all categories."
          },
          "includeRegions": {
            "title": "Interest by region",
            "type": "boolean",
            "description": "Add each term's interest by country (worldwide) or by sub-region (when a country is selected). Included in the price.",
            "default": true
          },
          "includeRelated": {
            "title": "Related queries and topics (with breakout detection)",
            "type": "boolean",
            "description": "Add top and rising related queries and topics for each term, and flag Breakout ones (rising more than +5000%). Included in the price.",
            "default": true
          },
          "monitor": {
            "title": "Trend-change monitor",
            "type": "boolean",
            "description": "Turn on for scheduled runs. Each run is compared with the previous run of the same monitor, and every term gets an <code>alert</code> flag with reasons: interest moving more than the threshold, new breakout queries or topics, or the trend changing direction. Run summaries list all alerts.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Use a different name for each schedule you want tracked separately. Letters, digits, dashes.",
            "default": "default"
          },
          "alertThresholdPct": {
            "title": "Alert threshold (%)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Alert when recent interest is up or down at least this much versus the period before it.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}