OnlyFans API

Downloading Media from OnlyFans CDN

Learn how to download photos/videos/audio from OnlyFans CDN URLs and store them locally or in your cloud storage.

OnlyFans API makes it easy to download media files directly from OnlyFans CDN URLs. You can download photos, videos, and audio files by calling our download endpoint with the CDN URL.

Download media from OnlyFans CDN

The full media download endpoint documentation can be found here.

Media can be downloaded by calling GET https://app.onlyfansapi.com/api/{account}/media/download/{ONLYFANS_CDN_URL}.

The {ONLYFANS_CDN_URL} parameter should be a URL from any OnlyFans CDN subdomain (i.e. anything matching https://cdn*.onlyfans.com/*, such as cdn2.onlyfans.com, cdn3.onlyfans.com, etc.). A typical URL looks like https://cdn2.onlyfans.com/files/e/e5/123/600x400_123.jpg?Tag=2&u=123&Policy=123&Signature=signature&Key-Pair-Id=123. You can just enter the OnlyFans CDN URL after the .../media/download/{ONLYFANS_CDN_URL} without any need for encoding the URL.

curl --location 'https://app.onlyfansapi.com/api/{account}/media/download/https://cdn2.onlyfans.com/files/e/e5/123/600x400_123.jpg?Tag=2&u=123&Policy=123&Signature=signature&Key-Pair-Id=123' \
     --header 'Authorization: Bearer {token}' \
     --output 'downloaded-media.jpg'

The endpoint streams the media file directly as a binary response, forwarding the upstream Content-Type from the OnlyFans CDN (e.g. image/jpeg, video/mp4, audio/mpeg). Save the response bytes to disk or process them as needed. There's no intermediate URL or re-hosted copy.

Detecting file type

Signed CDN URLs often carry query parameters (e.g. ?Tag=…&Signature=…) and may not have a clean file extension. Inspect the response's Content-Type header to determine how to handle the file rather than parsing the URL.

🚀 Bulk downloads: export your entire Media Vault

Downloading the full Media Vault one CDN URL at a time is slow and rate-limited. For bulk use cases, use our Data Exports feature instead, which packages your entire Media Vault (every photo, video, and audio file) into a single ZIP file you can download once it's ready.

This is the recommended approach for:

  • AI / LoRA training datasets: Get every asset in one archive instead of stitching together thousands of individual downloads. See Download Media and Chats for LLM and LoRA Training for a worked example.
  • Backups and platform migration: Snapshot the full vault for disaster recovery or before switching platforms. See Complete Data Backup and Migration.
  • Bulk content repurposing: Pull your full media library at original quality for use elsewhere.

You can kick off a Media export from the Data Exports dashboard (no code) or programmatically via the Create Data Export API. Big vaults may take several hours to package; you can close the browser and come back later to download the result.

Migrating from the deprecated scrape endpoint

The previous POST /api/{account}/media/scrape endpoint is deprecated. If you have an existing integration built against it, here's what changes when you switch to the new download endpoint:

  • Response shape: The deprecated endpoint re-hosted the file on the OnlyFans API CDN and returned a URL. The new endpoint streams the file binary directly in the response, so you'll need to save the bytes (not a URL) on your side.
  • File size limit: The new endpoint has no file size limit. The deprecated endpoint capped uploads at 500MB.
  • Input format: The new endpoint accepts a CDN URL only. Vault Media IDs (which the deprecated endpoint accepted) are not supported here.

On this page