Skip to content

For developers and agencies

The OnlyFans API

Read chats, fans, spend and revenue. Send messages. Get webhooks. One REST API for the OnlyFans, Fansly and Fanvue accounts you manage.

Test mode has sandbox creators with realistic sample data. No OnlyFans, Fansly or Fanvue account needed.

Sample workspace. The names and numbers are made up.

THE API

Pick a request.
See what comes back.

Four calls on a sample creator. Each one shows the REST request, the same call from an AI client over MCP, and the webhook your app would get.

API consoletest key · @ava.sampleSample data
Request
GET /v1/accounts/412345678/fans?sort=spend&limit=2Authorization: Bearer bfl_test_...
Response200 OKsource: sandboxsample
{  "data": [    {      "id": "38291045",      "username": "mike.sample",      "subscription": { "status": "active", … },      "spend": { "total": { "amount": 184250, "currency": "USD" }, … },      "lastPurchaseAt": "2026-09-30T21:14:09Z"    // ISO 8601, UTC    },    { "id": "27760318", "username": "nina.sample", … }  ],  "hasMore": true,  "nextCursor": "eyJvIjoyfQ",    // pass it back for the next page  "meta": { "source": "sandbox", "requestId": "req_8sK2mQ7vX1bN…", … }}

Amounts come in cents, so 184250 is $1,842.50.

Recorded sample. Paths and field names are real. Values are made up. Nothing here calls the live API.

Base URLhttps://betterfans.link/v1

WHAT TEAMS BUILD

Agency tools, on your own code.
On routes with docs and types.

All features

THE PRODUCT

Everything you need to build.
One key for every creator.

A REST API, webhooks and an MCP server over the same data, with approvals for sends and a sandbox to build in.

REST API

Routes for chats, fans, money and content

Plain JSON over HTTPS, with docs and types for every route.

  • GET/v1/accounts/{accountId}/fans
  • GET/v1/accounts/{accountId}/chats
  • GET/v1/accounts/{accountId}/chats/{fanId}/messages
  • GET/v1/accounts/{accountId}/revenue
  • GET/v1/accounts/{accountId}/transactions
  • GET/v1/accounts/{accountId}/online-fans
  • GET/v1/accounts/{accountId}/vault
  • POST/v1/accounts/{accountId}/actions
API reference

Webhooks

Messages, sales and new fans as they happen

Signed, retried if your server is down, and replayable from the dashboard.

  • message.received
  • transaction.created
  • subscriber.new
  • action.pending
  • action.executed
Webhook events

MCP server

Tools for AI agents

Your AI app reads the same data your code does.

  • Claude
  • Cursor
  • VS Code
  • Any MCP client
Agents

Approvals

Writes wait for your team by default

  1. Waiting for approval
  2. Approved
  3. Done
How writes work

Your team

Bring the whole team

Invite teammates and give each one a role. Every creator you link sits in one workspace.

Owner
plan and billing
Admin
the team and approvals
Developer
keys and webhooks
Read only
logs and usage
Roles

Test mode

A sandbox before anyone links

Test keys see sandbox creators with fans, chats and revenue. Approvals work the same way and send nothing.

bfl_test_...
sandbox creators
bfl_live_...
accounts linked to you
Test mode

PLATFORMS

OnlyFans, Fansly and Fanvue.
One API for all of them.

Compare them route by route
  • OnlyFans

    Chats, fans, spend, revenue, posts, tracking links and the vault, plus mass messages, paid messages, online fans and webhooks for every new message, sale and subscriber.

    OnlyFans API features
  • Fansly

    Fans, chats, revenue, posts, tracking links and the vault on the same routes, with the same keys. Send free and paid messages and take them back.

    The Fansly API
  • Fanvue

    Fans, chats, revenue, posts, tracking links and the vault on the same routes, read live from Fanvue. Send free, paid and mass messages. In Beta.

    The Fanvue API

LINKING ACCOUNTS

Creators link their own accounts.
In the browser, start to finish.

How linking works

Open the link inside your app

Add one script and the link opens in a popup or over your page. It tells your page each step the creator takes and how it ended, so your app moves on when they are done.

  • Codes, the human check and the OnlyFans selfie all happen in the browser. The creator installs nothing.
  • Agents use the same link: link_account over MCP makes it, you send it however you like, and get_link or account.connected says when it is done.
  • One file of plain JavaScript with no dependencies. Use it from React, Vue, Svelte or a plain page, pin it, or copy it into your repo.

connect.js

import { connect } from "https://betterfans.link/connect/v1.js";

// Your server makes the link with POST /v1/links.
const result = await connect({
  link: () => fetch("/api/creator-link", { method: "POST" }).then((r) => r.json()),
  onEvent: (event) => console.log(event.type, event.step ?? ""),
});

if (result.status === "connected") {
  console.log("Linked", result.account.username);
}
Run it
Open the link in

Sign in with any details. Any code works except 000000.

  1. Each step the creator takes shows up here as it happens.
  • An OnlyFans or Fansly password is encrypted before it is stored. A Fanvue password stays with Fanvue.
  • We never change the creator's password, email or account settings.
  • Nothing happens on any platform until the creator signs in.
  • Removing an account ends your workspace's access. It does not sign the creator out.

APPROVALS

Writes wait by default.
Your team decides.

Each write to OnlyFans, Fansly or Fanvue, from your code or an AI agent, becomes an action with a one-line summary. By default it waits until someone on your team approves or rejects it in the dashboard.

  • Off until you turn it onWrites start off for every account. An owner or admin turns them on, and a key needs the write scope to ask.
  • Owners and admins decideDevelopers and read-only members can see what is waiting. Only owners and admins can approve it.
  • Nothing waits foreverAn action nobody decides on expires after 24 hours, and nothing is sent.
  • Safe to retrySend the same request twice and you get the same action back, never a second send.
How writes work

The life of a send

  1. Waiting for approval

    Your code or agent asked. action.pending fires and the send shows up in Approvals.

  2. Approved

    A person checked the recipient, price and media and said yes.

  3. Running

    We send it on OnlyFans, Fansly or Fanvue.

  4. Done

    It went out. action.executed carries the result.

Or it ends here

  • Rejected

    Nothing is sent. The note goes back with the action.

  • Expired

    Nobody decided within 24 hours.

  • Failed

    The platform refused it. The error says why.

In test mode, approving records a sample result and nothing reaches any platform.

AI AGENTS

Works in your AI client too.
Same data, same approvals.

The MCP server gives Claude, Cursor and other MCP clients the same reads your code gets. When an agent asks to send something, it waits for your team like any other write.

MCP server URLhttps://mcp.betterfans.link/mcp

Set up your client

claude mcp add --transport http betterfans-link https://mcp.betterfans.link/mcp --header "Authorization: Bearer $BFL_KEY"

Put a bfl_test_ key in BFL_KEY first. You make one under Developers after you sign up.

{"mcpServers":{"betterfans-link":{"url":"https://mcp.betterfans.link/mcp"}}}

Goes in ~/.cursor/mcp.json. Sign in when Cursor asks. The file holds no key.

{"servers":{"betterfans-link":{"type":"http","url":"https://mcp.betterfans.link/mcp"}}}

Goes in .vscode/mcp.json. Sign in when VS Code asks. The file holds no key.

Your AI clientSample

Which of Ava's big spenders went quiet this week? Offer the top one Sunday's set for $12.

find_fansstatus: active, sort: spend
  • @milo.sample$1,240 lifetime, last message 8 days ago
  • @theo.sample$910 lifetime, last message 9 days ago
  • @jun.sample$640 lifetime, last message 12 days ago
draft_messagesends nothing
send_messagepriceCents: 1200, 2 medianeeds approval
Waiting for approval
Waiting for approval

Send a $12 message to @milo.sample

Asked by Claude with send_message

Account
@ava.sample
To
@milo.sample 1 fan
Price
$12.00
Media
2 videos from the vault

@ava.sample · to @milo.sample · $12.00

The full set from Sunday, just for you. Two videos, 14 minutes.
Expires in 24 h

Sample inbox for @ava.sample, a made-up creator. Runs in your browser. Nothing is sent anywhere.

GETTING STARTED

Start in test mode.
Go live when it works.

Create your account
  1. 01

    Create a workspace

    Sign up with your email and your workspace is ready. Invite teammates with the role each one needs.

  2. 02

    Build in test mode

    Make a bfl_test_ key or connect your AI client, then work against sandbox creators until your flow is right.

  3. 03

    Link creators and go live

    Send each creator a link. Once they connect, switch to a live key and turn on writes where you want them.

QUESTIONS

Fair questions.
Straight answers.

The rest is in the docs and the help center.

Visit the help center Does OnlyFans have an API?

Does OnlyFans have an API?

No. OnlyFans publishes no public API for developers: no documentation, no API keys and no developer portal. Every OnlyFans API, BetterFans Link included, is an independent third party. BetterFans Link works only with creator accounts linked to your workspace, and gives you a REST API, signed webhooks and an MCP server. It is not affiliated with or endorsed by OnlyFans or Fenix International.

Yes. Fansly accounts link to your workspace the same way OnlyFans accounts do, and the same keys, routes, MCP tools and approvals work for them. A Fansly account reads fans, chats, revenue, posts, tracking links, online fans and the vault, takes free and paid messages and unsends, and sends every shared webhook event except fan.online, message.liked, message.unliked and message.purchased. Mass messages and list changes work on OnlyFans and Fanvue, not on Fansly.

Yes, in Beta. A Fanvue creator connects with Fanvue's own sign-in, and the same keys, routes, MCP tools and approvals work for the account. Every read asks Fanvue live and counts as a live call. A Fanvue account takes free, paid and mass messages, unsends and list changes. It has no message search, and it never sends fan.typing, fan.online, message.liked or message.unliked.

Can I build before linking a real account?

Yes. Every workspace has a test mode with sandbox creators on OnlyFans, Fansly and Fanvue, with sample fans, chats and revenue. Use a bfl_test_ key and build the whole flow, approvals included. Approved actions in test mode record a simulated result and never reach any platform.

How do creators connect their accounts?

You create a link in the dashboard, or with POST /v1/links, and send it to the creator. They open it and sign in to OnlyFans or Fansly on a page we host, answering any code or check the platform asks for, or sign in to Fanvue on Fanvue's own page. The link works for 24 hours.

What can I build with it?

Anything your agency does by hand today. Teams build CRMs for their chatters, revenue dashboards and reports, inbox and mass message tools, alerts on new sales and messages, and AI assistants that draft replies for a person to approve. It all runs on your own code, with the same API for OnlyFans, Fansly and Fanvue.

What does the MCP server do?

MCP is the Model Context Protocol, the way AI apps such as Claude and Cursor call outside tools. Add https://mcp.betterfans.link/mcp to your client and it can list accounts, find fans, read chats, check revenue and draft replies for the OnlyFans, Fansly and Fanvue accounts in your workspace. Its tools call the same API your code does, with the same keys, limits and approvals.

Can an AI agent send messages on its own?

Not over OAuth. An AI client that connects to the MCP server with OAuth always waits. Each write it asks for, such as a message, an unsend or a list change, becomes a pending action that a workspace owner or admin approves or rejects in the dashboard, and it expires after 24 hours if nobody decides. Writes from an API key wait the same way by default, unless an owner or admin turned on auto-approve for that key. Writes are also off for each account until you turn them on.

GET STARTED

Build it in test mode today.

Sign up, make a test key and work against sandbox creators. Link a real account when your flow is ready.

Questions first? Write to hello@betterfans.link.