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 retrieves the corresponding media file, allowing you to programmatically download images, videos, or other media content hosted on Fansly's infrastructure.
https://v1.apifansly.com
POST
/api/fansly/media/download
Get Started
All requests to the Fansly API require an API Key. See the Authentication page for details.
curl -X POST "https://v1.apifansly.com/api/fansly/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/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/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.contentimport 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/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/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/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*
stringThe 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
Response
Success Response
When the download is successful, the endpoint returns the media file data.
Status Code: 200 OK
Error Responses
| Status Code | Description |
|---|---|
400 Bad Request | Invalid CDN URL format or missing required parameters |
401 Unauthorized | Invalid or missing API key |
403 Forbidden | API key doesn't have permission to access the requested media |
404 Not Found | The specified CDN URL doesn't exist or the media file is unavailable |
Usage Notes
- CDN URL Validity: Ensure the CDN URL is valid and not expired. Some Fansly CDN URLs include time-limited access tokens in the query parameters.
- File Size Considerations: Large media files may take longer to download. Consider implementing timeout handling for video files or high-resolution images.
- Rate Limiting: Be mindful of API rate limits when downloading multiple media files in succession.
- URL Encoding: The CDN URL should be properly formatted in the JSON body. Special characters in query parameters are typically already encoded in Fansly CDN URLs.
- Media Types: This endpoint supports various media types including images (JPEG, PNG, GIF) and videos (MP4, etc.).