Getting Started with the OnlyFans API
From zero to your first live API call in under five minutes. This guide covers API key setup, authentication, making requests, and installing an SDK.
On This Page
Get Your API Key
All access to the OnlyFans API is gated by an API key. Keys are issued immediately on sign-up — no waiting period, no approval queue. Each key is scoped to your account and grants access to all creators you manage.
- 1 Visit ofapi.dev/#get-access and choose a plan.
- 2 Complete checkout — your API key is shown instantly on the confirmation screen.
- 3 Copy the key and store it in your environment — you will not be shown it again.
OFAPI_KEY=your_api_key_here Authentication
Every request must include the X-API-Key header. There are no cookies, sessions, or OAuth flows — just a single header on every call. Requests without a valid key receive a 401 Unauthorized response.
curl -X GET \
"http://157.180.79.226:4024/api/v1/onlyfans/models" \
-H "X-API-Key: your_api_key_here" http://157.180.79.226:4024/api/v1/onlyfans — all endpoints are relative to this prefix.
Your First API Call
Start by calling GET /models to retrieve all creators linked to your account. This confirms your key is valid and shows you the creator_id values you will use in subsequent calls.
GET /onlyfans/models
curl -X GET \
"http://157.180.79.226:4024/api/v1/onlyfans/models" \
-H "X-API-Key: your_api_key_here" {
"models": [
{
"id": "creator_abc123",
"username": "yourmodel",
"display_name": "Your Model Name",
"status": "active",
"connected_at": "2026-01-15T08:00:00Z"
}
],
"total": 1
}
Save the id values — you pass these as creator_id query parameters when calling analytics and revenue endpoints.
Connect a Creator
To pull data for a creator, they must be linked to your API account. The connection flow is handled through the dashboard — no API calls required.
- 1 Log into the OFAPI dashboard.
- 2 Click Add Creator and enter their OnlyFans username or profile URL.
- 3 The creator authenticates via the secure OAuth flow — takes under 60 seconds.
- 4 Once connected, the creator appears in
GET /modelsand all their data is immediately available.
curl -X GET \
"http://157.180.79.226:4024/api/v1/onlyfans/models/creator_abc123/statistics/overview" \
-H "X-API-Key: your_api_key_here" Install an SDK
The API is plain HTTP/REST — any language with an HTTP client works. The officially supported SDKs are Python (via requests) and JavaScript / Node.js (native fetch).
JavaScript / Node.js
# Node.js 18+ — no extra dependencies needed
# Node 16 or earlier only:
npm install node-fetch Explore Endpoints
With authentication confirmed and a creator connected, you have access to all 17+ endpoints. The most commonly used starting points are revenue statistics, top fan rankings, and payout transactions.
/statistics/overview /stats/fans/top /payouts/transactions /messages/send