Connect fansly account
Submit 2FA
Submit the Two-Factor Authentication code for account connection.
If the account has Two-Factor Authentication enabled, you will need to submit the 2FA code to complete the connection process.
https://v1.apifansly.com
POST
/api/fansly/verify-2fa
Get Started
All requests to the Fansly API require an API Key. See the Authentication page for details.
Request Body
curl -X POST "https://v1.apifansly.com/api/fansly/verify-2fa" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"username": "Email-or-Username",
"password": "accountPasswordhere",
"twoFactorToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"twoFactorCode": "XXXXX",
"name": "Account-Name",
"countryCode": "ES"
}'const res = await fetch('https://v1.apifansly.com/api/fansly/verify-2fa', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
username: "Email-or-Username",
password: "accountPasswordhere",
twoFactorToken: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
twoFactorCode: "XXXXX",
name: "Account-Name",
countryCode: "ES"
})
});
const data = await res.json();
console.log(data);import requests
url = "https://v1.apifansly.com/api/fansly/verify-2fa"
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"username": "Email-or-Username",
"password": "accountPasswordhere",
"twoFactorToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"twoFactorCode": "XXXXX",
"name": "Account-Name",
"countryCode": "ES"
}
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\": \"Email-or-Username\", \"password\": \"accountPasswordhere\", \"twoFactorToken\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\", \"twoFactorCode\": \"XXXXX\", \"name\": \"Account-Name\", \"countryCode\": \"ES\"}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://v1.apifansly.com/api/fansly/verify-2fa"))
.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\": \"Email-or-Username\", \"password\": \"accountPasswordhere\", \"twoFactorToken\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\", \"twoFactorCode\": \"XXXXX\", \"name\": \"Account-Name\", \"countryCode\": \"ES\"}";
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://v1.apifansly.com/api/fansly/verify-2fa", 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/verify-2fa"
payload := []byte(`{"username": "Email-or-Username", "password": "accountPasswordhere", "twoFactorToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "twoFactorCode": "XXXXX", "name": "Account-Name", "countryCode": "ES"}`)
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.
twoFactorToken*
stringThe token received from the initial connect request if 2FA is required.
twoFactorCode*
stringThe verification code from the authenticator app or email or phone.
name*
stringThe display name for the account in your dashboard.
countryCode*
stringThe ISO country code for proxy rotation. 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"
}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 |
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 |
timestamp | string | The ISO 8601 timestamp of when the response was generated |