# How to get video metadata with yt-dlp (without downloading)

Get YouTube video metadata with yt-dlp without downloading: titles, durations, thumbnails, and direct media URLs as JSON — from the CLI or Python.

Often you do not want the file at all — you want the title, duration, thumbnail, uploader, or the list of available formats. yt-dlp can extract all of it without downloading a byte of video, which makes it a surprisingly capable metadata tool for anything it can extract from.

<HostedAnswer>
`yt-dlp -j "URL"` prints the full metadata as JSON without downloading the video, and `--print` returns just the fields you name.
</HostedAnswer>

## Quick answer

```bash
# Full metadata as JSON, no download
yt-dlp -j "URL"

# Just the fields you need
yt-dlp --print "%(title)s | %(duration)s | %(thumbnail)s" "URL"
```

`-j` prints one JSON object per video and skips the download entirely. `--print` is the shortcut when you only need a couple of fields and do not want to parse JSON at all.

## The JSON is huge — these are the fields that matter

A single video's JSON can run to hundreds of kilobytes, most of it format variants. The fields people actually use:

- `title`, `duration` (seconds), `uploader`, `upload_date` (YYYYMMDD)
- `thumbnail` — the best thumbnail URL; `thumbnails` lists every size
- `formats` — every available stream with resolution, codec, and bitrate
- `url` inside each format — the direct media URL for that stream

One caveat that bites everyone: the direct media URLs are signed and expire after a few hours. They are fine for immediate playback or handing to a downloader right away, but useless in a database. Store the metadata and the original page URL; re-extract when you actually need a stream.

## Playlists and channels: use flat extraction

Running `-j` on a playlist resolves every video individually — one network round-trip each, painfully slow on a large channel. If you only need the listing, tell yt-dlp not to resolve entries:

```bash
# Fast: IDs, titles, and URLs for every entry in one request batch
yt-dlp --flat-playlist -J "PLAYLIST_OR_CHANNEL_URL"
```

`-J` (uppercase) wraps the whole playlist in a single JSON object with an `entries` array. The flat entries carry less detail — no formats, sometimes no duration — so the usual pattern is: flat pass to enumerate, then a full `-j` per video only for the ones you care about.

## In Python

The library equivalent is `extract_info` with `download=False`:

```python
from yt_dlp import YoutubeDL

with YoutubeDL() as ydl:
    info = ydl.extract_info(url, download=False)
    data = ydl.sanitize_info(info)  # JSON-safe dict

print(data["title"], data["duration"], data["thumbnail"])
```

`sanitize_info` strips the internal objects so the dict serializes cleanly. For the full library walkthrough — options, error handling, library vs subprocess — see the [Python guide](/guides/yt-dlp-python).

## The mistake to avoid

Do not scrape metadata at scale from a single IP. Rapid-fire extraction requests with no downloads in between is exactly the request pattern YouTube's bot checks are tuned to catch, and the failure mode is the ["Sign in to confirm you're not a bot"](/guides/fix-sign-in-to-confirm-not-a-bot) wall — which blocks metadata extraction just as thoroughly as it blocks downloads. Rate-limit your own crawler before YouTube does it for you. If you need this inside an app, say a preview card when a user pastes a link, [this Node recipe](https://www.importly.io/docs/recipes/video-link-preview-node?utm_source=ytdlp.org&utm_medium=referral&utm_campaign=doc-cta&utm_content=link-preview-recipe&utm_term=%2Fguides%2Fget-video-metadata) gets the title, thumbnail and length from one API call and caches the result. The same route for a Python backend is [the FastAPI recipe](https://www.importly.io/docs/recipes/video-link-preview-python?utm_source=ytdlp.org&utm_medium=referral&utm_campaign=doc-cta&utm_content=link-preview-recipe-python&utm_term=%2Fguides%2Fget-video-metadata).

<DocCta variant="default" />

## Related guides

- [How to use yt-dlp in Python](/guides/yt-dlp-python)
- [How to use yt-dlp as an API](/guides/yt-dlp-api)
- [Batch download videos](/guides/batch-download)
- [Fix "Sign in to confirm you're not a bot"](/guides/fix-sign-in-to-confirm-not-a-bot)