{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Trends Scraper: Breakout Keywords & SEO ($0.30/1k)",
    "description": "Extract YouTube search trends, breakout video keywords (+5,000%), viewer geography, and historical YouTube topic demand. Supports bulk keyword lists (up to 100), category filters, and flat JSON or Excel/CSV.",
    "version": "3.2",
    "x-build-id": "FvzHafwRLhPUcdKbb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/unitbytes~youtube-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-unitbytes-youtube-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/unitbytes~youtube-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-unitbytes-youtube-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/unitbytes~youtube-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-unitbytes-youtube-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": {
          "keywords": {
            "title": "YouTube Search Keywords / Topics",
            "type": "array",
            "description": "Enter up to 5 YouTube keywords to compare side-by-side on a shared 0–100 scale, or uncheck 'Compare Keywords' below to bulk-research up to 100 YouTube keywords in one run.",
            "default": [
              "AI Agents",
              "Claude Code"
            ],
            "items": {
              "type": "string"
            }
          },
          "scrape_type": {
            "title": "YouTube Data to Extract",
            "enum": [
              "all",
              "related_queries",
              "interest_over_time",
              "interest_by_region",
              "related_topics"
            ],
            "type": "string",
            "description": "Select 'All-in-One' to extract YouTube search timeline, viewer regions, breakout related queries, and related topics in a single run.",
            "default": "all"
          },
          "compare_keywords": {
            "title": "Compare Keywords on Shared Scale (Up to 5)",
            "type": "boolean",
            "description": "When enabled (default), up to 5 YouTube keywords are compared side-by-side on the same 0–100 scale. Uncheck to bulk-analyze up to 100 YouTube keywords in one run (each scored independently on its own 0–100 scale).",
            "default": true
          },
          "category": {
            "title": "YouTube Niche / Category ID (Optional)",
            "minimum": 0,
            "type": "integer",
            "description": "Filter by category ID (0 = All Categories, 3 = Entertainment & Music, 5 = Tech & Computers, 8 = Gaming, 12 = Business, 20 = Sports, 45 = Health & Fitness, 71 = Food & Cooking, 174 = Science).",
            "default": 0
          },
          "trends_urls": {
            "title": "Google Trends YouTube URLs (Optional)",
            "type": "array",
            "description": "Optionally paste trends.google.com/trends/explore?... URLs directly.",
            "items": {
              "type": "string"
            }
          },
          "predefined_timeframe": {
            "title": "Timeframe",
            "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"
            ],
            "type": "string",
            "description": "Select a preset time window for YouTube search trends.",
            "default": "today 12-m"
          },
          "custom_timeframe": {
            "title": "Custom Date Range (Optional)",
            "type": "string",
            "description": "Format: 'YYYY-MM-DD YYYY-MM-DD' (e.g. '2025-01-01 2025-12-31'). Overrides Predefined Timeframe when filled."
          },
          "common_geo": {
            "title": "Target Country",
            "type": "string",
            "description": "2-letter ISO country code ('US', 'GB', 'CA', 'DE', 'IN', 'BR', etc.), full country name, or 'WORLDWIDE' for global YouTube search volume.",
            "default": "US"
          },
          "custom_geo_code": {
            "title": "Sub-Region / State Code (Optional)",
            "type": "string",
            "description": "Optional state/region code such as 'US-CA' or 'US-NY'.",
            "default": ""
          },
          "geo_resolution": {
            "title": "Geographic Resolution",
            "enum": [
              "COUNTRY",
              "REGION",
              "DMA",
              "CITY"
            ],
            "type": "string",
            "description": "Granularity for 'Viewer Interest by Region'.",
            "default": "COUNTRY"
          },
          "output_format": {
            "title": "Output Format",
            "enum": [
              "flat",
              "legacy"
            ],
            "type": "string",
            "description": "'flat' outputs 1 row per data point (ready for Excel, CSV, Google Sheets, and AI agents). 'legacy' outputs a consolidated nested JSON object.",
            "default": "flat"
          },
          "max_events": {
            "title": "Maximum Results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of trend data points to return (1 to 10,000).",
            "default": 10000
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Apify Residential proxies are automatically managed on Apify Cloud.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "gprop": {
            "title": "Search Property",
            "type": "string",
            "description": "Locked to YouTube Search index by default",
            "default": "youtube"
          },
          "acknowledge_costs": {
            "title": "Acknowledge costs",
            "type": "boolean",
            "description": "Internal flag for backward compatibility",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}