Messages
Search Chat Messages
Searches messages within a chat by text content. Returns an array of matching message IDs — use with List Chat Messages (first_id or id) to fetch full message content. Requires permission api_messages_search.
https://public-api.fansmetric.comAuthorization
defaultAuthorizationBearer <token>Send your FansMetric API key as a Bearer token in the Authorization header.
In: header
Path Parameters
account_id*integerOnlyFans numeric account ID.
user_id*integerFan/user ID of the conversation.
Query Parameters
query*stringSearch text.
Response Fields
dataarrayArray of message IDs matching the search.
_meta._credits.usedintegerCredits consumed by this request (currently always
1)._meta._rate_limits.limit_minuteintegerMaximum requests per minute for the organization.
_meta._rate_limits.remaining_minuteintegerRemaining requests in the current minute window.
_meta._rate_limits.limit_dayintegerMaximum requests per day for the organization.
_meta._rate_limits.remaining_dayintegerRemaining requests in the current day window.
| Field | Type | Description |
|---|---|---|
| data | array | Array of message IDs matching the search. |
| _meta._credits.used | integer | Credits consumed by this request (currently always 1). |
| _meta._rate_limits.limit_minute | integer | Maximum requests per minute for the organization. |
| _meta._rate_limits.remaining_minute | integer | Remaining requests in the current minute window. |
| _meta._rate_limits.limit_day | integer | Maximum requests per day for the organization. |
| _meta._rate_limits.remaining_day | integer | Remaining requests in the current day window. |
curl --request GET "https://public-api.fansmetric.com/v1/100000001/chats/sample_user_id/messages/search?query=creator" \
--header "Authorization: Bearer YOUR_API_KEY"Response
200Behavior
Use the returned IDs with List Chat Messages to deep-link search results. A common pattern: GET .../messages?limit=10&order=desc&id={resultId + 1} loads messages around the result (using id = resultId + 1 ensures the target is included).