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*
stringThe unique identifier for the connected account.
chatid*
stringThe unique identifier of the chat to retrieve media stats from.
Query Parameters
cursor ?
stringPagination 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
| Field | Type | Description |
|---|---|---|
statusCode | number | HTTP status code of the response (200) |
message | string | A human-readable status message |
data | object | The main response payload |
├─ status_code | number | Internal Fansly operation status code |
├─ data | object | Nested data container |
│ ├─ success | boolean | Whether the request was successful |
│ └─ response | object | The media stats payload for the chat |
│ ├─ data | array | List of media offers sent to the fan in this chat |
│ │ ├─ id | string | Unique identifier of the media offer item |
│ │ ├─ mediaOfferId | string | ID of the media offer |
│ │ ├─ mediaOfferType | number | Internal type flag for the offer (e.g. single media vs. bundle) |
│ │ ├─ mediaOfferBundleId | string | null | ID of the bundle this offer belongs to, if applicable |
│ │ ├─ mediaId | string | ID of the underlying media asset |
│ │ ├─ mediaType | number | Media type (e.g. image, video) |
│ │ ├─ previewId | string | null | ID of the preview media, if one was set |
│ │ ├─ accountId | string | Account ID of the creator who sent the media |
│ │ ├─ locationId | string | ID of the chat the media was sent in |
│ │ ├─ correlationId | string | ID correlating this item to its originating message |
│ │ └─ locationType | number | Internal type flag for the location (e.g. direct message) |
│ └─ aggregationData | object | Full details for each media item referenced in data |
│ └─ accountMedia | array | Media items with stats and purchase status |
│ ├─ id | string | Account media ID |
│ ├─ mediaId | string | Underlying media asset ID |
│ ├─ price | number | Unlock price, in cents (0 if not paywalled) |
│ ├─ deleted | boolean | Whether the media has been deleted |
│ ├─ likeCount | number | Number of likes on the media |
│ ├─ purchased | boolean | Whether the fan has purchased this media |
│ ├─ whitelisted | boolean | Whether the fan has standing access regardless of purchase |
│ ├─ access | boolean | Whether the fan currently has access to view the media |
│ └─ media | object | Media asset details (type, mimetype, filename, width, height, locations, variants) |
└─ nextCursor | string | null | Cursor to fetch the next page. null when there are no more items |
timestamp | string | ISO 8601 timestamp of when the response was generated |