On this page7 sections
Short answer: many YouTube download APIs don't give you a file. They give you a direct YouTube media link (a googlevideo.com URL) that expires within hours and is often tied to the IP address that asked for it. It plays in your browser during testing, then your server fetches it later, or from a different machine, and gets 403 Forbidden. The fix is to fetch it immediately from the same place that requested it, or to use an API that downloads the file and hands you a link to its own copy.
Last checked: November 25, 2026.
This page is for developers who already call a third-party download API (from RapidAPI or elsewhere) and see it work in a demo and fail in production. If you run the downloader yourself and it's blocked on your server, read downloads blocked on your server instead.
What you see
The API call itself succeeds. You get JSON back with a download URL, and the failure comes one step later, when your backend or worker downloads that URL:
GET https://rr3---sn-xxxx.googlevideo.com/videoplayback?expire=...&ip=...&...
HTTP/1.1 403 ForbiddenTypical patterns:
- It works when you paste the link into your browser right away, and fails when a queue worker picks it up an hour later.
- It works on your laptop and fails from your production server, a serverless function or a different region.
- It worked for weeks, then every link started failing at once, even though the API still answers.
Why it happens
A direct YouTube media link isn't a permanent file URL. It's a short-lived, signed link to YouTube's own servers. The node-ytdl-core project describes these links as valid for 6 hours and only downloadable from the same IP address, and the query string usually shows it: an expire value (a Unix timestamp) and an ip value (the address the link was issued to).
So a provider that returns a googlevideo.com URL is handing you something that:
- Expires. Store it in a database and process it later, and it's dead.
- Is often bound to the provider's IP, not yours. Your server isn't the address the link was issued to, so YouTube can refuse it.
- Breaks when YouTube changes things. When the provider's own access stops working, every link it returns fails together. That's the "it died a month after we shipped" pattern.
None of this shows up in a demo, because in a demo you click the link seconds after it was made, usually from a browser.
Confirm it in 30 seconds
Take one failing URL from your logs and check three things:
- Host. If it's
*.googlevideo.com, you're getting YouTube's link, not a file the provider stores. expire. Convert it (date -d @<value>on Linux,date -r <value>on macOS). If it's in the past, the link simply expired.ip. Compare it with your server's public address (curl -s https://api.ipify.org). If they differ, the link was issued to someone else.
If the host is the provider's own storage (S3, R2, a CDN) and you still get 403, it's a signed link that expired or a permissions issue on their side, so check their docs for the link lifetime.
Free fixes
If you want to keep the current provider, these help:
- Download right away. Fetch the file in the same job that called the API, not in a later step, and save it to your own storage.
- Re-request instead of storing links. Keep the source URL (the YouTube link the user gave you) in your database, never the download link, and ask the API for a fresh one when you need the file.
- Check the provider's link mode. Some providers offer a mode that stores the file on their side or streams it through their servers. It's often a parameter or a higher tier.
These cover expiry. They don't fix links tied to someone else's IP, and they don't help when the provider's access to YouTube breaks.
What to look for in a provider
Before you build on another download API, check:
- It returns a file it hosts (or copies to your bucket), with a stated link lifetime, not a passthrough YouTube link.
- Failures are explicit and free. A job that can't get the video should fail with a clear error code (private, removed, sign-in required) and not charge you.
- It tells you when it's done. A webhook means you don't poll a link that might already be stale.
- It shows recent history. A public changelog or status page tells you whether breakages get fixed in days or weeks.
There's a longer build-vs-buy checklist on ytdlp.org.
The Importly version
Importly downloads the file and gives you a link to its own copy. Your backend sends the link the user gave you:
curl -X POST https://api.importly.io/import \
-H "Authorization: Bearer $IMPORTLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://www.youtube.com/watch?v=jNQXAC9IVRw", "webhookUrl": "https://your-app.com/hooks/importly"}'When the job finishes, the webhook (or GET /import/status) gives you mediaUrl, a signed link to the file on Importly storage that works from any server for 7 days. Add "store": true and the file is also copied into your own S3, R2 or B2 bucket (S3 storage). A failed import comes back with an error code like VIDEO_PRIVATE or AUTH_REQUIRED and costs nothing (billing).
A 10-minute 720p video costs about $0.15 to download, and it's free to try, no card required. The same key gets transcripts and metadata. Downloads has the full request and response.
FAQ
Why does the download link work in my browser but not on my server?
Because the link is usually tied to the IP address that requested it and to a short expiry. Your browser test happens right away and often from the same network; your server fetches it later from a different address.
Can I refresh an expired YouTube download link?
Not by editing it. The link is signed, so changing expire or ip invalidates it. Request a new one from the API, or use an API that returns a file it hosts.
Should I store the download URL in my database?
Store the original video link instead, and download the file into your own storage as soon as you have it. Direct YouTube links stop working within hours.
Is this a RapidAPI problem?
No. It applies to any API that returns YouTube's own media link, wherever it's listed. Check the host of the URL you get back.