💬

onlyfans API reference

Generated from the SDK source (v0.8.0) by bun run build:docs

Access: loader.SDK.Platforms.onlyfans (or loader.SDK.get_platform("onlyfans")).

Every method has the signature (params, ctx). Pass the plugin instance as ctx, or bind once with const api = onlyfans.bind(this) and call api.Namespace.method(params). All methods reject with an SdkError (see core).

Namespaces

NamespaceDescriptionMethods
AccountThe authenticated account ("me")4
UsersOther users: profiles, following, restricting, user lists13
MessagesDirect messages (chats)8
ContentPosts, vault, scheduled and saved items7
SubscriptionsFans and subscriptions5
FeedHome timeline and post views3
LiveLive streams2
NotificationsActivity notifications4
EarningsRevenue statistics and payouts5
ChatConversations, platform-neutral (the shape every chat-capable platform shares)6

Account

The authenticated account ("me")

Account.get_me(params, ctx)

The logged-in account: id, username, profile, counters and limits.

ParamType
params{}

Returns Promise<OfResponseMe>

Account.get_settings(params, ctx)

Account settings: privacy, notifications, 2FA, blocked countries.

ParamType
params{}

Returns Promise<OfResponseMeSettings>

Account.get_start_date(params, ctx)

When the account started as a creator ("YYYY-MM-DD HH:MM:SS"), the earliest date the earnings statistics go back to.

ParamType
params{}

Returns Promise<string>

Account.get_ip(params, ctx)

The IP address and location OnlyFans sees for this account's requests (its proxy IP, when one is assigned).

ParamType
params{}

Returns Promise<OfResponseIp>

Users

Other users: profiles, following, restricting, user lists

Users.get_profile(params, ctx)

A user's profile, with how they relate to the account (subscriptions both ways, lists they are on).

ParamType
params{ user_id: string | number; view?: string; }

Returns Promise<OfUser>

Users.get_profiles(params, ctx)

Several users at once, keyed by id (what the site uses to fill in the users of a chat list, a feed or notifications).

ParamType
params{ user_ids: (string | number)[]; view?: OfProfileView; }

Returns Promise<OfResponseUsersById>

Users.is_following(params, ctx)

Whether the account follows (is subscribed to) the user.

ParamType
params{ user_id: string | number; }

Returns Promise<boolean>

Users.follow(params, ctx)

Follows (subscribes to) a user. Free profiles only: a paid subscription needs a payment, and OnlyFans refuses it here (REJECTED).

ParamType
params{ user_id: string | number; source?: string; }

Returns Promise<OfUser>

Users.unfollow(params, ctx)

Unfollows (unsubscribes from) a user.

ParamType
params{ user_id: string | number; reason_id?: number; }

Returns Promise<OfUser>

Users.set_restricted(params, ctx)

Restricts a user (their messages and comments are hidden from the account) or lifts it.

ParamType
params{ user_id: string | number; restricted: boolean; }

Returns Promise<OfUser>

Users.list_social_links(params, ctx)

The social links on a user's profile. Only empty lists were recorded, so the items' shape is unknown yet.

ParamType
params{ user_id: string | number; }

Returns Promise<unknown[]>

Users.list_lists(params?, ctx)

The account's user lists: system lists (fans, following, muted, …) and custom ones.

ParamType
params?{ offset?: number; limit?: number; filter?: "feed" | "chat"; related_user_id?: string | number; }

Returns Promise<OfResponseUserLists>

Users.get_list(params, ctx)

One list with its members, e.g. "fans" or "following".

ParamType
params{ list_id: string | number; }

Returns Promise<OfUserListWithMembers>

Users.create_list(params, ctx)

Creates a custom user list.

ParamType
params{ name: string; }

Returns Promise<OfUserList<{ _view: string; id: number; }>>

Users.set_list_membership(params, ctx)

Puts a user on a custom list (member: true) or takes them off.

ParamType
params{ list_id: string | number; user_id: string | number; member: boolean; }

Returns Promise<OfResponseListMembership>

Users.record_profile_view(params, ctx)

Records that the account viewed a creator's profile (the counter the site sends when a profile is open).

ParamType
params{ user_id: string | number; duration?: number; referrer?: string; }

Returns Promise<true>

Users.record_profile_visit(params, ctx)

Records a visit to a creator's profile page.

ParamType
params{ username: string; source?: string; }

