OnlyFans API DocumentationOnlyFans API
Account Connection

Authenticate with Session

Connect an OnlyFans account using session cookies.

Connect an OnlyFans account using an authenticated browser session. No password is required.

Before you start

  1. Open an incognito browser and sign in to OnlyFans.
  2. Open DevTools and find any authenticated OnlyFans request.
  3. Copy the request as cURL using Copy as cURL.
  4. Send the cURL to the /api/authenticate/session endpoint.
  5. Once the request is successful, do not sign out of OnlyFans. You can simply close the incognito browser.

Video tutorial: Watch the tutorial

The API extracts the required session information from the cURL request and uses it to authenticate the account.

https://v1.onlyfansapi.io
POST
/api/authenticate/session
Request
curl --request POST \
  --url 'https://v1.onlyfansapi.io/api/authenticate/session' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "curl": "curl \"https://onlyfans.com/api2/v2/users/me\" -H \"user-agent: …\" -b \"sess=…; auth_id=…\"",
    "name": "My OnlyFans Account",
    "countryCode": "US"
  }'

Headers

x-api-key*
string
Your API key. See Authentication.

Body Parameters

curl*
string
The cURL command copied from your browser DevTools for any authenticated onlyfans.com request.
name*
string
A label for the account, shown in your dashboard.
countryCode*
string
ISO 3166-1 alpha-2 country code that sets the proxy location, in capitals — for example US or GB.

Response Fields

FieldTypeDescription
acct_idstringIdentifier for the connected account, prefixed acct_. Use it wherever an endpoint takes an acct_id.
namestringThe label you sent as name.
of_user_idstringThe account's numeric OnlyFans user ID.
of_usernamestringThe account's OnlyFans username.
emailstringThe email address the session belongs to.
country_codestringThe proxy country the account is routed through.
verifiedbooleanWhether the session was checked against OnlyFans and works.

Errors

StatusMessageCause
401API key is missingNo x-api-key header was sent.
401Invalid or inactive API keyThe key does not exist, or has been revoked.