ONLYFANS API · JAVASCRIPT

The OnlyFans API for JavaScript and Node

CreatorAPI is a hosted REST API for OnlyFans and Fansly that returns plain JSON. Call it with fetch from Node, Bun or Deno: one key, one header, no SDK to install.

Start free with 1,000 credits · no card · one key for OnlyFans and Fansly

Why there is no SDK to install

You do not need an SDK because CreatorAPI is plain REST that returns JSON, so any HTTP client in any JavaScript runtime works: fetch, axios, got, undici, whatever you already use. OnlyFans itself publishes no official public API. CreatorAPI fills that gap by calling the same authenticated endpoints the platform apps use, through your own connected session, so responses are stable, structured JSON instead of scraped HTML. The examples below use the built in fetch that ships with Node 18 and later.

List subscribers with fetch

Listing subscribers takes one GET request with your key in the X-API-Key header. Every native route follows the same pattern, so once this works, fans, messages, earnings, posts and transactions work the same way.

// list the newest 50 subscribers · a native read costs 1 credit
const res = await fetch(
  "https://api.creator-api.com/v1/{account}/native/subscriptions/subscribers?limit=50",
  { headers: { "X-API-Key": process.env.CREATOR_API_KEY } }
);
const subscribers = await res.json();

Create an export job

An export job bulk dumps subscribers, transactions, chats or posts to CSV or JSONL for 10 credits, and you download the file when the job is done. That is the right tool when you want a whole dataset instead of paging through reads.

// start a bulk export, poll the job, download when done
const job = await fetch("https://api.creator-api.com/v1/{account}/exports", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.CREATOR_API_KEY,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ dataset: "transactions", format: "csv" })
}).then(r => r.json());

Built for event driven Node apps

Push instead of poll, handle failures cleanly, and let your AI editor write the boring parts.

Signed webhooks

Register a URL with POST /v1/{account}/webhooks and CreatorAPI pushes events like new messages, sales, renewals and subscribers. Every delivery is signed with HMAC SHA256 and retried with backoff. Details on the OnlyFans webhooks page.

Errors you can handle

Failures come back as JSON with a clear error field. 401 means a bad key, 402 insufficient credits, 429 rate limit, so a try catch plus a status check covers it.

AI assisted coding

The whole API reference ships as one file, llms-full.txt. Paste it into Claude or Codex and let the assistant write your integration against real routes.

Where to go next

The fastest path is the quickstart, which takes you from signup to your first JSON response in a few minutes. For the full route catalog, 89 live verified GET routes plus writes, see the OnlyFans API overview. The free trial includes 1,000 credits with no card required, and a native read costs 1 credit, so there is plenty of room to prototype.

JavaScript and Node questions

Is there an official OnlyFans API for JavaScript?

OnlyFans publishes no official public API. CreatorAPI fills that gap with a hosted REST API that any JavaScript runtime can call, using the same authenticated endpoints the platform apps use through your own connected session.

Do I need an SDK or client library?

No. CreatorAPI is plain REST returning JSON, so fetch, axios, got or any other HTTP client works as is.

Does it work in Node, Bun and Deno?

Yes. Any runtime with an HTTP client can call it. The examples on this page use the built in fetch that ships with Node 18 and later.

How do I authenticate requests?

Send your key in the X-API-Key header on every request. Keys look like ca_live_ and you get one after connecting an account.

How do webhooks work for event driven apps?

You register a URL and CreatorAPI pushes events like new messages, sales, renewals and subscribers. Every delivery is signed with HMAC SHA256 and failed deliveries are retried with backoff, and you can trigger test events and inspect a delivery log.

What does it cost to build with?

The free trial includes 1,000 credits with no card required, and a native read costs 1 credit. The OnlyFans plan is 55 USD per month with 20,000 credits.

Can an AI assistant write the integration for me?

Yes. The full API reference ships as one file, llms-full.txt, which you can paste into Claude or Codex so the assistant codes against real routes.

Ship your first OnlyFans integration in JavaScript today

Start free with 1,000 credits, no card, one key for OnlyFans and Fansly.

Start free with 1,000 credits · no card