BlogCore API

yt-dlp Blocked on Your Server? Use a Hosted API Instead

yt-dlp works on your laptop but fails on a VPS, AWS, serverless or an agent sandbox. Send the link to a hosted API and get the file back, with code, cost and the free fixes.

On this page6 sections

Short answer: yes, there are hosted APIs for this. If yt-dlp works on your laptop but fails on your VPS, EC2 box, Railway or Render service, serverless function or agent sandbox, you can send the link to a hosted media API like Importly and get the file, transcript or metadata back, with nothing to install or keep patched on the server. Your app makes one HTTP call, and the media lands in hosted storage or your own bucket.

Last checked: November 21, 2026.

If you'd rather keep self-hosting, the free fixes are further down. This page is for the case where your app has to keep working in production.

Why it fails on the server and not on your laptop

The command is the same. The network isn't. YouTube and other large sites treat traffic from cloud and datacenter IP ranges as bots far more often than traffic from a home connection, so a server that never signs in gets errors like:

output
ERROR: [youtube] VIDEO_ID: Sign in to confirm you're not a bot.
HTTP Error 403: Forbidden

Updating yt-dlp doesn't change where the request comes from, which is why the fix that worked last month stops working. The ytdlp.org server guide has a 30-second test that confirms it's the network and not your code.

The hosted API version: one request

With Importly, your backend sends the link and gets a job id back right away:

bash
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"}'
json
{ "success": true, "data": { "jobId": "a824760e-ece1-4415-8838-ce2a7785ea6b", "status": "queued" } }

Then poll the status endpoint, or pass a webhookUrl and get one POST when it finishes. Here is the polling version in Node, the kind of code you'd put behind an "import from URL" button:

ts
const API = 'https://api.importly.io'
const headers = {
  Authorization: `Bearer ${process.env.IMPORTLY_API_KEY}`,
  'Content-Type': 'application/json',
}

export async function importFromUrl(url: string) {
  const res = await fetch(`${API}/import`, { method: 'POST', headers, body: JSON.stringify({ url }) })
  const { data } = await res.json()

  for (;;) {
    await new Promise((resolve) => setTimeout(resolve, 3000))
    const status = await fetch(`${API}/import/status?id=${data.jobId}`, { headers }).then((r) => r.json())
    if (status.data.status === 'completed') return status.data.result.mediaUrl
    if (status.data.status === 'failed') throw new Error(status.data.message ?? 'Import failed')
  }
}

The same key works for transcripts (POST /transcribe, captions first and speech-to-text when a video has none) and metadata (POST /metadata). The quick start has the full request and response shapes, and there are full app recipes for Next.js and Python.

What it costs

Pay as you go, no plan. A 10-minute 720p video is about $0.15 to download, a caption transcript is $0.003, and speech-to-text is $0.01 per minute (pricing). It's free to try, no card required.

The free fixes, if you want to keep self-hosting

These are worth trying first, and for low volume one of them may be enough:

  • Download somewhere with a home connection (your machine, a home server, a Raspberry Pi) and move the file to the server.
  • Pass cookies from a throwaway logged-in account with --cookies. It helps for a while, and the account can get flagged. See the cookies guide.
  • Keep yt-dlp current and give it a JavaScript runtime. Missing formats in Docker are often the runtime, not the network (fix).
  • Slow down with --sleep-requests and less concurrency, so the server stays usable longer.

The limit is that none of these change the network your server is on, and all of them are things you maintain. When downloads are a feature your users depend on, a hosted API is usually cheaper than the time spent keeping a self-hosted setup alive. The longer trade-off is in yt-dlp API vs self-hosting.

Agents in cloud sandboxes

Coding agents running in Claude Code on the web, Codex or CI hit the same wall, plus the sandbox's own network rules. Why coding agents in cloud sandboxes can't download videos covers both, and what the app the agent is building should call instead.

FAQ

Is there a hosted API for yt-dlp?

There are hosted media APIs that do the same job from a URL. Importly takes a link from YouTube, TikTok, X, Instagram, podcasts and 1,000+ other sites and returns the file, a transcript or metadata through a REST API, from servers where self-hosted downloads get blocked.

Will updating yt-dlp fix "Sign in to confirm you're not a bot" on my server?

Usually not for long. Updating fixes extractor breakage, but this error is about where the request comes from, so it comes back on the same server.

Can I get the file into my own S3 or R2 bucket?

Yes. Set up S3 storage once and each import is delivered to your bucket, with a webhook when it lands.

Keep reading

Put video and audio links to work in your app

One API for files, transcripts and metadata. Free to try, no card required.

Try free →