Fansly API LogoFansly API
Media

Download Media

Download media files from the Fansly Content Delivery Network (CDN).

This endpoint downloads media files from the Fansly Content Delivery Network (CDN). It accepts a CDN URL and gets the corresponding media file, allowing you to programmatically download images, videos, or other media content hosted on Fansly's infrastructure.

https://v1.apifansly.com/api/fansly
POST
/{account_id}/media/download

Get Started

All requests to the Fansly API require an API Key. See the Authentication page for details.

Path Parameters

accountId*
string
The ID of the connected Fansly account to download on behalf of. The download is made using that account's session and proxy, so it must be an account connected to your API key.
curl -X POST "https://v1.apifansly.com/api/fansly/fansly_acc_123/media/download" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "cdnUrl": "https://cdn3.fansly.com/xxxxxxx/xxxxxxxx.jpeg?ngsw-bypass=true&Policy=eyJTdGF0..."
  }'
fetch("https://v1.apifansly.com/api/fansly/fansly_acc_123/media/download", {
  method: "POST",
  headers: {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "cdnUrl": "https://cdn3.fansly.com/865407923461840896/874741462745509891.jpeg?ngsw-bypass=true&Policy=eyJTdGF0..."
  })
})
import requests

url = "https://v1.apifansly.com/api/fansly/fansly_acc_123/media/download"
headers = {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "cdnUrl": "https://cdn3.fansly.com/865407923461840896/874741462745509891.jpeg?ngsw-bypass=true&Policy=eyJTdGF0..."
}

response = requests.post(url, headers=headers, json=data)
# Binary content is in response.content
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

String jsonBody = "{\"cdnUrl\": \"https://cdn3.fansly.com/865407923461840896/874741462745509891.jpeg?ngsw-bypass=true&Policy=eyJTdGF0...\"}";

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("https://v1.apifansly.com/api/fansly/fansly_acc_123/media/download"))
        .header("x-api-key", "YOUR_API_KEY")
        .header("Content-Type", "application/json")
        .POST(HttpRequest.BodyPublishers.ofString(jsonBody))
        .build();

client.sendAsync(request, HttpResponse.BodyHandlers.ofByteArray())
        .thenApply(HttpResponse::body)
        .thenAccept(bytes -> System.out.println("Downloaded " + bytes.length + " bytes"))
        .join();
using System.Net.Http;
using System.Text;
using System.Text.Json;

var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY");

var json = JsonSerializer.Serialize(new { 
    cdnUrl = "https://cdn3.fansly.com/865407923461840896/874741462745509891.jpeg?ngsw-bypass=true&Policy=eyJTdGF0..." 
});
var content = new StringContent(json, Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://v1.apifansly.com/api/fansly/fansly_acc_123/media/download", content);
var bytes = await response.Content.ReadAsByteArrayAsync();
package main

import (
    "bytes"
    "encoding/json"
    "net/http"
)

func main() {
    url := "https://v1.apifansly.com/api/fansly/fansly_acc_123/media/download"
    
    values := map[string]string{
        "cdnUrl": "https://cdn3.fansly.com/865407923461840896/874741462745509891.jpeg?ngsw-bypass=true&Policy=eyJTdGF0...",
    }
    jsonData, _ := json.Marshal(values)

    req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
    req.Header.Set("x-api-key", "YOUR_API_KEY")
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()
    // Process resp.Body for binary data
}

Request Body

The request accepts a JSON payload with the following parameter:

cdnUrl*
string
The full CDN URL of the media file you want to download. This should be a valid Fansly CDN URL (e.g., https://cdn3.fansly.com/...)

CDN URL Format

The cdnUrl should include:

  • The full CDN domain (e.g., cdn3.fansly.com)
  • The media file path with identifiers
  • Any required query parameters (Policy, Signature, Key-Pair-Id, etc.) for authenticated access

Accepted Hosts

For security, only Fansly media hosts are accepted. The URL must use HTTPS and its host must be one of:

HostPurpose
cdn<n>.fansly.comSigned media delivery — e.g. cdn1, cdn3, cdn12

Any other host is rejected with 400 Bad Request.

Response

Success Response

When the download is successful, the endpoint returns the media file data.

Status Code: 200 OK

On this page