THE ONLYFANS API
The OnlyFans API for agencies and developers — Fansly included
OnlyFans has no public developer API. The Only API is the third-party OnlyFans API that closes that gap — 200+ documented REST endpoints for messaging, mass DMs, fans, subscribers, earnings, payouts, posts, the vault, campaigns, and data export. The same API covers Fansly, normalized to identical request and response shapes. Sub-100ms average responses, unlimited API calls on every paid slot, and a free plan with 1 account and 1,000 calls per month so you can build and verify before you pay.
Does OnlyFans have an API?
Not officially. OnlyFans does not publish a developer API, issue API keys, or run a developer portal. So when agencies and developers search for an "OnlyFans API," what they actually need is a reliable third-party layer that turns the platform into clean, authenticated REST endpoints — without scraping the web app or maintaining brittle browser automation.
That is exactly what The Only API provides. We handle login (email and password with automatic Cloudflare Turnstile captcha solving, 2FA/OTP challenges, or direct session-cookie connection), session management, per-account proxy binding, request signing, and human-realistic pacing, then expose 200+ endpoints under a single API key. You write normal HTTP requests; we keep the connection alive and safe.
The same API covers Fansly. Connect a Fansly account with its session credentials and the endpoints you already call — single DMs, earnings, transactions, subscribers, fans, exports — return the same normalized shapes, so you write the integration once. A handful of capabilities remain OnlyFans-only (mass DMs, payout requests, campaign claimers, PPV stats) and return an explicit 501 PLATFORM_NOT_SUPPORTED rather than failing quietly.
What the OnlyFans API covers
Every endpoint group below is available on all plans — no feature is locked behind a higher tier. The free plan includes 1,000 API calls per month; paid slots are unlimited. Rows note where a capability is OnlyFans-only.
| Feature | The Only API | Official OnlyFans API |
|---|---|---|
| Messaging & single DMs | Send a DM or PPV to one fan via POST /accounts/{of_user_id}/chats/{with_user_id}/messages, with vault media (mediaFiles), free teaser previews, and a price for PPV. Read conversations and mark read. OnlyFans and Fansly. | — |
| Mass DMs (OnlyFans only) | Resolve an audience from the subscriber cache — active, all, or expired, plus min_spent, a subscribed_at date window, or explicit fan_ids — then send. Runs as a dry-run preview by default, returning recipient counts and a sample before anything is delivered. | — |
| Posts & vault | Create feed posts and stories, schedule them per timezone, set paywall pricing, and manage vault media for reuse across accounts. | — |
| Fans & subscribers | List and segment fans, read spend and engagement, tag fans, and pull active/expired subscriber lists. Cached subscriber and stats endpoints cost zero platform requests and normalize OnlyFans and Fansly rows to the same shape. | — |
| Earnings & payouts | Read earnings by period and category, plus transaction-level history (tips, PPV, subscriptions, refunds) on OnlyFans and Fansly. Requesting and tracking payouts is OnlyFans-only. | — |
| Campaigns & automations | Create campaigns, build rules (trigger → conditions → action), and run win-back and tip-auto-reply flows. Per-campaign claimer enumeration is OnlyFans-only. | — |
| Data export | POST /accounts/{of_user_id}/exports queues a full account export — messages, tips, subscribers, and earnings — by date range, in CSV or JSON. List jobs, poll status, download the result, or cancel a running job. | — |
| MCP server for AI agents | A hosted MCP server resolves an API key to your panel via GET /api/whoami, so Claude and ChatGPT can query your accounts, fans, and earnings directly in natural language. | — |
| Events & webhooks | Subscribe to HMAC-SHA256-signed webhooks for every event, with [5s, 30s, 5m, 30m, 2h] retries and auto-deactivation, plus an SSE stream. Webhooks on a not-yet-approved domain start as 'pending' until a one-time domain review clears them. | — |
| Platform coverage | OnlyFans and Fansly through one normalized API. Both platforms: single DMs, earnings, transactions, subscribers, fans, and exports. OnlyFans-only: mass DMs, payout requests, campaign claimers, and PPV stats — these return HTTP 501 PLATFORM_NOT_SUPPORTED for Fansly accounts. | — |
“Official OnlyFans API” column is “—” because OnlyFans publishes no equivalent public developer API as of 2026.
A real OnlyFans API request
Send a welcome DM with a vault attachment. Authentication is a single X-API-Key header. Note that crm_id, of_user_id and the fan id are path parameters, not body fields, and that write actions must be enabled once per account before a send succeeds. Message text is delivered verbatim — there is no per-fan token substitution, so personalize by sending per-fan text from your own code.
# 1. One-time per account: enable write actions.
# Without this, sending returns 403 {"code": "WRITES_DISABLED"}.
curl -X PATCH https://theonlyapi.com/api/crm/$CRM_ID/accounts/$OF_USER_ID/polling \
-H "X-API-Key: $YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "allow_of_write_actions": true }'
# 2. Send a welcome DM with a vault attachment.
# price > 0 makes it a PPV; "previews" is the free teaser subset.
curl -X POST https://theonlyapi.com/api/crm/$CRM_ID/accounts/$OF_USER_ID/chats/$FAN_ID/messages \
-H "X-API-Key: $YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Hey, thanks for subscribing!",
"mediaFiles": [987654],
"previews": [],
"price": 0
}'The same route sends on Fansly — connect a Fansly account and the request shape is unchanged.
Why developers pick The Only API
Unlimited calls on every paid slot
Paid slots are not metered — poll subscriber lists every minute, run analytics at 3 a.m., blast a campaign, and your bill stays per connected account. The free plan includes 1,000 API calls a month so you can build and verify before you pay.
200+ endpoints, one key, two platforms
Messaging, mass DMs, posts, vault, fans, subscribers, earnings, payouts, campaigns, and exports — all behind a single API key with multi-account support, across OnlyFans and Fansly.
Sub-100ms, signed webhooks
Sub-100ms average responses, and cache-backed endpoints (cached subscribers, cached transactions, subscriber stats, refresh status) cost zero platform requests. Every event streams to your URL via HMAC-SHA256-signed webhooks with [5s, 30s, 5m, 30m, 2h] retries.
Zero-ban track record
Every account is bound to its own dedicated proxy — assignable and testable through the proxy endpoints — with isolated sessions, signed requests, and human-realistic pacing. Account safety is a hard constraint, not a marketing line.
New
Multi-platform support & data portability
The same API powers Fansly alongside OnlyFans, and lets you export a full copy of any account's data. Two guides to get you started:
Fansly API support
Manage Fansly and OnlyFans accounts — messages, earnings, tips, and fans — through one normalized API and dashboard.
Read the guide →Export your OnlyFans & Fansly data
Download a full copy of your data — messages, tips, subscribers, and earnings — by date range, in clean CSV and JSON.
Read the guide →OnlyFans API — FAQ
The questions agencies and developers ask before building.
Build on the OnlyFans API today
Free plan: 1 account, 1,000 API calls a month, all 200+ endpoints, no credit card. Paid slots are $20/mo with unlimited calls.