# YouTube Download API. Send a video link or ID.

> Setting SocialTap up for your user? Follow https://socialtap.dev/setup.md.

MP4 and audio files of shorts and videos. We handle the proxies, blocks and platform changes.

[Get API key](https://socialtap.dev/signup/?next=%2Fdashboard%2Fplayground%2F%3Fendpoint%3Dyoutube.download)

[In your agent: **YouTube MCP server** →](https://socialtap.dev/mcp/youtube/index.md)

## YouTube Download API at a glance

Returns direct download links for a public YouTube short, video or live replay, from its link or video ID. You get an MP4 with sound, the sharpest video stream and the audio streams, each with its size, resolution, codec and link expiry. The title, channel and publish time come too, and every link is checked to download whole.

GET `/v1/youtube/download`

[Read the API reference](https://socialtap.dev/docs/reference/youtube/download/index.md)

- **1 credit** per request, $0.75–$1.97 per 1,000 requests
- **14 typed fields** null when unknown
- **`url`** is all it needs, e.g. `https://www.youtube.com/shorts/3cWm9B_0_kI`
- **100 credits** free when you sign up, no card, so you can build before you spend

## Send one request. Get 14 fields back.

Copy the request in your language, or hand it to your agent. Sign up for an API key and your first 100 credits are free.

`$ npm install socialtap`

`url = https://www.youtube.com/shorts/3cWm9B_0_kI`

[Open in playground](https://socialtap.dev/playground/?endpoint=youtube.download)

cURL:

```shell
curl -G 'https://socialtap.dev/v1/youtube/download' \
  --data-urlencode 'url=https://youtube.com/shorts/3cWm9B_0_kI?feature=share' \
  -H "x-api-key: $SOCIALTAP_API_KEY"
```

TypeScript SDK:

```typescript
// Save this as app.mjs (an ES module) and run: node app.mjs
import { SocialTap } from "socialtap";

const client = new SocialTap(); // apiKey defaults to process.env.SOCIALTAP_API_KEY

const res = await client.youtube.download.get({ url: "https://youtube.com/shorts/3cWm9B_0_kI?feature=share" });
console.log(res.data);
console.log(res.credits.charged, res.meta.request_id);
```

Python SDK:

```python
from socialtap import SocialTap

client = SocialTap()  # api_key defaults to os.environ["SOCIALTAP_API_KEY"]

res = client.youtube.download.get(url="https://youtube.com/shorts/3cWm9B_0_kI?feature=share")
print(res.data)
print(res.credits.charged, res.meta.request_id)
```

Go SDK:

```go
package main

import (
	"context"
	"fmt"
	"log"

	socialtap "socialtap.dev/sdk/go"
)

func main() {
	ctx := context.Background()
	client, err := socialtap.NewClient() // the API key defaults to $SOCIALTAP_API_KEY
	if err != nil {
		log.Fatal(err)
	}
	res, err := client.YouTube.Download.Get(ctx, socialtap.YouTubeDownloadParams{URL: "https://youtube.com/shorts/3cWm9B_0_kI?feature=share"})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(res.Data)
	fmt.Println(res.Credits.Charged, res.Meta.RequestID)
}
```

200 OK:

```json
{
  "data": {
    "approximate_fields": [
      "duration_ms"
    ],
    "author": {
      "avatar_url": null,
      "display_name": "MrBeast",
      "id": "UCX6OQ3DkcsbYNE6H8uQQuVA",
      "is_verified": null,
      "url": "https://www.youtube.com/@MrBeast",
      "username": "MrBeast"
    },
    "duration_ms": 20000,
    "files": [
      {
        "audio_codec": "aac",
        "bitrate_kbps": 599,
        "duration_ms": 20373,
        "expires_at": "2026-10-25T18:00:00Z",
        "frame_rate": 30,
        "height": 640,
        "is_video_only": false,
        "is_watermarked": false,
        "item_index": 0,
        "mime_type": "video/mp4",
        "size_bytes": 1524730,
        "thumbnail_url": "https://i.ytimg.com/vi/3cWm9B_0_kI/maxresdefault.jpg?sqp=-oaymwEoCIAKENAF8quKqQMcGADwAQH4AbYIgAKAD4oCDAgAEAEYRiBlKA8wDw==&rs=AOn4CLD2HeSN5ZikYi7hBi3SC7913d9CWQ",
        "type": "video",
        "url": "https://rr1---sn-5uaeznl6.googlevideo.com/videoplayback?expire=4070908800&ei=SCRUBBED&ip=SCRUBBED&id=o-ALDE28Kd84LMiA6qbyxb4sLJqdFSNsHDVBW6UxlMiRut&itag=18&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&cps=712&met=1795987967%2C&mh=1U&mm=18%2C29&mn=sn-5uaeznl6%2Csn-aj5ua5-5c&…",
        "video_codec": "h264",
        "width": 360
      },
      {
        "audio_codec": null,
        "bitrate_kbps": 17570,
        "duration_ms": 20333,
        "expires_at": "2026-10-25T18:00:00Z",
        "frame_rate": 30,
        "height": 3840,
        "is_video_only": true,
        "is_watermarked": false,
        "item_index": 0,
        "mime_type": "video/webm",
        "size_bytes": 44656666,
        "thumbnail_url": "https://i.ytimg.com/vi/3cWm9B_0_kI/maxresdefault.jpg?sqp=-oaymwEoCIAKENAF8quKqQMcGADwAQH4AbYIgAKAD4oCDAgAEAEYRiBlKA8wDw==&rs=AOn4CLD2HeSN5ZikYi7hBi3SC7913d9CWQ",
        "type": "video",
        "url": "https://rr1---sn-5uaeznl6.googlevideo.com/videoplayback?expire=4070908800&ei=SCRUBBED&ip=SCRUBBED&id=o-ALDE28Kd84LMiA6qbyxb4sLJqdFSNsHDVBW6UxlMiRut&itag=313&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&cps=712&met=1795987967%2C&mh=1U&mm=18%2C29&mn=sn-5uaeznl6%2Csn-aj5ua5-5c…",
        "video_codec": "vp9",
        "width": 2160
      },
      {
        "audio_codec": null,
        "bitrate_kbps": 4308,
        "duration_ms": 20333,
        "expires_at": "2026-10-25T18:00:00Z",
        "frame_rate": 30,
        "height": 1920,
        "is_video_only": true,
        "is_watermarked": false,
        "item_index": 0,
        "mime_type": "video/mp4",
        "size_bytes": 10949332,
        "thumbnail_url": "https://i.ytimg.com/vi/3cWm9B_0_kI/maxresdefault.jpg?sqp=-oaymwEoCIAKENAF8quKqQMcGADwAQH4AbYIgAKAD4oCDAgAEAEYRiBlKA8wDw==&rs=AOn4CLD2HeSN5ZikYi7hBi3SC7913d9CWQ",
        "type": "video",
        "url": "https://rr1---sn-5uaeznl6.googlevideo.com/videoplayback?expire=4070908800&ei=SCRUBBED&ip=SCRUBBED&id=o-ALDE28Kd84LMiA6qbyxb4sLJqdFSNsHDVBW6UxlMiRut&itag=137&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&cps=712&met=1795987967%2C&mh=1U&mm=18%2C29&mn=sn-5uaeznl6%2Csn-aj5ua5-5c…",
        "video_codec": "h264",
        "width": 1080
      }
    ],
    "id": "3cWm9B_0_kI",
    "platform": "youtube",
    "platform_specific": {},
    "platform_type": "short",
    "published_at": "2024-12-27T19:00:00Z",
    "text": null,
    "thumbnail_url": "https://i.ytimg.com/vi/3cWm9B_0_kI/maxresdefault.jpg?sqp=-oaymwEoCIAKENAF8quKqQMcGADwAQH4AbYIgAKAD4oCDAgAEAEYRiBlKA8wDw==&rs=AOn4CLD2HeSN5ZikYi7hBi3SC7913d9CWQ",
    "title": "How Many People To Stop Ronaldo?",
    "type": "video",
    "unknown_fields": [],
    "url": "https://www.youtube.com/shorts/3cWm9B_0_kI"
  },
  "meta": {
    "request_id": "req_3f9c2a7d1e8b4c6a9f0e2d4b6a8c0e1f",
    "platform": "youtube",
    "source": "api",
    "is_cached": false,
    "credits_charged": 1,
    "latency_ms": 1000,
    "fetched_at": "2026-10-25T12:00:00Z",
    "input": {
      "kind": "video",
      "id": "3cWm9B_0_kI",
      "url": "https://www.youtube.com/shorts/3cWm9B_0_kI"
    },
    "credits_remaining": 9999,
    "client_request_id": null,
    "warnings": []
  }
}
```

Long arrays and strings are shortened here. Real responses are complete.

## One schema on 2 platforms.

The [response reference](https://socialtap.dev/docs/reference/youtube/download/index.md#response) lists every field, its type and when it is `null`. [See the full schema](https://socialtap.dev/resources/download/index.md).

- ### Null means unknown

  A field YouTube doesn't show is null, never zero or an empty string, so a real zero always means zero.
- ### What it accepts

  A YouTube video, short or live link (youtube.com/watch?v=\<id>, youtu.be/\<id>, /shorts/\<id>, /live/\<id>, /embed/\<id>, /v/\<id>, /e/\<id>, an attribution_link; m., music., gaming. or youtube-nocookie.com hosts) or an 11-character video ID.
- ### Write one parser

  YouTube and TikTok answer in these fields, so the code that reads one reads them all.

- **`platform`string**: Platform ID (tiktok, instagram, …).
- **`platform`string**: In the example `"youtube"`
- **`id`string**: Platform-native ID of the post (equals post.id).
- **`id`string**: In the example `"3cWm9B_0_kI"`
- **`url`string**: Canonical URL of the post.
- **`url`string**: In the example `"https://www.youtube.com/shorts/3cWm9B_0_kI"`
- **`type`string**: The post's content shape, as post.type. New values may be added; treat unknown values as other.
- **`type`string**: In the example `"video"`
- **`platform_type`string**: The platform's own product label, lowercase (reel, short, story, …), as post.platform_type.
- **`platform_type`string**: In the example `"short"`
- **`title`string**: Headline (Reddit title, Facebook video title); null on caption-only platforms.
- **`title`string**: In the example `"How Many People To Stop Ronaldo?"`
- **`text`string**: Caption or body as plain text.
- **`text`string**: In the example `null`
- **`author`object**: The posting account.
- **`author`object**: In the example `display_name: "MrBeast", id: "UCX6OQ3DkcsbYNE6H8uQQuVA", url: "https://www.youtube.com/@MrBeast", …`

Live data from 38 platforms.

[TikTok](https://socialtap.dev/apis/tiktok/index.md) · [Instagram](https://socialtap.dev/apis/instagram/index.md) · [Facebook](https://socialtap.dev/apis/facebook/index.md) · [YouTube](https://socialtap.dev/apis/youtube/index.md) · [Reddit](https://socialtap.dev/apis/reddit/index.md) · [Threads](https://socialtap.dev/apis/threads/index.md) · [GitHub](https://socialtap.dev/apis/github/index.md) · [LinkedIn](https://socialtap.dev/apis/linkedin/index.md) · [X](https://socialtap.dev/apis/x/index.md) · [Spotify](https://socialtap.dev/apis/spotify/index.md) · [Hacker News](https://socialtap.dev/apis/hackernews/index.md) · [Amazon](https://socialtap.dev/apis/amazon/index.md) · [Apple Music](https://socialtap.dev/apis/applemusic/index.md) · [Fandom](https://socialtap.dev/apis/fandom/index.md) · [Pinterest](https://socialtap.dev/apis/pinterest/index.md) · [Cosmos](https://socialtap.dev/apis/cosmos/index.md) · [Rumble](https://socialtap.dev/apis/rumble/index.md) · [Bluesky](https://socialtap.dev/apis/bluesky/index.md) · [Twitch](https://socialtap.dev/apis/twitch/index.md) · [Telegram](https://socialtap.dev/apis/telegram/index.md) · [TikTok Shop](https://socialtap.dev/apis/tiktokshop/index.md) · [Kwai](https://socialtap.dev/apis/kwai/index.md) · [Snapchat](https://socialtap.dev/apis/snapchat/index.md) · [SoundCloud](https://socialtap.dev/apis/soundcloud/index.md) · [Truth Social](https://socialtap.dev/apis/truthsocial/index.md) · [Kick](https://socialtap.dev/apis/kick/index.md) · [Komi](https://socialtap.dev/apis/komi/page/index.md) · [Lnk.Bio](https://socialtap.dev/apis/linkbio/profile/index.md) · [Linkme](https://socialtap.dev/apis/linkme/profile/index.md) · [Linktree](https://socialtap.dev/apis/linktree/profile/index.md) · [Pillar](https://socialtap.dev/apis/pillar/page/index.md) · [Yelp](https://socialtap.dev/apis/yelp/search-businesses/index.md) · [TikTok Ad Library](https://socialtap.dev/apis/tiktok-ad-library/index.md) · [Facebook Ad Library](https://socialtap.dev/apis/facebook-ad-library/index.md) · [Facebook Events](https://socialtap.dev/apis/facebook-events/index.md) · [Facebook Marketplace](https://socialtap.dev/apis/facebook-marketplace/index.md) · [Google Ads Transparency Center](https://socialtap.dev/apis/google-ads-transparency/index.md) · [LinkedIn Ad Library](https://socialtap.dev/apis/linkedin-ad-library/index.md)

## What teams build with the YouTube Download API.

- ### Save Shorts as MP4 files

  Send each short's link and download files\[0\], an MP4 with sound, before its expires_at, along with the title, channel and publish time.
- ### Feed clips to vision and speech models

  Pass the audio file's url to your speech-to-text model, or the video stream whose width and height suit your vision model, straight from your server.
- ### Archive videos in the best quality

  Download the largest video stream and the audio stream, both marked by is_video_only and type, and join them with ffmpeg into one file.

## Good to know before you build.

- Longer videos usually come as the MP4 with sound only: YouTube serves their separate video and audio streams only in part to logged-out apps, so those have a null url.
- files\[0\] is the MP4 with sound when YouTube has one; the larger video streams have no sound, which is the audio file beside them.
- Links stop working at their expires_at, within hours, and some redirect to another YouTube server: follow redirects when you download.
- Age-restricted, members-only and paid videos return private_or_unavailable, and a stream still live returns no_media.

## 1 credit per request. Failed requests are free.

Buy credits once and spend them on any endpoint, on any platform.

[Plans and packs](https://socialtap.dev/pricing/index.md) · [How this endpoint is priced](https://socialtap.dev/docs/reference/youtube/download/index.md#pricing) · [How credits work](https://socialtap.dev/docs/credits/index.md)

| Source | Price per successful request | Per 1,000 requests |
| --- | --- | --- |
| Platform API `api` | 1 credit | $0.75–$1.97 |

- Cache hits are free.
- Credits from packs and top-ups never expire.
- A monthly plan's credits are spent first, and what is left of them ends at each renewal.
- Prices exclude tax: sales tax is added at checkout where it applies.
- Outside the US, plans and packs are sold to businesses: checkout asks for your VAT, GST or other business tax ID.

## Questions about the YouTube Download API.

More in the [API reference](https://socialtap.dev/docs/reference/youtube/download/index.md).

**Can I download YouTube Shorts with an API?**

Yes. Send the short's link and you get an MP4 with sound plus the full-quality video and audio streams, each link checked to download whole.

**Do the download links work from my server?**

Yes. The links need no cookie or header and work from any IP until their expires_at.

**Why is the url of some files null?**

YouTube serves the separate video and audio streams of media longer than about a minute only in part to logged-out apps. Those files keep their size and resolution with a null url, and the MP4 with sound still downloads.

**How much does the YouTube Download API cost?**

A request costs 1 credit. SocialTap credits cost $0.75–$1.97 per 1,000, depending on the plan or pack.

Other platforms

## Downloads on 1 more platform.

- [TikTok Download API](https://socialtap.dev/apis/tiktok/download/index.md) (1 credit · `GET /v1/tiktok/download`)

More YouTube

## YouTube API. 21 endpoints, one key.

- [YouTube Video API](https://socialtap.dev/apis/youtube/post/index.md) (1 credit · `GET /v1/youtube/post`)
- [YouTube Search API](https://socialtap.dev/apis/youtube/search-posts/index.md) (1 credit / page · `GET /v1/youtube/search_posts`)
- [YouTube Sound Shorts API](https://socialtap.dev/apis/youtube/sound-posts/index.md) (1 credit / page · `GET /v1/youtube/sound_posts`)
- [YouTube Hashtag Videos API](https://socialtap.dev/apis/youtube/hashtag-posts/index.md) (1 credit / page · `GET /v1/youtube/hashtag_posts`)
- [YouTube Related Videos API](https://socialtap.dev/apis/youtube/post-related-posts/index.md) (From 1 credit / page · `GET /v1/youtube/post_related_posts`)
- [YouTube Channel Videos API](https://socialtap.dev/apis/youtube/posts/index.md) (From 1 credit / page · `GET /v1/youtube/posts`)
- [YouTube Community Posts API](https://socialtap.dev/apis/youtube/channel-posts/index.md) (1 credit / page · `GET /v1/youtube/channel_posts`)
- [YouTube Playlist Videos API](https://socialtap.dev/apis/youtube/playlist-posts/index.md) (1 credit / page · `GET /v1/youtube/playlist_posts`)
- [YouTube Trending Videos API](https://socialtap.dev/apis/youtube/top-posts/index.md) (1 credit / page · `GET /v1/youtube/top_posts`)
- [YouTube Trending Shorts API](https://socialtap.dev/apis/youtube/trending-posts/index.md) (1 credit / page · `GET /v1/youtube/trending_posts`)
- [YouTube Channel API](https://socialtap.dev/apis/youtube/profile/index.md) (1 credit · `GET /v1/youtube/profile`)
- [YouTube Channel Search API](https://socialtap.dev/apis/youtube/search-profiles/index.md) (1 credit / page · `GET /v1/youtube/search_profiles`)
- [YouTube Comments API](https://socialtap.dev/apis/youtube/comments/index.md) (1 credit / page · `GET /v1/youtube/comments`)
- [YouTube Comment Replies API](https://socialtap.dev/apis/youtube/replies/index.md) (1 credit / page · `GET /v1/youtube/replies`)
- [YouTube Transcript API](https://socialtap.dev/apis/youtube/transcript/index.md) (From 1 credit · `GET /v1/youtube/transcript`)
- [YouTube Playlist API](https://socialtap.dev/apis/youtube/playlist/index.md) (1 credit · `GET /v1/youtube/playlist`)
- [YouTube Playlist Search API](https://socialtap.dev/apis/youtube/search-playlists/index.md) (1 credit / page · `GET /v1/youtube/search_playlists`)
- [YouTube Channel Playlists API](https://socialtap.dev/apis/youtube/playlists/index.md) (1 credit / page · `GET /v1/youtube/playlists`)
- [YouTube Engagement API](https://socialtap.dev/apis/youtube/engagement/index.md) (1 credit · `GET /v1/youtube/engagement`)
- [YouTube Search Suggestions API](https://socialtap.dev/apis/youtube/search-suggestions/index.md) (1 credit / page · `GET /v1/youtube/search_suggestions`)

[All 21 YouTube endpoints](https://socialtap.dev/apis/youtube/index.md)

## Try it on a link you already have.

Paste it in the playground, or copy the request into your code.

100free credits

- No credit card
- Failed requests are free
- Works on all 310 endpoints

[Start for free](https://socialtap.dev/signup/) [Read the docs](https://socialtap.dev/docs/index.md)

---

[HTML version](https://socialtap.dev/apis/youtube/download/) · [Docs index for AI agents](https://socialtap.dev/llms.txt) · [All docs in one file](https://socialtap.dev/llms-full.txt)
