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.

1

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. 1 Visit ofapi.dev/#get-access and choose a plan.
  2. 2 Complete checkout — your API key is shown instantly on the confirmation screen.
  3. 3 Copy the key and store it in your environment — you will not be shown it again.
.env Shell
OFAPI_KEY=your_api_key_here
2

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.

Terminal curl
curl -X GET \
  "http://157.180.79.226:4024/api/v1/onlyfans/models" \
  -H "X-API-Key: your_api_key_here"
Base URL: http://157.180.79.226:4024/api/v1/onlyfans — all endpoints are relative to this prefix.
3

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

Terminal curl
curl -X GET \
  "http://157.180.79.226:4024/api/v1/onlyfans/models" \
  -H "X-API-Key: your_api_key_here"
Response JSON
{
  "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.

4

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. 1 Log into the OFAPI dashboard.
  2. 2 Click Add Creator and enter their OnlyFans username or profile URL.
  3. 3 The creator authenticates via the secure OAuth flow — takes under 60 seconds.
  4. 4 Once connected, the creator appears in GET /models and all their data is immediately available.
Terminal curl
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"
5

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).

Python

pip
# Python SDK — uses the requests library
pip install requests
Python SDK docs →

JavaScript / Node.js

npm
# Node.js 18+ — no extra dependencies needed
# Node 16 or earlier only:
npm install node-fetch
JavaScript SDK docs →
6

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.

GET /statistics/overview
GET /stats/fans/top
GET /payouts/transactions
POST /messages/send
View full API reference →