crawlfetch
API reference

Get a YouTube video

Videos and Shorts. Returns the tallest rendition your plan allows, plus an audio-only track on Starter and up.

GET/v1/youtube

Send a public YouTube URL and get metadata plus a downloadUrl to a stored copy of the file. The first call for a video downloads and stores it; repeat calls are answered from storage.

Authorization#

Authorizationstring · headerrequired

Bearer token: Bearer <YOUR_API_KEY>. The key needs the resolve scope.

Query parameters#

urlstringrequired

The video page URL, URL-encoded.

formatmp4 | m4aoptional

Container to prefer for downloadUrl. m4a returns the audio track (Starter and up).

res360p … 2160poptional

Quality to prefer for downloadUrl. Falls back to the best your plan allows.

Accepted URLs#

  • https://www.youtube.com/watch?v=<id>
  • https://youtu.be/<id>
  • https://www.youtube.com/shorts/<id>
  • https://www.youtube.com/embed/<id> · /live/<id>

Good to know#

  • Quality ladder: Free up to 720p, Starter 1080p, Pro and Scale up to 2160p (4K) when the video has it. Costs 4 credits + 1.46 per MB of the file, rounded up.
  • Pass res=480p (or any label from /v1/youtube/formats) to prefer a smaller file.
  • Audio-only (m4a) is included from Starter up as audioUrl.

Errors#

400 bad_requestMissing or malformed url, a URL from another platform, or a coming-soon service.
401 unauthorizedMissing, invalid or revoked API key.
403 insufficient_scopeThe key is valid but lacks the scope this endpoint needs (resolve, formats or usage:read).
404 not_foundPrivate, removed or region-locked video, or a post without video.
402 insufficient_creditsYour credit balance cannot cover this call. Buy a top-up or change plan in the dashboard.
429 rate_limitedThe platform is throttling — retry later.
502 upstream_errorThe platform or storage failed for this call. Safe to retry.