Fansly API LogoFansly API
Chats

Get Chat Media Stats

Get creator's media stats for a specific chat.

Retrieve the media the creator has sent to a fan in a specific chat, along with stats on each item. including whether it was purchased (PPV).

https://v1.apifansly.com/api/fansly
GET
/{accountId}/chats/{chatid}/media-stats

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/{accountId}/chats/{chatid}/media-stats" \
      -H "x-api-key: YOUR_API_KEY"
    fetch("https://v1.apifansly.com/api/fansly/{accountId}/chats/{chatid}/media-stats", {
      method: "GET",
      headers: {
        "x-api-key": "YOUR_API_KEY"
      }
    })
    import requests

    url = "https://v1.apifansly.com/api/fansly/{accountId}/chats/{chatid}/media-stats"
    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/{accountId}/chats/{chatid}/media-stats"))
            .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/{accountId}/chats/{chatid}/media-stats");
    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/{accountId}/chats/{chatid}/media-stats"
        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

accountId*
string
The unique identifier for the connected account.
chatid*
string
The unique identifier of the chat to retrieve media stats from.

Query Parameters

cursor ?
string
Pagination cursor from a previous response's nextCursor. Omit to fetch the first page.

Empty Responses & Rate Limiting

This endpoint might sometimes not return data. To ensure the best experience, consider adding a 1-minute gap between your requests.

Purchased Media

To find out which media was bought, look for saleStats in the response.

Response

    {
        "statusCode": 200,
        "message": "Success",
        "data": {
            "status_code": 200,
            "data": {
                "success": true,
                "response": {
                    "data": [
                        {
                            "id": "item_id_here",
                            "mediaOfferId": "media_offer_id_here",
                            "mediaOfferType": "media_offer_type_here",
                            "mediaOfferBundleId": null,
                            "mediaId": "media_id_here",
                            "mediaType": "media_type_here",
                            "previewId": null,
                            "accountId": "account_id_here",
                            "locationId": "chat_id_here",
                            "correlationId": "correlation_id_here",
                            "locationType": "location_type_here"
                        }
                    ],
                    "aggregationData": {
                        "accountMedia": [
                            {
                                "id": "account_media_id_here",
                                "mediaId": "media_id_here",
                                "price": "price_in_cents_here",
                                "deleted": false,
                                "likeCount": "like_count_here",
                                "purchased": "purchased_bool_here",
                                "whitelisted": "whitelisted_bool_here",
                                "access": "access_bool_here",
                                "media": {
                                    "id": "media_id_here",
                                    "type": "media_type_here",
                                    "mimetype": "mimetype_here",
                                    "filename": "filename_here",
                                    "width": "width_here",
                                    "height": "height_here",
                                    "locations": [
                                        {
                                            "locationId": "location_id_here",
                                            "location": "signed_cdn_url_here"
                                        }
                                    ],
                                    "variants": [
                                        {
                                            "id": "variant_id_here",
                                            "type": "variant_type_here",
                                            "mimetype": "variant_mimetype_here",
                                            "width": "variant_width_here",
                                            "height": "variant_height_here",
                                            "locations": [
                                                {
                                                    "locationId": "location_id_here",
                                                    "location": "signed_cdn_url_here"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            }
                        ]
                    }
                }
            },
            "nextCursor": "next_cursor_here"
        },
        "timestamp": "iso_8601_timestamp_here"
    }

Response Body

FieldTypeDescription
statusCodenumberHTTP status code of the response (200)
messagestringA human-readable status message
dataobjectThe main response payload
├─ status_codenumberInternal Fansly operation status code
├─ dataobjectNested data container
│ ├─ successbooleanWhether the request was successful
│ └─ responseobjectThe media stats payload for the chat
│ ├─ dataarrayList of media offers sent to the fan in this chat
│ │ ├─ idstringUnique identifier of the media offer item
│ │ ├─ mediaOfferIdstringID of the media offer
│ │ ├─ mediaOfferTypenumberInternal type flag for the offer (e.g. single media vs. bundle)
│ │ ├─ mediaOfferBundleIdstring | nullID of the bundle this offer belongs to, if applicable
│ │ ├─ mediaIdstringID of the underlying media asset
│ │ ├─ mediaTypenumberMedia type (e.g. image, video)
│ │ ├─ previewIdstring | nullID of the preview media, if one was set
│ │ ├─ accountIdstringAccount ID of the creator who sent the media
│ │ ├─ locationIdstringID of the chat the media was sent in
│ │ ├─ correlationIdstringID correlating this item to its originating message
│ │ └─ locationTypenumberInternal type flag for the location (e.g. direct message)
│ └─ aggregationDataobjectFull details for each media item referenced in data
│ └─ accountMediaarrayMedia items with stats and purchase status
│ ├─ idstringAccount media ID
│ ├─ mediaIdstringUnderlying media asset ID
│ ├─ pricenumberUnlock price, in cents (0 if not paywalled)
│ ├─ deletedbooleanWhether the media has been deleted
│ ├─ likeCountnumberNumber of likes on the media
│ ├─ purchasedbooleanWhether the fan has purchased this media
│ ├─ whitelistedbooleanWhether the fan has standing access regardless of purchase
│ ├─ accessbooleanWhether the fan currently has access to view the media
│ └─ mediaobjectMedia asset details (type, mimetype, filename, width, height, locations, variants)
└─ nextCursorstring | nullCursor to fetch the next page. null when there are no more items
timestampstringISO 8601 timestamp of when the response was generated

On this page