{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube API Alternative & Scraper — Videos, Channels | $1/1k",
    "description": "Scrape YouTube without an API key: keyword search with filters, channel videos, Shorts and live streams, playlists and single videos. Exact views, likes, comment count, duration, upload date, description, hashtags, channel subscribers and channel profiles. $1 per 1,000 results.",
    "version": "0.1",
    "x-build-id": "hRDQEu8WsswHRZcCc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/glasswing~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-glasswing-youtube-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/glasswing~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-glasswing-youtube-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/glasswing~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-glasswing-youtube-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": {
          "startUrls": {
            "title": "YouTube URLs, handles or IDs",
            "uniqueItems": true,
            "type": "array",
            "description": "One per line. Accepted: video links (watch?v=, youtu.be, /shorts/, /live/), channel links (@handle, /channel/UC..., /c/, /user/, optionally ending in /videos, /shorts, /streams or /about), bare @handles, video IDs, channel IDs (UC...), playlist links or IDs (PL...), and youtube.com/results?search_query=... pages. If you call the Actor with search terms only, the built-in example channel is skipped automatically.",
            "default": [
              "https://www.youtube.com/@TED"
            ],
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords to search on YouTube, one per line, exactly as you would type them in the YouTube search box. Each term returns up to 'Max results per search, channel or playlist' rows. A call that sends only search terms does not also scrape the built-in example channel.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Maximum results (total)",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many rows have been saved in total. Each saved row with status `ok` is one billable result. Keep it small for test runs.",
            "default": 20
          },
          "maxResultsPerSource": {
            "title": "Max results per search, channel or playlist",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Cap for each search term, each channel and each playlist. YouTube pages through about 20 results per request.",
            "default": 10
          },
          "includeVideoDetails": {
            "title": "Include video details",
            "type": "boolean",
            "description": "For every video and Short found in a search, channel or playlist, also open the video to add the exact view count, like count, comment count, upload date, full description, hashtags and the channel's subscriber count. One extra request per video; the price per result stays the same.",
            "default": true
          },
          "includeChannelInfo": {
            "title": "Add one channel profile row per channel",
            "type": "boolean",
            "description": "For each channel you give, also save one row with the channel's About data: description, subscribers, total videos, total views, join date, country, the links the creator lists, avatar and banner. The profile row is one result.",
            "default": false
          },
          "channelTab": {
            "title": "Channel tab",
            "enum": [
              "videos",
              "shorts",
              "streams",
              "about"
            ],
            "type": "string",
            "description": "Which list to read from a channel link that does not already end in /videos, /shorts, /streams or /about. 'about' returns only the channel profile row.",
            "default": "videos"
          },
          "channelSort": {
            "title": "Channel sort order",
            "enum": [
              "newest",
              "popular",
              "oldest"
            ],
            "type": "string",
            "description": "Order of a channel's videos, Shorts or streams, the same chips YouTube shows on the channel page.",
            "default": "newest"
          },
          "searchType": {
            "title": "Search result type",
            "enum": [
              "video",
              "shorts",
              "channel",
              "playlist",
              "movie",
              "all"
            ],
            "type": "string",
            "description": "What a search returns. 'all' mixes videos, Shorts, channels and playlists as YouTube shows them.",
            "default": "video"
          },
          "uploadDate": {
            "title": "Upload date",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Only videos uploaded within this period (YouTube's own filter).",
            "default": "any"
          },
          "videoDuration": {
            "title": "Video length",
            "enum": [
              "any",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "YouTube's length filter: under 4 minutes, 4 to 20 minutes, or over 20 minutes.",
            "default": "any"
          },
          "sortBy": {
            "title": "Sort search results by",
            "enum": [
              "relevance",
              "views"
            ],
            "type": "string",
            "description": "Relevance (YouTube's default) or view count.",
            "default": "relevance"
          },
          "query": {
            "title": "Search term (single, optional)",
            "type": "string",
            "description": "Same as one entry in 'Search terms', for callers that send a single string."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy (datacenter, the default group) is on by default: YouTube starts refusing one server's requests after a few hundred video pages in a row, and spreading them over datacenter IPs keeps large runs clean. Residential proxies are not needed. Switch it off for small runs if you prefer.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}