Returns Promise<true>

Messages

Direct messages (chats)

Messages.send_typing(params, ctx)

Shows "typing…" to a user in their chat, over the platform's socket. Server runs only (the server keeps the socket open for the whole run); resolves false when the socket isn't connected at the moment.

ParamType
params{ user_id: string | number; }

Returns Promise<boolean>

Messages.list_conversations(params?, ctx)

One page of conversations, most recent first.

ParamType
params?{ offset?: number; limit?: number; order?: "recent" | "old"; }

Returns Promise<OfResponseChats>

Messages.list_all_conversations(params?, ctx)

Every conversation (pages through nextOffset until there are no more).

ParamType
params?{ limit?: number; max_pages?: number; }

Returns Promise<OfChat[]>

Messages.get_conversation(params, ctx)

Messages with one user, newest first. Page back with before_id: the id of the oldest message you have.

ParamType
params{ partner_id: string | number; limit?: number; before_id?: string | number; }

Returns Promise<OfResponseMessages>

Messages.send_message(params, ctx)

Sends a text message, free or pay-to-open. Media attachments aren't supported yet.

ParamType
params{ recipient_id: string | number; message: string; price?: number; html?: boolean; }

Returns Promise<OfMessage>

Messages.delete_message(params, ctx)

Unsends one of the account's messages (only while the site allows it, see cancelSeconds on the message).

ParamType
params{ message_id: string | number; partner_id: string | number; }

Returns Promise<OfResponseSuccess>

Messages.list_queue(params, ctx)

Mass messages waiting to be sent. Only empty lists were recorded.

ParamType
params{}

Returns Promise<unknown[]>

Messages.list_templates(params, ctx)

Saved message templates. Only empty lists were recorded.

ParamType
params{}

Returns Promise<unknown[]>

Content

Posts, vault, scheduled and saved items

Content.list_posts(params, ctx)

One page of a creator's posts, newest first. Page back with before_publish_time: the previous page's tailMarker.

ParamType
params{ user_id: string | number; limit?: number; before_publish_time?: string; pinned?: boolean; counters?: boolean; }

Returns Promise<OfResponseUserPosts>

Content.list_vault_lists(params?, ctx)

The vault's lists (Messages, Posts, Stories, Streams, custom ones) with their media counts.

ParamType
params?{ offset?: number; limit?: number; }

Returns Promise<OfResponseVaultLists>

Content.list_vault_media(params?, ctx)

One page of vault media, newest first. Only empty pages were recorded, so the items' shape is unknown yet.

ParamType
params?{ list_id?: string | number; offset?: number; limit?: number; }

Returns Promise<OfResponseVaultMedia>

Content.get_vault_processing(params, ctx)

Uploads the vault is still processing.

ParamType
params{}

Returns Promise<OfResponseVaultProcessing>

Content.list_scheduled(params, ctx)

Scheduled posts and messages between two days.

ParamType
params{ from_date: string; to_date: string; time_zone: string; limit?: number; }

Returns Promise<OfResponseSchedule>

Content.get_schedule_counts(params, ctx)

