Prepare a Social Media Download
Get temporary MP4 or MP3 download options for public YouTube, Instagram, and TikTok URLs without an API key.
Get temporary MP4 or MP3 download options for public YouTube, Instagram, and TikTok URLs without an API key.
/api/v1/public/social-media/downloadsResolve a public social media URL and return temporary download options.
This endpoint supports public YouTube videos and Shorts, Instagram posts and Reels, and TikTok videos. It returns metadata plus the MP4 or MP3 formats currently available from the source.
This is a public endpoint. It does not require an x-api-key header or a dopost account.
The response only includes formats that can be prepared for the supplied URL.
| Platform | Supported public URLs | MP4 options | MP3 options | Notes |
|---|---|---|---|---|
| YouTube | Videos, Shorts, youtu.be, live replays and embeds | Available heights from 144p to 1080p | 128, 192 and 320 kbps | MP4 files include audio. A height is omitted when the source does not provide it |
| Public posts, Reels and video posts | Video variants exposed by Instagram | 128, 192 and 320 kbps | Private posts and posts without video are not available | |
| TikTok | Public video URLs and short links | HD and standard when supplied by the source | 128, 192 and 320 kbps | The exact options depend on the public source response |
{
"url": "https://www.youtube.com/watch?v=VIDEO_ID",
"mode": "both"
}{
"url": "https://www.youtube.com/watch?v=VIDEO_ID",
"mode": "both"
}| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Public YouTube, Instagram, or TikTok URL. Maximum 2048 characters |
mode | video | audio | both | No | Formats to return. Defaults to both |
| Value | Formats returned | Use it when |
|---|---|---|
video | MP4 only | You need a playable video with audio |
audio | MP3 only | You only need the audio track |
both | MP4 and MP3 | You want to show every available choice to the user |
curl --request POST \
--url https://dopost.co/api/v1/public/social-media/downloads \
--header 'Content-Type: application/json' \
--data '{
"url": "https://www.youtube.com/watch?v=VIDEO_ID",
"mode": "video"
}'curl --request POST \
--url https://dopost.co/api/v1/public/social-media/downloads \
--header 'Content-Type: application/json' \
--data '{
"url": "https://www.youtube.com/watch?v=VIDEO_ID",
"mode": "video"
}'{
"data": {
"platform": "youtube",
"sourceUrl": "https://www.youtube.com/watch?v=VIDEO_ID",
"title": "Example video",
"thumbnailUrl": "https://i.ytimg.com/vi/VIDEO_ID/maxresdefault.jpg",
"durationSeconds": 94,
"authorName": "Example creator",
"formats": [
{
"id": "youtube-mp4-1080",
"label": "1080p",
"container": "mp4",
"hasVideo": true,
"hasAudio": true,
"height": 1080,
"sizeBytes": 24576000,
"downloadUrl": "https://dopost.co/api/v1/public/social-media/downloads/dlt_TEMPORARY_TOKEN",
"expiresAt": "2026-07-17T13:10:00.000Z"
}
]
}
}{
"data": {
"platform": "youtube",
"sourceUrl": "https://www.youtube.com/watch?v=VIDEO_ID",
"title": "Example video",
"thumbnailUrl": "https://i.ytimg.com/vi/VIDEO_ID/maxresdefault.jpg",
"durationSeconds": 94,
"authorName": "Example creator",
"formats": [
{
"id": "youtube-mp4-1080",
"label": "1080p",
"container": "mp4",
"hasVideo": true,
"hasAudio": true,
"height": 1080,
"sizeBytes": 24576000,
"downloadUrl": "https://dopost.co/api/v1/public/social-media/downloads/dlt_TEMPORARY_TOKEN",
"expiresAt": "2026-07-17T13:10:00.000Z"
}
]
}
}| Field | Type | How to use it |
|---|---|---|
platform | youtube | instagram | tiktok | Identifies the provider selected from the submitted URL |
title | string | Original media title used in the downloaded filename |
thumbnailUrl | string | null | Preview image when the source provides one |
durationSeconds | number | null | Media duration when it is available |
authorName | string | null | Creator name when it is available |
formats | array | Download choices currently available for this media |
formats[].container | mp4 | mp3 | Output file type |
formats[].height | number | MP4 video height. It is omitted for audio or when the source does not report it |
formats[].bitrateKbps | number | MP3 bitrate. It is omitted for video |
formats[].sizeBytes | number | Estimated size when it can be calculated |
formats[].downloadUrl | string | Temporary URL that starts this exact format download |
formats[].expiresAt | ISO 8601 string | Time at which the temporary URL stops working |
downloadUrl is opaque and temporary. Open it before expiresAt and do not save it as a permanent media URL.
Use the values returned by the API instead of assuming that a quality exists:
formats by container to choose MP4 or MP3.height. If it is absent, use label to present the option.bitrateKbps. A higher value normally produces a larger file.downloadUrl from the selected object. Do not build a download URL from id.| Step | Request or action | Result |
|---|---|---|
| 1 | POST /api/v1/public/social-media/downloads with url and mode | Metadata and available formats |
| 2 | Select one object from data.formats | The exact format and temporary downloadUrl |
| 3 | Open downloadUrl in a browser or send a GET request that follows redirects | The API starts streaming the MP4 or MP3 file |
| 4 | Save the response using Content-Disposition | The original title is used in the final filename |
See Download a Prepared File for browser, curl and server examples.
| Window | Limit per client IP |
|---|---|
| Burst protection | 1 preparation every 5 seconds |
| Sustained use | 10 preparations per minute |
The public layer uses distributed Redis counters when Upstash is configured. A 429 response includes Retry-After with the number of seconds to wait.
Errors use a stable object:
{
"error": {
"code": "UNSUPPORTED_URL",
"message": "Please provide a supported YouTube, Instagram, or TikTok URL."
}
}{
"error": {
"code": "UNSUPPORTED_URL",
"message": "Please provide a supported YouTube, Instagram, or TikTok URL."
}
}| Status | Error | Cause |
|---|---|---|
400 | INVALID_REQUEST | The body is not valid JSON, the URL is empty or too long, or mode is invalid |
400 | UNSUPPORTED_URL | The URL does not match a supported YouTube, Instagram or TikTok media URL |
404 | MEDIA_UNAVAILABLE | The media is private, removed, restricted or has no public downloadable file |
429 | RATE_LIMITED | The client exceeded the short or per-minute limit. Follow Retry-After |
502 | UPSTREAM_ERROR | The source platform could not be processed |
503 | SERVICE_UNAVAILABLE | The service, Redis, yt-dlp or another required dependency is unavailable |
Only download media you own or have permission to use. You are responsible for respecting the source platform terms, creator rights, and copyright laws in your region.
Use the selected format's downloadUrl to start the file download.