POST /metadata returns that list for any link, so you can show a user the choices, or let an agent pick, and only then import the one you want. A metadata call is $0.003 and never downloads the media; you pay the download price only when you call POST /import. The same recipe in Python is Options and cost in Python.
The code
options.mjs
What comes back
The finished metadata job has adownloadOptions object with a video list and an audio list. Each row is one file you could import:
- Send a row’s
videoQualitytoPOST /importto get that file, or itsaudioQualitywithincludeVideo: falsefor audio only. estimatedCostis the price you’d pay for that import, in dollars. It’snullwhen the source gives no size, so guard for it before sorting or displaying.- Rows that return the same file are folded into one: the others are listed in
alsoMatches, anddefault: truemarks what you get if you import without naming a quality. So a video that tops out at 1080p lists it once with1440p,2160pandbestbeside it. h264: falsemeans the file won’t play in Safari, on iOS or in QuickTime as is. SendcompatibleCodecs: truewith the import to get an H.264 version where the source has one (usually a larger file, so the cost goes up).videois empty for audio-only sources such as podcasts, anddownloadOptionsis absent for a live stream that hasn’t ended.
Errors to handle
Every error has a
documentationUrl with the fix. See Error handling.
Listing the options costs $0.003 per link, and status checks are free. You pay the download price only when you import. Try it free, no card required. See Pricing & credits.