Connect onlyfans account
Submit 2FA
Submit the 2FA code for the authentication process.
AuthorizationBearer <token>
You can retrieve your token by visiting the OnlyFansAPI Console and clicking API Keys -> Create API Key.
In: header
Path Parameters
attempt_idstring
The attempt ID of the authentication process
codestring
The 2FA code you received on your phone
Response Body
curl -X PUT "https://app.onlyfansapi.com/api/authenticate/auth_XXXXXXX" \
-H "Content-Type: application/json" \
-d '{
"code": "12345"
}'
const body = JSON.stringify({
"code": "12345"
})
fetch("https://app.onlyfansapi.com/api/authenticate/auth_XXXXXXX", {
body
})
package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://app.onlyfansapi.com/api/authenticate/auth_XXXXXXX"
body := strings.NewReader(`{
"code": "12345"
}`)
req, _ := http.NewRequest("PUT", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
import requests
url = "https://app.onlyfansapi.com/api/authenticate/auth_XXXXXXX"
body = {
"code": "12345"
}
response = requests.request("PUT", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.time.Duration;
import java.net.http.HttpRequest.BodyPublishers;
var body = BodyPublishers.ofString("""{
"code": "12345"
}""");
HttpClient client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(10))
.build();
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
.uri(URI.create("https://app.onlyfansapi.com/api/authenticate/auth_XXXXXXX"))
.header("Content-Type", "application/json")
.PUT(body)
.build();
try {
HttpResponse<String> response = client.send(requestBuilder.build(), BodyHandlers.ofString());
System.out.println("Status code: " + response.statusCode());
System.out.println("Response body: " + response.body());
} catch (Exception e) {
e.printStackTrace();
}
using System;
using System.Net.Http;
using System.Text;
var body = new StringContent("""
{
"code": "12345"
}
""", Encoding.UTF8, "application/json");
var client = new HttpClient();
var response = await client.PutAsync("https://app.onlyfansapi.com/api/authenticate/auth_XXXXXXX", body);
var responseBody = await response.Content.ReadAsStringAsync();
{
"message": "OTP submitted successfully"
}
Start Authentication POST
Start the authentication process for a new account. Our systems will bypass Captcha and also ask you for 2FA code if required. All credentials are stored securely using bcrypt and only used during login.
List Active Fans GET
Get a paginated list of fans for an Account. Newest fans are first.