4BASED API · JAVASCRIPT

The 4Based API for JavaScript and Node

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

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

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. 4based itself publishes no official public API. CreatorAPI fills that gap by calling the same authenticated endpoints the 4based app uses, through your own connected session, and rewrites shorthand names like me or subscribers to 4based's real paths so you never touch them. 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, tiers, chats, feed, vault and earnings work the same way.

// list 4based subscribers · a native read costs 1 credit
const res = await fetch(
  "https://api.creator-api.com/v1/{account}/native/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 and chats 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: "subscribers", 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, pay per view unlocks and subscriber changes. Every delivery is signed with HMAC SHA256 and retried with backoff. Details on the 4Based 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 and shorthand aliases, see the 4Based 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 4based API for JavaScript?

4based 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 4based app uses 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.

Do I need to know 4based's own path layout?

No. Shorthand aliases like me, subscribers, tiers, chats, feed, vault and earnings map to the real 4based paths, and CreatorAPI fills in the creator's own id for you.

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, pay per view unlocks and subscriber changes. Every delivery is signed with HMAC SHA256 and failed deliveries are retried with backoff.

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 4based integration in JavaScript today

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

Start free with 1,000 credits · no card