Scheduled items per day between two days (the calendar's counters).

ParamType
params{ from_date: string; to_date: string; time_zone: string; }

Returns Promise<OfResponseSchedule>

Content.list_saved_for_later(params, ctx)

Posts or messages saved for later.

ParamType
params{ kind: "chat" | "post"; limit?: number; }

Returns Promise<OfResponseSchedule>

Subscriptions

Fans and subscriptions

Subscriptions.list_subscribers(params?, ctx)

One page of the account's fans, with what each spent.

ParamType
params?{ type?: "all" | "active" | "expired"; offset?: number; limit?: number; }

Returns Promise<OfResponseSubscriberPage>

Subscriptions.list_subscriptions(params?, ctx)

One page of the creators the account is subscribed to.

ParamType
params?{ type?: "all" | "active" | "expired"; offset?: number; limit?: number; }

Returns Promise<OfResponseSubscriberPage>

Subscriptions.get_counts(params, ctx)

How many fans and subscriptions the account has, by state.

ParamType
params{}

Returns Promise<OfResponseSubscriptionCounts>

Subscriptions.list_history(params, ctx)

Every subscription period between the account and a user.

ParamType
params{ user_id: string | number; }

Returns Promise<OfResponseSubscriptionHistory>

Subscriptions.list_unsubscribe_reasons(params, ctx)

The reasons Users.unfollow accepts (reason_id).

ParamType
params{}

Returns Promise<OfUnsubscribeReason[]>

Feed

Home timeline and post views

Feed.list_posts(params?, ctx)

The newest posts of the creators the account follows.

ParamType
params?{ limit?: number; }

Returns Promise<OfResponseFeed>

Feed.list_list_posts(params, ctx)

Posts of the members of one of the account's lists, e.g. "fans".

ParamType
params{ list_id: string | number; offset?: number; limit?: number; }

Returns Promise<OfResponseListPosts>

Feed.record_post_view(params, ctx)

Records that the account looked at posts (the counter the site sends while posts are on screen).

ParamType
params{ views: { post_id: string | number; duration: number; }[]; }

Returns Promise<true>

Live

Live streams

Live.list_streams(params?, ctx)

Streams live now from creators the account follows.

ParamType
params?{ limit?: number; }

Returns Promise<OfResponseStreams>

Live.list_reminders(params, ctx)

Upcoming streams the account set a reminder for.

ParamType
params{ time_zone: string; limit?: number; }

Returns Promise<OfResponseStreams>

Notifications

Activity notifications

Notifications.list_all(params?, ctx)

One page of notifications, all or of one type. Only the page frame was recorded, so items pass through untyped.

ParamType
params?{ type?: OfNotificationType; offset?: number; limit?: number; }

Returns Promise<OfResponseNotifications>

Notifications.get_badge_counts(params, ctx)

Unread notifications per type.

ParamType
params{}

Returns Promise<OfNotificationCounts>

Notifications.mark_read(params, ctx)

Marks one type of notifications read.

ParamType
params{ type: OfNotificationType; }

Returns Promise<OfResponseMarkRead>

Notifications.get_settings(params?, ctx)

Which message notifications are on, grouped.

ParamType
params?{ group?: number; }

Returns Promise<OfNotificationSettingsGroup[]>

Earnings

Revenue statistics and payouts

Earnings.get_chart(params, ctx)

Earnings per day between two dates, by type. The site asks for one type per call; this does the same and merges the answers.

ParamType
params{ start_date: OfDateInput; end_date?: OfDateInput; types?: OfEarningsType[]; }

Returns Promise<OfResponseEarningsChart>

Earnings.get_balances(params, ctx)

Payout balances: available, pending, limits and the payout schedule.

ParamType
params{}

Returns Promise<OfResponsePayoutBalances>

Earnings.get_chargeback_ratio(params, ctx)

Share of payments charged back between two dates.

ParamType
params{ start_date: OfDateInput; end_date?: OfDateInput; }

Returns Promise<number>

Earnings.get_payout_eligibility(params, ctx)

Whether the account can receive payouts, or what blocks them.

ParamType
params{}

Returns Promise<OfResponsePayoutEligibility>

Earnings.list_transactions(params?, ctx)

One page of earnings transactions, newest first. Page with marker: the previous page's marker.

ParamType
params?{ start_date?: OfDateInput; marker?: number; limit?: number; }

Returns Promise<OfResponseTransactions>

Chat

Conversations, platform-neutral (the shape every chat-capable platform shares)

Chat.get_thread(params, ctx)

The conversation with another user, normalised (last 50 messages).

ParamType
params{ partner_id: string; }

Returns Promise<ChatThread>

Chat.send(params, ctx)

Sends a text message. Files aren't supported on OnlyFans yet.

ParamType
params{ partner_id: string; text: string; files?: any[] | FileList; }

Returns Promise<OfMessage>

Chat.is_following(params, ctx)

Whether the account follows (is subscribed to) the other party (null: unknown).

ParamType
params{ partner_id: string; }

Returns Promise<boolean>

Chat.set_following(params, ctx)

Follows (true) or unfollows (false) the other party; resolves once the account is in that state. Following a paid profile is refused.

ParamType
params{ partner_id: string; follow: boolean; }

Returns Promise<true | OfUser>

Chat.get_own_bio(params, ctx)

The account's own profile bio as plain text ('' when unknown).

ParamType
paramsany

Returns Promise<string>

Chat.is_member_type(params)

Whether a user type is a fan (true) or a creator (false); null when unknown. OnlyFans has no type field: pass "fan" or "performer" (from a profile's isPerformer).

ParamType
params{ user_type: string; }

Returns boolean