Response Structure
Understanding API response format, metadata, and headers
Response Format
Every API response follows a consistent structure with two main components:
- The
datafield containing OnlyFans information - Optional
_paginationfield with pagination information, if the endpoint is paginated - The
_metaobject containing request metadata
Here's an example response:
Response Body Structure
We have removed our daily rate limits!
We have decided to remove our daily rate limits. Please remove any references to these values in your integrations.
{
"data": {
// OnlyFans response data
"view": "f",
"avatar": "https://...",
"isFriend": false,
"isBlocked": false,
"canReport": false
},
"_meta": {
"_credits": {
"used": 0,
"balance": 9852,
"note": "Cache HIT. No credits debited"
},
"_cache": {
"is_cached": true,
"cached_at": "2025-01-29T16:30:43+00:00",
"note": "Add ?fresh=true to the request URL to skip the cache and get a fresh response from OnlyFans"
},
"_rate_limits": {
"limit_minute": 60,
"limit_day": null, // Legacy
"remaining_minute": 59,
"remaining_day": null, // Legacy
"notice": "We have decided to remove our daily rate limits. Please remove any references to this in your integrations."
}
}
}The data Field
The data field always contains the actual OnlyFans response data. Its structure varies depending on the endpoint being called. For example:
- Profile information for
/profiles/{username} - Message data for
/messagesendpoints - Subscriber data for
/subscribersendpoints
The optional _pagination field
Some endpoints return paginated data. For example, /chats, /chats/XYZ/messages or /tracking-links.
In this case, the response will include a _pagination field with the next_page field that you can use to fetch the next page of results.
If there are no more pages, the next_page field will be null.
{
"data": {
// OnlyFans response data
},
"_meta": {
"_pagination": {
"next_page": "https://app.onlyfansapi.com/api/acct_XXXXXXXXXXX/chats/?offset=10&limit=10"
}
}
}The _meta Object
The _meta object contains three sections of metadata about your request:
-
_credits: Credit usage informationused: Credits consumed by this requestbalance: Your remaining credit balancenote: Additional information about credit usage
-
_cache: Caching status and informationis_cached: Whether this response was served from cachecached_at: When the response was cachednote: Instructions for bypassing cache if needed
-
_rate_limits: Rate limiting informationlimit_minute: Requests allowed per minutelimit_day: Legacy: Requests allowed per day (removed)remaining_minute: Remaining requests this minuteremaining_day: Legacy: Remaining requests today (removed)
Response Headers
Each response includes comprehensive metadata in the headers:
| Header | Value | Category | Description |
|---|---|---|---|
content-type | application/json | Content Headers | Always application/json |
x-ofapi-credits-balance | 9852 | Credit Headers | Your remaining credit balance |
x-ofapi-credits-used | 0 | Credit Headers | Credits used by this request |
x-ofapi-is-cached | true | Credit Headers | Whether response was cached |
x-rate-limit-limit-day | 1000 | Rate Limit Headers | Legacy: Removed |
x-rate-limit-limit-minute | 60 | Rate Limit Headers | Per-minute limit |
x-rate-limit-remaining-day | 988 | Rate Limit Headers | Legacy: Removed |
x-rate-limit-remaining-minute | 59 | Rate Limit Headers | Remaining minute requests |
Cache Control
You can control caching behavior using query parameters:
- By default, responses are cached when possible (only for public endpoints)
- Add
?fresh=trueto force a fresh response from OnlyFans - Cached responses don't consume credits
- Cache duration varies by endpoint
The same information is available in both headers and the _meta object. Use
headers for quick access in code, and the _meta object for more detailed
information including notes and timestamps.