YouTube 1.0

scraperouter/youtube:1.0

YouTube video scraper: metadata, audio track, and available captions.

https://www.youtube.com/

Request Cost*
-
JS Rendering
No
Speed
Stealth

*Datacenter proxy transfer is included in the request cost. Additional transfer: Residential +$1.00/GB , Mobile +$4.00/GB

Request Options

Common Fields

Field Type Required Default Description
url string required - Target URL to scrape
scraper string required - Scraper identifier
method string optional GET HTTP method (GET or POST)
headers object optional - HTTP headers dict
cookies array[object] optional - List of cookie dicts
data any optional - Request body data for POST requests
proxy string | object optional datacenter Proxy type (datacenter/residential/mobile) or URL or config object
scraper_options object optional - Scraper-specific options (see below)

Scraper-Specific Options (passed via scraper_options)

Field Type Required Default Description
proxy string | object optional -
timeout number optional 60
audio_format string optional bestaudio[ext=m4a]/bestaudio/best
include_captions boolean optional True
caption_format string optional vtt
max_caption_tracks integer optional 25
max_file_mb integer optional 200
max_proxy_attempts integer optional 5

Response Schema

API Response

The API returns a unified response envelope. The content field contains the raw page HTML.

Field Type Description
id string (uuid) Unique request identifier
status_code integer HTTP status code
url string Final response URL
headers object Response HTTP headers
content string Page content (HTML)
scraper string Scraper identifier used

Universal Response (internal)

Internally, all scrapers normalize their output to a universal format before the API response is built.

Field Type
id string
status_code integer
final_url string
headers object
content string
content_encoding string
cookies array | object
errors array[any]
screenshot_url string
scraper_data object
files array[any]
scraperouter ScrapeRouterResponseData

Scraper-Specific Response Fields

The native response from this scraper includes additional fields beyond the universal format.

Field Type Default
status_code integer -
url string -
text string
content string
headers object -
data object -
scraper_data object -
artifacts array[any] -
used_proxy_id string -
error string -

Examples

Simple Request (cURL)

curl -X POST https://www.scraperouter.com/api/v1/scrape/ \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "scraper": "scraperouter/youtube:1.0"}'

Simple Request (Python)

import requests

response = requests.post(
    "https://www.scraperouter.com/api/v1/scrape/",
    headers={"Authorization": "Api-Key YOUR_API_KEY"},
    json={
        "url": "https://example.com",
        "scraper": "scraperouter/youtube:1.0",
    },
)

data = response.json()
print(data["content"][:500])

Advanced Request (Python)

import requests

response = requests.post(
    "https://www.scraperouter.com/api/v1/scrape/",
    headers={"Authorization": "Api-Key YOUR_API_KEY"},
    json={
        "url": "https://example.com",
        "scraper": "scraperouter/youtube:1.0",
        "method": "GET",
        "proxy": "residential",
        "scraper_options": {
            "timeout": 60,
            "audio_format": "bestaudio[ext=m4a]/bestaudio/best",
            "include_captions": true
    },
    },
)

data = response.json()
print(f"Status: {data['status_code']}")
print(f"URL: {data['url']}")
print(data["content"][:500])

Example Response

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status_code": 200,
  "url": "https://example.com",
  "headers": {
    "content-type": "text/html; charset=utf-8"
  },
  "content": "<!DOCTYPE html><html>...</html>",
  "scraper": "scraperouter/youtube:1.0"
}