You need an API to download video files programmatically and ship it this week. By the end of this guide you’ll be able to call a single endpoint that returns direct download URLs plus media metadata you can use to pick the right stream, then save the file in your backend or pipeline.
What you can do with this Media API
Zyla API Hub hosts the Social Saver API, a Media category API that provides a direct download link and metadata for a given video. It’s designed for developers building media workflows: saving source videos to storage, creating offline review copies, prefetching assets for editors, or preparing inputs for transcoding.
Key behavior of the Download Video endpoint:
- Returns a JSON payload with one or more downloadable “medias” variants for the same video (e.g., different qualities and file types).
- Each item includes a direct
urlto download, thequalitylabel, whether it’s audio-only viais_audio, the mediatype, and fileextension. - As noted by the API: the download for Instagram is not available.
By design, the direct download links are time-limited (you’ll see an expire query parameter in the example URL). Your integration should fetch and store the asset promptly.
Getting started on Zyla API Hub
Open the Social Saver API page on Zyla, subscribe, and grab your key:
- Go to the marketplace listing: Start 7-day trial on Social Saver API.
- Click Subscribe or Start Free Trial (when available) to get an API key. Zyla uses a subscription + quota model (not pay-per-call). For this API, you can start with a 7-day trial or 50 requests; check the API page for current access options and pricing.
- Send requests with Authorization: Bearer YOUR_API_KEY.
You can manage all your Media APIs under one Zyla account and key across more than 10,000 public APIs.
Endpoint: Download Video
The Social Saver API exposes a single, focused Media endpoint for downloading video resources.
- Method: POST
- Path:
https://zylalabs.com/api/5617/social-saver-api/7304/download-video - Purpose: Returns a direct download link and metadata (format, size, duration) in JSON. The response includes a
mediasarray with fields you can filter on, such asquality,type,extension, and whether it’s audio-only (is_audio). - Parameters: Not documented on the hub listing. Authenticate with your Zyla key only.
- Note: Instagram downloads are not available.
cURL request you can paste
Authenticate with your Zyla key in the Authorization header. Copy this as-is and replace YOUR_API_KEY.
curl -s -X POST "https://zylalabs.com/api/5617/social-saver-api/7304/download-video" \
-H "Authorization: Bearer YOUR_API_KEY"
Real API response
Below is the official response example from the marketplace listing. Notice the medias array. Each item describes a downloadable stream with a direct URL and its attributes.
{"medias":[{"url":"https://rr1---sn-uvu5a2a5t-j00e.googlevideo.com/videoplayback?expire=1736299646&ei=HoB9Z_zLBt3bsfIP2_b38AY&ip=187.189.58.232&id=o-ADEmoHyt2c-jvecX7TCXCFzNwjCKWmTQdub8B14Lp6oI&itag=18&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1736278046%2C&mh=MZ&mm=31%2C29&mn=sn-uvu5a2a5t-j00e%2Csn-q4fzen7e&ms=au%2Crdu&mv=m&mvi=1&pl=24&rms=au%2Cau&gcr=mx&initcwndbps=3491250&bui=AfMhrI82lAjJY0WOeSw4RzQd2O7_8Y6bmXk_ZbZLjySWxJOJuL-BwW52kyzAAy6EWJkSuSg61HTO_0N5&spc=x-caUK7O22hI5OSL_QCSR-xQ&vprv=1&mime=video%2Fmp4&rqh=1&gir=yes&clen=12665255&ratebypass=yes&dur=268.306&lmt=1734290066368598&mt=1736277676&fvip=5&fexp=51326932%2C51335594%2C51371294&c=ANDROID_VR&txp=5538434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cgcr%2Cbui%2Cspc%2Cvprv%2Cmime%2Crqh%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&sig=AJfQdSswRgIhAP8_1X4hO59Dv6XjFSNgbyuJbDFqy7lMkE7C3HsrxQe7AiEApBnqG74O6k_WVUrzyhzZEvtf9erlAyliN78-JkkHRkw%3D&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=AGluJ3MwRAIgBSiwjWgvUEx6UIJknkYNRfmeUvSHj9UrBPKaWykkoYMCIF50GZRAFXfL09I8W2EJG_MZegzkWyUDStwYe3RS8XDh","quality":"360p","is_audio":true,"type":"video","extension":"mp4"},{"url":"https://rr1---sn-uvu5a2a5t-j00e.googlevideo.com/videoplayback?expire=1736299646&ei=HoB9Z_zLBt3bsfIP2_b38AY&ip=187.189.58.232&id=o-ADEmoHyt2c-jvecX7TCXCFzNwjCKWmTQdub8B14Lp6oI&itag=137&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1736278046%2C&mh=MZ&mm=31%2C29&mn=sn-uvu5a2a5t-j00e%2Csn-q4fzen7e&ms=au%2Crdu&mv=m&mvi=1&pl=24&rms=au%2Cau&gcr=mx&initcwndbps=3491250&bui=AfMhrI9VvQoIacAzvD2W3w5jlW_vLkoD4y6oMkRnf7lpOEIHZmQFTZR_rFMk0TDU6ri1VYNZuqe099AJ&spc=x-caUNzL6WsY4e6P&vprv=1&mime=video%2Fmp4&rqh=1&gir=yes&clen=39897728&dur=268.249&lmt=1734289668428610&mt=1736277676&fvip=5&keepalive=yes&fexp=51326932%2C51335594%2C51371294&c=ANDROID_VR&txp=5532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cgcr%2Cbui%2Cspc%2Cvprv%2Cmime%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRAIgfWD2wDcFVnGBH4igkfdwjjCM96VvjIVtS9WZDkfkam8CIB794at9yDgSh9LU43fWVbGiY8jT5EuJjx0RYUovzwiO&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=AGluJ3MwRAIgBSiwjWgvUEx6UIJknkYNRfmeUvSHj9UrBPKaWykkoYMCIF50GZRAFXfL09I8W2EJG_MZegzkWyUDStwYe3RS8XDh","quality":"1080p","is_audio":false,"type":"video","extension":"mp4"},{"url":"https://rr1---sn-uvu5a2a5t-j00e.googlevideo.com/videoplayback?expire=1736299646&ei=HoB9Z_zLBt3bsfIP2_b38AY&ip=187.189.58.232&id=o-ADEmoHyt2c-jvecX7TCXCFzNwjCKWmTQdu…
Fields you’ll typically use:
medias: array of variants you can present or select from.medias[].url: the direct download URL. It is time-bound; fetch promptly.medias[].quality: label such as “360p”, “1080p”. Useful for ranking.medias[].is_audio: true if the stream is audio-only.medias[].typeandmedias[].extension: media type and file extension for storage naming and processing.
Python example: pick a stream and download
This sample calls the same endpoint, chooses the highest labeled quality that is not audio-only, and downloads it. Adjust the selection logic to your needs.
import os
import re
import requests
API_KEY = os.getenv("ZYLALABS_API_KEY", "YOUR_API_KEY")
URL = "https://zylalabs.com/api/5617/social-saver-api/7304/download-video"
headers = {
"Authorization": f"Bearer {API_KEY}"
}
resp = requests.post(URL, headers=headers, timeout=30)
resp.raise_for_status()
data = resp.json()
medias = data.get("medias", [])
def quality_score(q):
# Extract numeric part, e.g., "1080p" -> 1080
if not isinstance(q, str):
return -1
m = re.search(r"(\\d+)", q)
return int(m.group(1)) if m else -1
# Prefer non-audio tracks, highest quality first. Fallback to any variant if needed.
video_variants = [m for m in medias if not m.get("is_audio")]
chosen = sorted(video_variants, key=lambda m: quality_score(m.get("quality")), reverse=True)
if not chosen:
chosen = medias # Fallback if only audio variants are present
if not chosen:
raise SystemExit("No medias returned by API")
variant = chosen[0]
download_url = variant["url"]
ext = variant.get("extension", "bin")
quality = variant.get("quality", "unknown")
out_path = f"downloaded_{quality}.{ext}"
print(f"Downloading: {quality} ({ext})")
with requests.get(download_url, stream=True, timeout=60) as r:
r.raise_for_status()
with open(out_path, "wb") as f:
for chunk in r.iter_content(chunk_size=1024 * 512):
if chunk:
f.write(chunk)
print(f"Saved to: {out_path}")
Implementation notes:
- Download URLs are time-limited; run the download immediately after fetching the JSON.
- Store the media with a deterministic naming convention including quality and extension.
- Wrap network calls with retries as appropriate in your environment.
Practical integration tips that save time
- Durations and sizes: The endpoint description indicates metadata such as format, size, and duration. Use them to pre-allocate storage or estimate processing time. If they’re present in your response, surface them in logs and UIs.
- Time-limited links: The sample URLs include an
expirequery parameter. Treat every link as expiring; avoid caching the direct URL long-term and re-request a fresh link if needed. - Concurrency: For batch jobs, download in parallel with a conservative concurrency level to keep throughput high without overloading your workers.
- Non-Instagram sources only: The API notes Instagram downloads are not available. Guard your UI and queues accordingly.
- File integrity: If a
clen-like value appears in the URL or metadata, use it to validate completed size. Otherwise, verify by reopening the file in your transcoder or ffprobe step.
Common Media workflows you can implement fast
- CMS ingest: On paste, fetch variants, choose a preferred baseline (e.g., 720p MP4), store to object storage, enqueue for thumbnailing.
- Editorial review copies: Grab a low-resolution variant to reduce review bandwidth while keeping the original source path in your asset graph.
- Audio extraction: Filter
is_audio == trueto source audio-only tracks for transcription or podcast workflows. - Serverless clipper: In a serverless function, fetch the direct link, store to temporary storage, kick off a downstream clipping/transcoding job.
Calling this Media API from an AI agent via MCP
If you use MCP-compatible developer tools (Claude Code, Cursor, Windsurf), you can call Zyla APIs through the MCP endpoint. Configure your client to point to the MCP server URL and pass your API key:
Once connected, your agent can invoke the same Social Saver API Download Video capability via MCP using your existing Zyla subscription and key. The behavior and authentication are the same as direct HTTP calls: Authorization with your Zyla key, subscription + quota billing, and time-limited direct download links in the response.
Testing, monitoring, and operating this integration
- Retries and backoff: Wrap both the metadata request and the file download with retry logic and exponential backoff to handle transient failures.
- Timeouts: Use explicit timeouts for the metadata POST and the file GET requests. Longer timeouts may be needed for large files.
- Storage and lifecycle: Store media in object storage with lifecycle policies and checksum verification to keep costs and corruption risk down.
- Observability: Log the selected variant quality, type, and extension. If metadata includes size or duration, capture those for monitoring.
- Access: Keep your Zyla API key in your secrets manager and rotate periodically.
How to choose the right variant
Most pipelines pick a single “source of truth” variant and, optionally, a lightweight review copy:
- Source: select the highest non-audio
qualityyou can process (e.g., 1080p), preferextensionmp4 for toolchain compatibility. - Review: use a lower
qualityor audio-only variant for QA or transcription tasks. - Fallback: if only audio is returned, branch your workflow accordingly (e.g., transcription only).
Request patterns that work in production
- Pull-then-download: Call the endpoint, immediately start downloading your chosen variant, and only then enqueue downstream jobs with the saved file path.
- Idempotency: If your queue can redeliver, write to a temporary path and move atomically once the file is fully written.
- Synchronous vs async: Keep the metadata call synchronous in request handlers but offload the file download to a worker if the client can’t wait.
Subscription model and access
Zyla uses subscription + quota, not pay-per-call. For Social Saver API, you can start with a 7-day trial or 50 requests; check the marketplace page for current access options. Manage usage across Media APIs under one account and key on Zyla API Hub.
FAQ
Does the API support Instagram?
No. The listing notes that the download for Instagram is not available.
Are the direct download URLs permanent?
No. They are time-limited; you’ll see an expire parameter in the URL. Download the file promptly after fetching the JSON.
Which fields tell me what to download?medias[].url is the direct link. Use quality to rank variants, is_audio to detect audio-only, and type/extension to choose compatible formats.
What authentication is required?
Send your Zyla key in the header: Authorization: Bearer YOUR_API_KEY.
Is there a free plan?
Zyla runs on a subscription + quota model. For Social Saver API, you can start a 7-day trial or 50 requests; see the listing for current details.
Ready to integrate an API to download video into your Media pipeline? Start your trial and get a working key in minutes here: Start 7-day trial on Social Saver API.
Official API response
{"medias":[{"url":"https://rr1---sn-uvu5a2a5t-j00e.googlevideo.com/videoplayback?expire=1736299646&ei=HoB9Z_zLBt3bsfIP2_b38AY&ip=187.189.58.232&id=o-ADEmoHyt2c-jvecX7TCXCFzNwjCKWmTQdub8B14Lp6oI&itag=18&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1736278046%2C&mh=MZ&mm=31%2C29&mn=sn-uvu5a2a5t-j00e%2Csn-q4fzen7e&ms=au%2Crdu&mv=m&mvi=1&pl=24&rms=au%2Cau&gcr=mx&initcwndbps=3491250&bui=AfMhrI82lAjJY0WOeSw4RzQd2O7_8Y6bmXk_ZbZLjySWxJOJuL-BwW52kyzAAy6EWJkSuSg61HTO_0N5&spc=x-caUK7O22hI5OSL_QCSR-xQ&vprv=1&mime=video%2Fmp4&rqh=1&gir=yes&clen=12665255&ratebypass=yes&dur=268.306&lmt=1734290066368598&mt=1736277676&fvip=5&fexp=51326932%2C51335594%2C51371294&c=ANDROID_VR&txp=5538434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cgcr%2Cbui%2Cspc%2Cvprv%2Cmime%2Crqh%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&sig=AJfQdSswRgIhAP8_1X4hO59Dv6XjFSNgbyuJbDFqy7lMkE7C3HsrxQe7AiEApBnqG74O6k_WVUrzyhzZEvtf9erlAyliN78-JkkHRkw%3D&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=AGluJ3MwRAIgBSiwjWgvUEx6UIJknkYNRfmeUvSHj9UrBPKaWykkoYMCIF50GZRAFXfL09I8W2EJG_MZegzkWyUDStwYe3RS8XDh","quality":"360p","is_audio":true,"type":"video","extension":"mp4"},{"url":"https://rr1---sn-uvu5a2a5t-j00e.googlevideo.com/videoplayback?expire=1736299646&ei=HoB9Z_zLBt3bsfIP2_b38AY&ip=187.189.58.232&id=o-ADEmoHyt2c-jvecX7TCXCFzNwjCKWmTQdub8B14Lp6oI&itag=137&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1736278046%2C&mh=MZ&mm=31%2C29&mn=sn-uvu5a2a5t-j00e%2Csn-q4fzen7e&ms=au%2Crdu&mv=m&mvi=1&pl=24&rms=au%2Cau&gcr=mx&initcwndbps=3491250&bui=AfMhrI9VvQoIacAzvD2W3w5jlW_vLkoD4y6oMkRnf7lpOEIHZmQFTZR_rFMk0TDU6ri1VYNZuqe099AJ&spc=x-caUNzL6WsY4e6P&vprv=1&mime=video%2Fmp4&rqh=1&gir=yes&clen=39897728&dur=268.249&lmt=1734289668428610&mt=1736277676&fvip=5&keepalive=yes&fexp=51326932%2C51335594%2C51371294&c=ANDROID_VR&txp=5532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cgcr%2Cbui%2Cspc%2Cvprv%2Cmime%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRAIgfWD2wDcFVnGBH4igkfdwjjCM96VvjIVtS9WZDkfkam8CIB794at9yDgSh9LU43fWVbGiY8jT5EuJjx0RYUovzwiO&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=AGluJ3MwRAIgBSiwjWgvUEx6UIJknkYNRfmeUvSHj9UrBPKaWykkoYMCIF50GZRAFXfL09I8W2EJG_MZegzkWyUDStwYe3RS8XDh","quality":"1080p","is_audio":false,"type":"video","extension":"mp4"},{"url":"https://rr1---sn-uvu5a2a5t-j00e.googlevideo.com/videoplayback?expire=1736299646&ei=HoB9Z_zLBt3bsfIP2_b38AY&ip=187.189.58.232&id=o-ADEmoHyt2c-jvecX7TCXCFzNwjCKWmTQdu…
Official API response
{"medias":[{"url":"https://rr1---sn-uvu5a2a5t-j00e.googlevideo.com/videoplayback?expire=1736299646&ei=HoB9Z_zLBt3bsfIP2_b38AY&ip=187.189.58.232&id=o-ADEmoHyt2c-jvecX7TCXCFzNwjCKWmTQdub8B14Lp6oI&itag=18&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1736278046%2C&mh=MZ&mm=31%2C29&mn=sn-uvu5a2a5t-j00e%2Csn-q4fzen7e&ms=au%2Crdu&mv=m&mvi=1&pl=24&rms=au%2Cau&gcr=mx&initcwndbps=3491250&bui=AfMhrI82lAjJY0WOeSw4RzQd2O7_8Y6bmXk_ZbZLjySWxJOJuL-BwW52kyzAAy6EWJkSuSg61HTO_0N5&spc=x-caUK7O22hI5OSL_QCSR-xQ&vprv=1&mime=video%2Fmp4&rqh=1&gir=yes&clen=12665255&ratebypass=yes&dur=268.306&lmt=1734290066368598&mt=1736277676&fvip=5&fexp=51326932%2C51335594%2C51371294&c=ANDROID_VR&txp=5538434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cgcr%2Cbui%2Cspc%2Cvprv%2Cmime%2Crqh%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&sig=AJfQdSswRgIhAP8_1X4hO59Dv6XjFSNgbyuJbDFqy7lMkE7C3HsrxQe7AiEApBnqG74O6k_WVUrzyhzZEvtf9erlAyliN78-JkkHRkw%3D&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=AGluJ3MwRAIgBSiwjWgvUEx6UIJknkYNRfmeUvSHj9UrBPKaWykkoYMCIF50GZRAFXfL09I8W2EJG_MZegzkWyUDStwYe3RS8XDh","quality":"360p","is_audio":true,"type":"video","extension":"mp4"},{"url":"https://rr1---sn-uvu5a2a5t-j00e.googlevideo.com/videoplayback?expire=1736299646&ei=HoB9Z_zLBt3bsfIP2_b38AY&ip=187.189.58.232&id=o-ADEmoHyt2c-jvecX7TCXCFzNwjCKWmTQdub8B14Lp6oI&itag=137&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1736278046%2C&mh=MZ&mm=31%2C29&mn=sn-uvu5a2a5t-j00e%2Csn-q4fzen7e&ms=au%2Crdu&mv=m&mvi=1&pl=24&rms=au%2Cau&gcr=mx&initcwndbps=3491250&bui=AfMhrI9VvQoIacAzvD2W3w5jlW_vLkoD4y6oMkRnf7lpOEIHZmQFTZR_rFMk0TDU6ri1VYNZuqe099AJ&spc=x-caUNzL6WsY4e6P&vprv=1&mime=video%2Fmp4&rqh=1&gir=yes&clen=39897728&dur=268.249&lmt=1734289668428610&mt=1736277676&fvip=5&keepalive=yes&fexp=51326932%2C51335594%2C51371294&c=ANDROID_VR&txp=5532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cgcr%2Cbui%2Cspc%2Cvprv%2Cmime%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRAIgfWD2wDcFVnGBH4igkfdwjjCM96VvjIVtS9WZDkfkam8CIB794at9yDgSh9LU43fWVbGiY8jT5EuJjx0RYUovzwiO&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms%2Cinitcwndbps&lsig=AGluJ3MwRAIgBSiwjWgvUEx6UIJknkYNRfmeUvSHj9UrBPKaWykkoYMCIF50GZRAFXfL09I8W2EJG_MZegzkWyUDStwYe3RS8XDh","quality":"1080p","is_audio":false,"type":"video","extension":"mp4"},{"url":"https://rr1---sn-uvu5a2a5t-j00e.googlevideo.com/videoplayback?expire=1736299646&ei=HoB9Z_zLBt3bsfIP2_b38AY&ip=187.189.58.232&id=o-ADEmoHyt2c-jvecX7TCXCFzNwjCKWmTQdu…