YouTube Metadata API: Title, Duration and Availability Before You Download (2026)

Get a YouTube video's title, duration, audio languages and region restrictions with one API call, before you download anything. Python and Node examples, what each field is for, and how to check a video will download before you queue it.

Vid Kraken · Updated October 27, 2026

A user pastes a YouTube link into your app. Before you spend bandwidth and time downloading it, you want to show them what they're about to import: the title, how long it is, whether it's in their language, and whether it will download at all.

That's a metadata lookup, and it shouldn't need a full download or a YouTube Data API project with its own quota.

Short version: call POST /info with the video URL. You get back the title, the duration in seconds and, when the video is region-locked, the countries where it plays. Add includeAudioTracks: true to also list its audio languages. Metadata lookups use no bandwidth, and failures aren't charged. If you're going to download anyway, POST /download returns the title and duration in its first response, before the file is ready.

What the metadata endpoint returns

{
  "jobId": "6f9c1234-5e8a-4b2f-9c1e-0a7b69cfc45e",
  "status": "success",
  "result": {
    "title": "Rick Astley - Never Gonna Give You Up",
    "duration": 213,
    "url": "https://youtu.be/dQw4w9WgXcQ"
  }
}
FieldWhat it isWhat to use it for
titleThe video title as YouTube reports itShow it in your import dialog, name the saved file
durationLength in secondsReject videos over your limit, estimate file size and processing time, validate trim points
urlThe video URL you asked aboutMatch results to requests in a batch
regionRestrictionPresent only when the video is region-locked: allowed (plays only in these countries) or blocked (plays everywhere except these), as ISO country codesWarn the user before they wait for a download that can't succeed
audioOnly with includeAudioTracks: true: each audio track, original or dubbed, with its languageLet the user pick a language before downloading

Get a video's metadata

The call is a short job: submit it, then read the result a moment later.

# 1. Submit
curl -X POST https://vidkraken.com/api/v2/info \
-H "Authorization: Bearer $VIDKRAKEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://youtu.be/dQw4w9WgXcQ"}'
# {"jobId": "6f9c1234-...", "status": "pending"}

# 2. Read the result
curl https://vidkraken.com/api/v2/info/6f9c1234-... \
-H "Authorization: Bearer $VIDKRAKEN_API_KEY"

Results are kept for an hour after you submit, so read them within that window. Accepted URL shapes are youtube.com/watch?v=, youtu.be/ and youtube.com/live/.

Check a video will download before you queue it

Most failed imports can be caught at the metadata step, before the user waits on anything:

MAX_SECONDS = 2 * 60 * 60  # your own limit
DOWNLOADABLE_FROM = {"US", "DE", "GB"}  # example

def check(url):
    try:
        info = video_info(url)
    except RuntimeError as e:
        # VIDEO_NOT_FOUND, PRIVATE_VIDEO, AGE_RESTRICTED, ...
        return f"Can't import this video: {e}"

    if info["duration"] > MAX_SECONDS:
        return "This video is longer than 2 hours."

    region = info.get("regionRestriction")
    if region and "allowed" in region and not DOWNLOADABLE_FROM & set(region["allowed"]):
        return "This video is region-locked."

    return None  # good to go

A failed lookup carries the same errorCode values as a failed download, such as VIDEO_NOT_FOUND, PRIVATE_VIDEO or LIVE_STREAM_IN_PROGRESS. The error codes guide lists every one with a message you can show your users.

You don't need to check which resolutions a video has. Ask for the quality you want, for example 1080. If the video doesn't go that high, you get the best quality below it, and the finished download's actualFormat tells you what was delivered.

Metadata and a download in one step

If you're going to download the video anyway, skip the separate lookup. POST /download returns the title and duration in its first response, while the file is still being prepared:

{
  "jobId": "69cfc45e8a3b4d2f9c1e0a7b",
  "title": "Rick Astley - Never Gonna Give You Up",
  "duration": 213,
  "status": "IN_QUEUE"
}

Show the title in your UI straight away, then deliver the file when the job finishes. The completed job adds downloadUrl and fileSize. See the YouTube download API guide for the full flow.

Common uses

  • Import previews. Show the title and length as soon as a user pastes a link.
  • Limits and pricing. Refuse or price videos by duration before anything is downloaded.
  • Language pickers. List dubbed audio tracks and let the user choose. See multi-language audio tracks.
  • AI and media pipelines. Filter a batch of URLs by length and availability before spending bandwidth on them.
  • Trimming. Validate startTime and endTime against the real duration before you request a clip.

What it doesn't return

/info is built to answer "should I download this?" quickly. It doesn't return view counts, likes, descriptions, tags or channel statistics. For those, use the official YouTube Data API, which is free within its daily quota and has those fields. It can't download videos, though. Here's why.

For a thumbnail, YouTube serves one at a predictable address: https://i.ytimg.com/vi/VIDEO_ID/hqdefault.jpg.

Cost

A metadata lookup counts against your plan's info quota only when it succeeds, and uses no bandwidth. Plans include far more lookups than downloads, so in practice bandwidth runs out first. Reading results is free, and so are failures. See pricing.

Try Vid Kraken

Paste a YouTube URL and get a direct download link.

Paste a link. See it work.

Paste a YouTube link, pick a format, and hit download.

Know what you're importing before you download it.

Title, duration, audio languages and region restrictions from one call. No YouTube Data API project, no quota juggling, and failed lookups are free.

Start free

Frequently asked questions

Is there an API that returns a YouTube video's title and duration?+

Yes. Vid Kraken's POST /info returns the title and the duration in seconds for any public YouTube video, plus region restrictions when the video is region-locked. It uses no bandwidth and failures aren't charged. The official YouTube Data API also returns these fields, but it needs a Google Cloud project and can't download the video.

Can I get video metadata and a download link from the same API?+

Yes. POST /download returns the title and duration in its first response, before the file is ready, and the finished job adds a direct CDN download link and the file size. If you only need metadata, POST /info returns it without downloading anything.

How do I check if a YouTube video can be downloaded before downloading it?+

Call POST /info first. A video that can't be downloaded returns a machine-readable errorCode such as VIDEO_NOT_FOUND, PRIVATE_VIDEO or LIVE_STREAM_IN_PROGRESS, and a region-locked video lists the countries where it plays in regionRestriction.

Do I need to list the available formats before downloading?+

No. Ask for the quality you want, such as 1080, 720 or audio-mp3. If the video doesn't offer that resolution you get the best one below it, and actualFormat on the completed job reports what was delivered.

How do I list the audio languages of a YouTube video?+

Call POST /info with includeAudioTracks set to true. The result's audio array lists every track with type original or dubbed and its language code. Then pass language on POST /download to get that track.

Does the YouTube metadata API cost anything?+

Each successful lookup counts once against your plan's info quota and uses no bandwidth. Reading results is free and failed lookups aren't charged. Plans start free with no credit card.