🚀 Fansly API (Alpha) is live!WIP - Updated Daily
Fansly API Logo
Connect fansly account

Connect Account


Connect your Fansly account via our Connect endpoint to start authentication. We handle the entire login flow and will request a 2FA code only if needed.

https://v1.apifansly.com
POST
/api/fansly/connect
  • Secure Handling: All credentials are encrypted and stored securely, used strictly for the purpose of authentication.
  • 2FA Ready: If an account requires secondary verification, the system will pause and request the 2FA code to complete the connection.

Get Started

All requests to the Fansly API require an API Key. See the Authentication page for details.

Start Authentication

Initiate the connection process by securely providing the account credentials.

Account credentials are hashed and stored securely and are used strictly for authentication.

Request Body

curl -X POST "https://v1.apifansly.com/api/fansly/connect" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "xxxxxxxxxxxx@gmail.com",
    "password": "Passwordhere",
    "countryCode": "US"
  }'
// POST /api/fansly/connect
const login = async () => {
  const response = await fetch("https://v1.apifansly.com/api/fansly/connect", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": "YOUR_API_KEY",
    },
    body: JSON.stringify({
      username: "xxxxxxxxxxxx@mail.com",
      password: "Passwordhere",
      countryCode: "US"
    }),
  });
  return await response.json();
};
import requests

url = "https://v1.apifansly.com/api/fansly/connect"
headers = {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json"
}
payload = {
    "username": "xxxxxxxxxxxx@gmail.com",
    "password": "Passwordhere",
    "countryCode": "US"
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
String json = "{\"username\": \"xxxxxxxxxxxx@gmail.com\", \"password\": \"Passwordhere\", \"countryCode\": \"US\"}";

HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("https://v1.apifansly.com/api/fansly/connect"))
        .header("x-api-key", "YOUR_API_KEY")
        .header("Content-Type", "application/json")
        .POST(BodyPublishers.ofString(json))
        .build();

client.sendAsync(request, HttpResponse.BodyHandlers.ofString())
        .thenApply(HttpResponse::body)
        .thenAccept(System.out::println)
        .join();
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY");

var json = "{\"username\": \"xxxxxxxxxxxx@gmail.com\", \"password\": \"Passwordhere\", \"countryCode\": \"US\"}";
var content = new StringContent(json, Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://v1.apifansly.com/api/fansly/connect", content);
var responseString = await response.Content.ReadAsStringAsync();

Console.WriteLine(responseString);
package main

import (
    "bytes"
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    url := "https://v1.apifansly.com/api/fansly/connect"
    payload := []byte(`{"username": "xxxxxxxxxxxx@gmail.com", "password": "Passwordhere", "countryCode": "US"}`)

    req, _ := http.NewRequest("POST", url, bytes.NewBuffer(payload))
    req.Header.Set("x-api-key", "YOUR_API_KEY")
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    body, _ := ioutil.ReadAll(resp.Body)
    fmt.Println(string(body))
}
username*
string
The email or username of the Fansly account.
password*
string
The password of the Fansly account.
countryCode*
string
The ISO country code for proxy rotation (e.g., "US", "GB"). Must be in CAPITAL LETTERS.

Response

{
    "statusCode": 201,
    "message": "Success",
    "data": {
        "status_code": 200,
        "account_id": "fansly_4xxxxxxxxxxxxxxxxxxxxxx",
        "data": {
            "success": true,
            "response": {
                "accountId": "86283xxxxxxxxxxxx",
                "deviceId": null,
                "ip": "Proxy_IP_Address",
                "status": 2,
                "metadata": null,
                "id": "xxxxxxxxxxxx",
                "token": "Your_Token",
                "checkToken": null
            }
        }
    },
    "timestamp": "2026-01-19T15:36:33.916Z"
}
{
    "statusCode": 201,
    "message": "Success",
    "data": {
        "status_code": 200,
        "requires_2fa": true,
        "twofa_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "masked_email": "e*********k@g****.com",
        "message": "Two-factor authentication required. Please use the /fansly/verify-2fa endpoint with the code sent to your email."
    },
    "timestamp": "2026-01-19T15:31:33.575Z"
}

Response

FieldTypeDescription
statusCodenumberThe HTTP status code of the response (e.g., 201)
messagestringA human-readable message about the result status
dataobjectThe main response payload
├─ status_codenumberThe internal status code of the Fansly operation
├─ account_idstringThe unique identifier for the connected account in our database
├─ dataobjectFansly session and status data
│ └─ responseobjectDetailed account and session information
│ └─── tokenstringThe authentication token for the Fansly account
│ └─── idstringThe authentication id for the Fansly account
│ └─── ipstringThe authentication Proxy IP
├─ requires_2fabooleanIndicates if 2FA is required
├─ twofa_tokenstringA temporary token for the /verify-2fa endpoint
├─ masked_emailstringThe email address where the 2FA code was sent
└─ messagestringA message about the authentication status
timestampstringThe ISO 8601 timestamp of when the response was generated

On this page