You have a video page URL, but your integration needs a URL for the downloadable file. By the end of this guide, you’ll be able to submit the video, wait for processing, and retrieve its download URL using Zyla API Hub.
Social Media API Video Download API supports YouTube, Facebook, Instagram, SoundCloud, TikTok, X/Twitter, and Twitch. It also supports YouTube Shorts. Applications can use it to request a supported video quality or audio format, then retrieve a download URL after processing.
Getting started on Zyla API Hub
Open the Social Media API Video Download API listing on Zyla API Hub, create a free account if you need one, and select Subscribe or Start Free Trial when available. The first API offers a 7-day trial or 50 requests; check the API page for current access options and pricing. Once subscribed, use your API key in the Authorization: Bearer YOUR_API_KEY header.
The Hub uses subscriptions and quotas rather than pay-per-call billing. The same account and API key can be used across the marketplace, which lists more than 10,000 public APIs.
Submit the video for processing
The Download endpoint accepts a source URL and a requested format. It returns an ID that you use in a separate request to obtain the downloadable URL.
Method: GET
Request URL: https://zylalabs.com/api/10960/social-media-api-video-download/20671/download
Both query parameters are required:
download: the source video URL.format: the requested format or quality, such as720.
The supported format values are 144, 240, 360, 480, 720, 1080, 1440, 4k, mp3, wav, ogg, and webm. Check the listing for current duration restrictions and other access details before accepting arbitrary source URLs in your application.
This request submits the documented YouTube example at 720. The source URL is percent-encoded so its own query string stays inside the download parameter.
curl -s -X GET "https://zylalabs.com/api/10960/social-media-api-video-download/20671/download?download=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4iuPJ1pdNkY&format=720" \
-H "Authorization: Bearer YOUR_API_KEY"
The documented response is:
{
"success": true,
"id": "v2_stream_72b78f7ca6c4f1f267cb",
"title": "Team Feature: Algeria | The Rise of \"Mazadona,\" Algeria’s Secret World Cup Weapon",
"thumbnail": "https://i.ytimg.com/vi/4iuPJ1pdNkY/hqdefault.jpg",
"format": "mp4 [720p]"
}
Check success and retain id; the ID is the input to the next endpoint. The response also supplies a title, thumbnail, and returned format, which can help identify the requested item in a user interface. This response does not itself contain the download URL.
Retrieve the download URL
After obtaining the ID, wait at least 30 seconds before calling Get Video Download URL. Processing takes 30 seconds to 1 minute and may vary with queue load, so an application should not assume the result is ready immediately after the minimum wait.
Method: GET
Request URL: https://zylalabs.com/api/10960/social-media-api-video-download/20672/get-video-download-url
The endpoint has one required query parameter: getVideo, containing the ID returned by Download. For the example above, its value is v2_stream_72b78f7ca6c4f1f267cb. Send the same Bearer authorization header used for the first request.
A documented completed response looks like this:
{
"success": true,
"status": "completed",
"progress": 100,
"downloads": [
{
"type": "primary",
"url": "https://pamela88.savenow.to/api/v2/download/C4iTh0dc7N8FG9FNFKFgD4m967FudaMu01MT6eqPCv3my0Rv",
"has_ssl": true
}
]
}
In this response, status is completed and progress is 100. The URL to hand to the user is in the url field of the downloads array; this example identifies the entry as primary and reports has_ssl as true.
Keep the two IDs and URLs distinct in your application: the source URL identifies the input, the returned id identifies the processing request, and the URL inside downloads is the result. Do not treat the initial ID as a file URL.
Make both requests in Python
This example uses Python’s standard library. It submits the same source URL and format as the official request, waits 30 seconds, and then makes one lookup using the ID returned by the first call. Replace YOUR_API_KEY with your Hub key before running it.
import json
import time
from urllib.parse import urlencode
from urllib.request import Request, urlopen
api_key = "YOUR_API_KEY"
download_url = (
"https://zylalabs.com/api/10960/social-media-api-video-download/20671/download"
"?download=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4iuPJ1pdNkY"
"&format=720"
)
lookup_url = (
"https://zylalabs.com/api/10960/social-media-api-video-download/"
"20672/get-video-download-url"
)
def get_json(url):
request = Request(
url,
headers={"Authorization": "Bearer " + api_key},
method="GET",
)
with urlopen(request) as response:
return json.load(response)
submitted = get_json(download_url)
if not submitted.get("success") or not submitted.get("id"):
raise SystemExit("Download request did not return an ID.")
video_id = submitted["id"]
time.sleep(30)
query = urlencode({"getVideo": video_id})
result = get_json(lookup_url + "?" + query)
print(json.dumps(result, indent=4, ensure_ascii=False))
if not result.get("success") or result.get("status") != "completed":
raise SystemExit("The download is not reported as completed.")
downloads = result.get("downloads") or []
if not any(item.get("url") for item in downloads):
raise SystemExit("No download URL was returned.")
The program prints the lookup response and verifies that a completed response contains a URL. For the documented completed example, the printed response has the following values:
{
"success": true,
"status": "completed",
"progress": 100,
"downloads": [
{
"type": "primary",
"url": "https://pamela88.savenow.to/api/v2/download/C4iTh0dc7N8FG9FNFKFgD4m967FudaMu01MT6eqPCv3my0Rv",
"has_ssl": true
}
]
}
That output illustrates the documented response, not a guarantee that a new request will return the same ID or URL. If the lookup is not reported as completed, retain the actual ID and try the lookup again later. In a production integration, keep the wait outside an interactive request where possible, and handle HTTP or network failures around both calls.
Practical integration choices
For a media workflow, store the source URL, requested format, and returned ID together while processing. Once the lookup reports completion, read the returned downloads entries rather than constructing a file URL from the ID or the video title.
For a user-facing download tool, show the returned title and thumbnail to help the user confirm the item. Present the result only after the lookup supplies a URL; the initial success field confirms the submission response, not that a download URL has already been returned.
For an audio-oriented workflow, request one of the documented audio format values rather than assuming a video-quality value will produce audio in the desired format. Use the returned format to identify the result shown by the initial response.
Only process content you have permission to download. Keep the API key on a trusted backend rather than embedding it in browser or mobile application code, and account for your subscription quota when designing repeated lookups.
Call the API from an AI agent
Zyla API Hub exposes its APIs to compatible agents through MCP. Configure Claude Code, Cursor, Windsurf, or another MCP-compatible client with the endpoint below, replacing the placeholder with your API key:
https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY
Ask the agent to submit the video and requested format, retain the returned ID, and wait at least 30 seconds before retrieving the download URL. The same processing delay applies whether the workflow is initiated by an agent or by your own code.
FAQ
Why didn’t the Download endpoint return a file URL?
The documented Download response returns an ID and video details. Use that ID with Get Video Download URL after the required wait to retrieve the URL.
How long should I wait before looking up the ID?
Wait at least 30 seconds. Processing typically takes 30 seconds to 1 minute and may vary with queue load, so the first lookup after 30 seconds is not guaranteed to be complete.
Can I request audio instead of video?
Yes. The documented format values include mp3, wav, and ogg, alongside video quality and format options.
Does the API support YouTube Shorts?
Yes. The endpoint description explicitly includes YouTube Shorts, as well as the supported websites listed above.
Ready to integrate? Create a free Zyla account if needed, then Start 7-day trial on Social Media API Video Download API and get an API key. Check the listing for current access options and pricing.