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*
stringThe email or username of the Fansly account.
password*
stringThe password of the Fansly account.
countryCode*
stringThe 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
| Field | Type | Description |
|---|---|---|
statusCode | number | The HTTP status code of the response (e.g., 201) |
message | string | A human-readable message about the result status |
data | object | The main response payload |
├─ status_code | number | The internal status code of the Fansly operation |
├─ account_id | string | The unique identifier for the connected account in our database |
├─ data | object | Fansly session and status data |
│ └─ response | object | Detailed account and session information |
│ └─── token | string | The authentication token for the Fansly account |
│ └─── id | string | The authentication id for the Fansly account |
│ └─── ip | string | The authentication Proxy IP |
├─ requires_2fa | boolean | Indicates if 2FA is required |
├─ twofa_token | string | A temporary token for the /verify-2fa endpoint |
├─ masked_email | string | The email address where the 2FA code was sent |
└─ message | string | A message about the authentication status |
timestamp | string | The ISO 8601 timestamp of when the response was generated |