OnlyFans API
Chats

List ChatMessage

Get messages from a specific chat.

GET
/api/{account}/chats/{chat_id}/messages
AuthorizationBearer <token>

You can retrieve your token by visiting the OnlyFansAPI Console and clicking API Keys -> Create API Key.

In: header

Path Parameters

accountstring

The Account ID

chat_idstring

The ID of the chat (usually a fan's OnlyFans User ID)

Query Parameters

limit?string

Number of messages to return (10, 20, or 30)

id?string

ID of the last message from previous page. Used for pagination

order?string

Sort order for messages (desc or asc)

skip_users?string

Whether to skip user details (all or none)

Response Body

curl -X GET "https://app.onlyfansapi.com/api/acct_XXXXXXXXXXXXXXX/chats/458485726/messages?limit=10&id=111222333&order=desc&skip_users=all"
fetch("https://app.onlyfansapi.com/api/acct_XXXXXXXXXXXXXXX/chats/458485726/messages?limit=10&id=111222333&order=desc&skip_users=all")
package main

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

func main() {
  url := "https://app.onlyfansapi.com/api/acct_XXXXXXXXXXXXXXX/chats/458485726/messages?limit=10&id=111222333&order=desc&skip_users=all"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://app.onlyfansapi.com/api/acct_XXXXXXXXXXXXXXX/chats/458485726/messages?limit=10&id=111222333&order=desc&skip_users=all"

response = requests.request("GET", url)

print(response.text)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.time.Duration;

HttpClient client = HttpClient.newBuilder()
  .connectTimeout(Duration.ofSeconds(10))
  .build();

HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
  .uri(URI.create("https://app.onlyfansapi.com/api/acct_XXXXXXXXXXXXXXX/chats/458485726/messages?limit=10&id=111222333&order=desc&skip_users=all"))
  .GET()
  .build();

try {
  HttpResponse<String> response = client.send(requestBuilder.build(), BodyHandlers.ofString());
  System.out.println("Status code: " + response.statusCode());
  System.out.println("Response body: " + response.body());
} catch (Exception e) {
  e.printStackTrace();
}
using System;
using System.Net.Http;
using System.Text;

var client = new HttpClient();
var response = await client.GetAsync("https://app.onlyfansapi.com/api/acct_XXXXXXXXXXXXXXX/chats/458485726/messages?limit=10&id=111222333&order=desc&skip_users=all");
var responseBody = await response.Content.ReadAsStringAsync();
{
  "data": {
    "list": [
      {
        "responseType": "message",
        "text": "<p>Message text</p>",
        "giphyId": null,
        "lockedText": false,
        "isFree": true,
        "price": 0,
        "isMediaReady": true,
        "mediaCount": 1,
        "media": [
          {
            "id": 3581806503,
            "type": "photo",
            "convertedToVideo": false,
            "canView": true,
            "hasError": false,
            "createdAt": null,
            "isReady": true,
            "files": {
              "full": {
                "url": "https://cdn2.onlyfans.com/files/...",
                "width": 3840,
                "height": 5760,
                "size": 0,
                "sources": []
              }
            },
            "duration": 0,
            "hasCustomPreview": false
          }
        ],
        "previews": [],
        "isTip": false,
        "isReportedByMe": false,
        "isCouplePeopleMedia": false,
        "queueId": 123,
        "isMarkdownDisabled": true,
        "fromUser": {
          "id": 458485726,
          "_view": "s"
        },
        "isFromQueue": false,
        "id": 123,
        "isOpened": false,
        "isNew": false,
        "createdAt": "2025-01-27T23:34:25+00:00",
        "changedAt": "2025-01-27T23:34:25+00:00",
        "cancelSeconds": 0,
        "isLiked": false,
        "canPurchase": false,
        "canPurchaseReason": "free",
        "canReport": true,
        "canBePinned": true,
        "isPinned": false
      }
    ],
    "hasMore": true
  },
  "_meta": {
    "_credits": {
      "used": 1,
      "balance": 1,
      "note": "Always"
    },
    "_cache": {
      "is_cached": false,
      "note": "Cache disabled for this endpoint"
    },
    "_rate_limits": {
      "limit_minute": 1000,
      "limit_day": 50000,
      "remaining_minute": 999,
      "remaining_day": 49999
    }
  }
}