We just released our native n8n integration!» Try now
OnlyFans API
Chat Messages

Search Chat Messages

Search messages in a specific chat. Returns a list of message IDs matching the search query.

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

Get your API Key from OnlyFansAPI Console - https://app.onlyfansapi.com/api-keys

In: header

Path Parameters

accountstring

The Account ID

chat_idstring

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

Query Parameters

querystring

The query search in messages

querystring

Response Body

curl -X GET "https://app.onlyfansapi.com/api/string/chats/string/messages/search?query=Hello" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "quasi"
  }'
{
  "data": [
    123,
    456,
    789
  ],
  "_meta": {
    "_credits": {
      "used": 1,
      "balance": 999999892,
      "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": 49979
    }
  }
}