# BetterFans Link: the OnlyFans API > BetterFans Link is an OnlyFans API for developers and agencies. OnlyFans does not offer a public API, so we built one: a fully typed TypeScript SDK that gives your code access to chats, messages, mass messages, pay-per-view, the media vault, subscribers, earnings and transactions on the creator accounts you manage. It is the same infrastructure that runs OFManager, the OnlyFans agency management platform, offered to teams who want to build their own tools. Session handling, proxies, rate limits and retries are managed for you. One API key covers every linked creator, one WebSocket streams real-time events such as new messages, tips and subscribers from all of them, and signed webhooks push every transaction to your server. Agencies and developers use it to build CRMs, chatbots, dashboards, payroll and reporting pipelines, and internal automations, often with AI coding tools like Claude Code and Cursor. Not affiliated with OnlyFans or Fenix International Limited. Create an account at https://betterfans.link/signup. Creator linking and API keys open in the dashboard during early access. ## Main pages - [Home](https://betterfans.link): What BetterFans Link is, how it works, and what agencies build with it. - [Features](https://betterfans.link/features): Every capability of the OnlyFans API in one place. - [OnlyFans Messaging API for DMs and PPV](https://betterfans.link/features/onlyfans-messaging-api): OnlyFans messaging API for sending DMs, mass messages and pay-per-view content from code. Typed routes for chats, media attachments and queued sends. - [Build an OnlyFans Chatbot with a Typed API](https://betterfans.link/features/onlyfans-chatbot-api): Build an OnlyFans chatbot that replies across every creator account. Real-time message events, typed send routes and media uploads in about 50 lines. - [OnlyFans Webhooks and Real-Time Events API](https://betterfans.link/features/onlyfans-webhooks): OnlyFans webhooks and real-time events: messages, tips, new subscribers and PPV purchases over one WebSocket, plus signed transaction webhooks. - [OnlyFans Earnings and Transactions API](https://betterfans.link/features/onlyfans-earnings-api): OnlyFans earnings API for revenue charts, payouts, chargebacks and transactions across every creator. Pull over REST or receive signed webhooks. - [OnlyFans Media Upload and Vault API](https://betterfans.link/features/onlyfans-media-api): OnlyFans media upload API: send photos and videos from a URL in one call, manage vault lists and attach media to messages and posts from code. - [Multi-Account OnlyFans API for Agencies](https://betterfans.link/features/onlyfans-agency-api): OnlyFans agency API for managing many creator accounts from one key. Scoped clients, batch requests, per-creator key scopes and one event stream. - [OnlyFans Subscriber and Fan Data API](https://betterfans.link/features/onlyfans-fan-data-api): OnlyFans subscriber API for fan lists, spend, subscription history and trial links. Build CRMs and segment top spenders from typed data. - [OnlyFans MCP Server for Claude and Cursor](https://betterfans.link/features/onlyfans-mcp-server): OnlyFans API MCP server that gives Claude Code, Cursor and Windsurf the full BetterFans Link docs, so your AI assistant writes correct OnlyFans code. - [Help center](https://betterfans.link/help): Access, API keys, security, connected accounts and support. - [About](https://betterfans.link/about): Who builds BetterFans Link and how it relates to OFManager. - [Contact](https://betterfans.link/contact): Support, partnerships and custom integrations. - [Documentation](https://betterfans.link/docs): The full SDK documentation. - [Full docs as text](https://betterfans.link/llms-full.txt): Every docs page with code examples, in one file. ## FAQ ### Is there an official OnlyFans API? No. OnlyFans does not publish a public API for developers. BetterFans Link fills that gap with a typed TypeScript SDK and REST endpoints that cover chats, messages, media, subscribers, earnings and real-time events. It runs on the same infrastructure as OFManager, and it is an independent product that is not affiliated with or endorsed by OnlyFans or Fenix International. ### How do I get an OnlyFans API key? Create a free account at betterfans.link and set up your workspace. From your dashboard you then link the OnlyFans creator accounts you manage and create an SDK key under API keys. Accounts are open now; creator linking and key creation open soon during early access, and every account is emailed when they go live. Each key covers your whole workspace or only the creators you choose, and the secret is shown once, so store it in an environment variable straight away. ### What can I build with the OnlyFans API? Anything your agency does by hand today. Teams build chatbots and AI chat assistants, CRMs that track fan spend and notes, mass-messaging and PPV tools, revenue dashboards and payroll exports, and alerting for tips and new subscribers. Because every creator is reachable through one key and one event stream, the same code works for a single creator or a large roster. ### How is BetterFans Link related to OFManager? BetterFans Link is the infrastructure OFManager is built on. OFManager is the finished agency product your team logs into; BetterFans Link is the API underneath it, opened up so developers can build their own tools on the same foundation. BetterFans Link has its own accounts: you sign up and manage your workspace at betterfans.link, with no OFManager account needed. ### Which languages and runtimes does the SDK support? The SDK is written in TypeScript and ships as ESM with zero runtime dependencies. It runs on modern Node.js, Bun, Deno and Cloudflare Workers, and TypeScript 5.0 or newer is recommended so route strings are inferred at compile time. Transactions are also available as a plain REST endpoint and signed webhooks, so any language can consume revenue data. ## Core features - Messaging API: Send DMs, mass messages and PPV with vault media attached. Search chats and manage read state. - Chatbot API: Listen for new messages on every account over one WebSocket and reply with typed calls. - Webhooks and events: Typed events for messages, tips, subscribers and PPV over one WebSocket, plus signed transaction webhooks. - Earnings API: Revenue charts, payouts, chargebacks and a transactions feed for every creator you manage. - Media and vault API: Upload photos and videos from a URL in one call and organize the vault with typed routes. - Agency API: One key and one connection for every creator. Scoped clients, batching and per-creator key scopes. - Fan data API: Subscribers, spend, subscription history, trial links and profile stats for CRM and segmentation. - MCP server: Give Claude Code, Cursor and Windsurf the full SDK docs so they write correct OnlyFans code. ## How to get started 1. Create an account at https://betterfans.link/signup 2. Link your OnlyFans creator accounts 3. Open API keys in the dashboard and create an SDK key (opening soon) 4. Start building. See the quickstart at https://betterfans.link/docs/getting-started/quickstart 5. Optional: add the MCP server (`npx -y @betterfans/mcp-server`) so your AI coding assistant can search these docs For custom or enterprise needs, contact https://t.me/ofmanagercom ## Guides: overview - [Utilities](https://betterfans.link/docs/utilities): Helper functions for working with the API's text format and other conventions. - [Types](https://betterfans.link/docs/types): TypeScript types for the OnlyFans API — User, Message, Post, Media, Subscription, and all entity types used across the BetterFans Link SDK, the infrastructure behind OFManager. - [BetterFans Link SDK — The OnlyFans API](https://betterfans.link/docs): The BetterFans Link SDK is the only developer API for the OnlyFans platform — the infrastructure behind OFManager, the leading OnlyFans agency management platform. Build OnlyFans agency tools, chatbots, CRMs, and automations. - [WebSocket EventBus](https://betterfans.link/docs/websocket): Subscribe to real-time OnlyFans events — new messages, tips, subscribers, online status — across all managed accounts over a single WebSocket connection. Part of the BetterFans Link SDK, the infrastructure behind OFManager. - [HTTP Client](https://betterfans.link/docs/http-client): Create and configure the OfApiClient for making typed OnlyFans API requests via the BetterFans Link SDK — the infrastructure behind OFManager. Every route, parameter, and response is fully typed at compile time. - [OnlyFans API Reference](https://betterfans.link/docs/api-reference): Complete OnlyFans API route reference — chats, messages, posts, users, subscriptions, vault, stories, earnings. Every route is fully typed in the BetterFans Link SDK, the infrastructure behind OFManager. - [Core Capabilities (Plugins)](https://betterfans.link/docs/plugins): OnlyFans API media uploads, realtime event counts, and notifications — the infrastructure behind OFManager that saves weeks of reverse-engineering. Extend the BetterFans Link SDK with plugins. ## Guides: getting started - [Why BetterFans Link SDK?](https://betterfans.link/docs/getting-started/why-bfl): Why the BetterFans Link SDK — the infrastructure behind OFManager — is the standard OnlyFans API for building applications, chatbots, and agency tools at scale. - [OnlyFans Chat Bot in 50 Lines](https://betterfans.link/docs/getting-started/chatbot-tutorial): Build an OnlyFans chatbot that auto-replies across multiple creator accounts using the BetterFans Link SDK — the OnlyFans API, the infrastructure behind OFManager. - [Quickstart](https://betterfans.link/docs/getting-started/quickstart): Make your first OnlyFans API call in under 2 minutes with the BetterFans Link SDK — the infrastructure behind OFManager. Fetch profiles, list chats, send messages, and listen to real-time events. - [Getting OnlyFans API Access](https://betterfans.link/docs/getting-started/installation): How to get OnlyFans API access. Create a BetterFans Link account, link your creators, and issue an SDK key from your dashboard. ## Core Capabilities (Plugins) - [Realtime](https://betterfans.link/docs/plugins/realtime): Aggregate chat counts and notification events from the WebSocket EventBus. - [Media](https://betterfans.link/docs/plugins/media): Upload photos and videos to OnlyFans programmatically via the BetterFans Link SDK — the infrastructure behind OFManager. One call per upload, deduplication built in, ready to attach to messages and posts. ## HTTP Client - [Batch requests](https://betterfans.link/docs/http-client/batch-requests): Send multiple API requests in a single call with typed results. - [Error handling](https://betterfans.link/docs/http-client/error-handling): Handle errors, configure retries, and understand error codes. - [Scoped clients](https://betterfans.link/docs/http-client/scoped-clients): Bind a client to a specific OnlyFans account to simplify multi-account workflows. - [Making requests](https://betterfans.link/docs/http-client/making-requests): Use the typed request methods to call any OnlyFans API route. ## WebSocket - [Event reference](https://betterfans.link/docs/websocket/events): Complete reference of all EventBus event types and their payloads. ## API Reference - [Posts](https://betterfans.link/docs/api-reference/posts): Query feed posts and their engagement data. - [Vault](https://betterfans.link/docs/api-reference/vault): Manage vault lists, media items, and visibility settings. - [Subscriptions](https://betterfans.link/docs/api-reference/subscriptions): Manage OnlyFans subscribers programmatically — list active subscribers, view subscription history, handle free trials, and track subscriber counts via the BetterFans Link SDK, the infrastructure behind OFManager. - [Chats](https://betterfans.link/docs/api-reference/chats): List OnlyFans conversations, search chat history, retrieve messages, and manage read status programmatically via the BetterFans Link SDK, the infrastructure behind OFManager. - [Revenue](https://betterfans.link/docs/api-reference/revenue): Pull OnlyFans transactions from a REST endpoint with your API key, or receive them as signed webhooks. Both carry the same transaction shape. - [Earnings](https://betterfans.link/docs/api-reference/earnings): Access OnlyFans revenue data programmatically — earnings charts, payout history, transaction records, referral balances, and campaign analytics via the BetterFans Link SDK, the infrastructure behind OFManager. - [Users](https://betterfans.link/docs/api-reference/users): Fetch profiles, account stats, notifications, settings, and manage blocks. - [Stories](https://betterfans.link/docs/api-reference/stories): Query stories, highlights, charts, and engagement data. - [Messages](https://betterfans.link/docs/api-reference/messages): Send OnlyFans messages programmatically — DMs, mass messages, PPV (pay-per-view), media attachments, and message queue management via the BetterFans Link SDK, the infrastructure behind OFManager. ## Reference - [Types](https://betterfans.link/docs/types): Key entity types used across the SDK: users, messages, posts, media, and more. - [Utilities](https://betterfans.link/docs/utilities): Helper functions for working with the API's text format and other conventions.