crawlfetch
Objects

ResolvedVideo

What GET /v1/youtube, /v1/tiktok, /v1/instagram and /v1/resolve return.

Fields#

fieldtypedescription
serviceyoutube | tiktok | instagramWhich service handled the request.
idstringThe platform's own id for the video.
titlestringTitle or caption (may be empty).
channelstringChannel, author or account name (may be empty).
durationSecnumberDuration in seconds (0 when unknown).
thumbnailstring | nullCover image URL from the platform.
bestQualitystringLabel of the format in downloadUrl, e.g. 720p.
formatsMediaFormat[]Every format available to your plan: { id, label, container, kind, sizeMb, url }.
downloadUrlstringDirect link to the video file in CrawlFetch storage. Does not expire after a few hours.
audioUrlstringAudio-only m4a (Starter and up), otherwise empty.
creditsnumberCredits this call cost: platform base + credits per MB of the file, rounded up (also x-credits-charged).
resolvedInMsnumberHow long this call took on our side, in ms (also the x-resolve-ms header). The first resolve of a video includes the download; repeats come from storage.
cachedbooleantrue when the video was already in storage and nothing was downloaded.
sourcestring"storage" for a cached answer, otherwise the downloader that fetched the fresh copy.

MediaFormat#

fieldtypedescription
idstringFormat id, e.g. r2_720p.
labelstringQuality label (720p) or audio.
containermp4 | m4aFile type.
kindvideo | audioWhat the file contains.
sizeMbnumberFile size in MB (0 when not stored yet).
urlstringLink to the stored file, empty when not stored yet.

Headers#

  • x-credits-charged: credits this request cost.
  • x-credits-remaining: your balance after it.
  • x-resolve-ms: time spent on our side.
  • x-grabcast-service: which platform handled the request.

Example#

response.json
200 OK
{
"service": "youtube",
"id": "aqz-KE-bpKQ",
"title": "Big Buck Bunny 60fps 4K - Official Blender Foundation Short Film",
"channel": "Blender",
"durationSec": 635,
"thumbnail": "https://i.ytimg.com/vi/aqz-KE-bpKQ/hqdefault.jpg",
"bestQuality": "720p",
"formats": [
{
"id": "r2_720p",
"label": "720p",
"container": "mp4",
"kind": "video",
"sizeMb": 18.4,
"url": "https://media.crawlfetch.com/grabcast/youtube/aqz-KE-bpKQ/720p.mp4"
}
],
"downloadUrl": "https://media.crawlfetch.com/grabcast/youtube/aqz-KE-bpKQ/720p.mp4",
"audioUrl": "",
"resolvedInMs": 9120
}