Fansly API LogoFansly API
StatisticsNewBeta

Get Top Media

Get the best-performing media in a date range.

https://v1.apifansly.com/api/fansly
GET
/{account_id}/stats/media/topmedia

Get Started

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

curl -X GET "https://v1.apifansly.com/api/fansly/{account_id}/stats/media/topmedia?source=forYou&mediaType=video&orderBy=views&limit=20&after=1791936000000&before=1794441600000" \
  -H "x-api-key: YOUR_API_KEY"
fetch("https://v1.apifansly.com/api/fansly/{account_id}/stats/media/topmedia?source=forYou&mediaType=video&orderBy=views&limit=20&after=1791936000000&before=1794441600000", {
  method: "GET",
  headers: {
    "x-api-key": "YOUR_API_KEY"
  }
})
.then(response => response.json())
.then(data => console.log(data));
import requests

url = "https://v1.apifansly.com/api/fansly/{account_id}/stats/media/topmedia?source=forYou&mediaType=video&orderBy=views&limit=20&after=1791936000000&before=1794441600000"
headers = {
    "x-api-key": "YOUR_API_KEY"
}

response = requests.get(url, headers=headers)
print(response.json())
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newHttpClient();

HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("https://v1.apifansly.com/api/fansly/{account_id}/stats/media/topmedia?source=forYou&mediaType=video&orderBy=views&limit=20&after=1791936000000&before=1794441600000"))
        .header("x-api-key", "YOUR_API_KEY")
        .GET()
        .build();

client.sendAsync(request, HttpResponse.BodyHandlers.ofString())
        .thenApply(HttpResponse::body)
        .thenAccept(System.out::println)
        .join();
using System.Net.Http;
using System.Threading.Tasks;

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

var response = await client.GetAsync("https://v1.apifansly.com/api/fansly/{account_id}/stats/media/topmedia?source=forYou&mediaType=video&orderBy=views&limit=20&after=1791936000000&before=1794441600000");
var responseString = await response.Content.ReadAsStringAsync();

Console.WriteLine(responseString);
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    url := "https://v1.apifansly.com/api/fansly/{account_id}/stats/media/topmedia?source=forYou&mediaType=video&orderBy=views&limit=20&after=1791936000000&before=1794441600000"
    req, _ := http.NewRequest("GET", url, nil)
    req.Header.Set("x-api-key", "YOUR_API_KEY")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    body, _ := ioutil.ReadAll(resp.Body)
    fmt.Println(string(body))
}

Path Parameters

account_id*
string
The unique identifier for the connected account, retrieved from your Dashboard.

Query Parameters

source*
string
Where the views came from: forYou, timeline or others.
orderBy*
string
Sort by views, uniqueViewers, watchMs or completedViews.
mediaType ?
string
all, image or video. Defaults to all.
after*
number
Start of the date range, Unix timestamp (ms).
before*
number
End of the date range, Unix timestamp (ms).
limit ?
number
Max media to return.

Response

Shortened: media.variants and all CDN locations are removed. aggregationData.accountMedia has the details of each offer in offers, matched by mediaOfferId. In the response, source and mediaType are Fansly's codes: source 0 For You, 1 Timeline, 4 Others; mediaType 1 image, 2 video.

{
    "statusCode": 200,
    "message": "Success",
    "data": {
        "status_code": 200,
        "data": {
            "success": true,
            "response": {
                "afterBucket": 1791936000000,
                "beforeBucket": 1794441600000,
                "source": 0,
                "mediaType": 2,
                "offers": [
                    {
                        "mediaOfferId": "media_offer_identifier",
                        "bestMediaId": "media_identifier",
                        "media": [
                            {
                                "mediaOfferId": "media_offer_identifier",
                                "mediaId": "media_identifier",
                                "mediaType": 2,
                                "durationMs": 5400,
                                "views": 4,
                                "impressions": 4,
                                "watchMs": 4681,
                                "videoViews": 4,
                                "completedViews": 0,
                                "watchPctSum": 8668,
                                "replays": 0,
                                "uniqueViewers": 4
                            }
                        ],
                        "likes": 0,
                        "unlikes": 0
                    }
                ],
                "aggregationData": {
                    "accountMedia": [
                        {
                            "id": "media_offer_identifier",
                            "accountId": "creator_account_identifier",
                            "mediaId": "media_identifier",
                            "previewId": null,
                            "permissionFlags": 0,
                            "price": 0,
                            "createdAt": 1794412366,
                            "deletedAt": null,
                            "deleted": false,
                            "permissions": {
                                "permissionFlags": [],
                                "accountPermissionFlags": {
                                    "flags": 255,
                                    "metadata": "{}"
                                }
                            },
                            "bundles": [],
                            "likeCount": 0,
                            "media": {
                                "id": "media_identifier",
                                "type": 2,
                                "status": 1,
                                "accountId": "creator_account_identifier",
                                "mimetype": "video/mp4",
                                "flags": 134,
                                "filename": "cherry_blossom_wink_animation.mp4",
                                "location": "/creator_account_identifier/media_identifier.mp4",
                                "width": 380,
                                "height": 336,
                                "metadata": "{\"originalHeight\":336,\"originalWidth\":380,\"duration\":5.4,\"resolutionMode\":1,\"frameRate\":30}",
                                "updatedAt": 1794412337,
                                "createdAt": 1794412334,
                                "variants": [],
                                "variantHash": {},
                                "locations": []
                            },
                            "purchased": true,
                            "whitelisted": true,
                            "accountPermissionFlags": 255,
                            "access": true
                        }
                    ],
                    "accountMediaBundles": [],
                    "creatorMediaOfferLocations": [
                        {
                            "id": "offer_location_identifier",
                            "mediaOfferId": "media_offer_identifier",
                            "mediaOfferType": 2001,
                            "mediaOfferBundleId": null,
                            "mediaId": "media_identifier",
                            "mediaType": 2,
                            "previewId": null,
                            "accountId": "creator_account_identifier",
                            "locationId": "creator_account_identifier",
                            "correlationId": "correlation_identifier",
                            "createdAt": 1794412366000
                        }
                    ]
                }
            }
        }
    },
    "timestamp": "2026-11-12T13:42:58.341Z"
}

On this page