Trial links
Create Trial Link
Create a new trial link for the account
AuthorizationBearer <token>
You can retrieve your token by visiting the OnlyFansAPI Console and clicking API Keys -> Create API Key.
In: header
Path Parameters
accountstring
The Account ID
name?string
The name of the trail link (optional). Cannot be longer than 64 characters.
offerExpirationinteger
The trial link expiration in days (from now). Must either be 0 (to never expire), or a number between 1 and 30.
offerLimitinteger
How many people can use this offer. Must either be 0 (for no limit), or a number between 1-10, 50, or 100.
Value in
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 50 | 100
durationinteger
The duration of the free trial in days. Must be 1, 3, 7, 14, 30 (1 month), 90 (3 months), 180 (6 months), or 360 (12 months).
Value in
1 | 3 | 7 | 14 | 30 | 90 | 180 | 360
Response Body
curl -X POST "https://app.onlyfansapi.com/api/acct_XXXXXXXXXXXXXXX/trial-links" \
-H "Content-Type: application/json" \
-d '{
"offerExpiration": 7,
"offerLimit": 7,
"duration": 7
}'
const body = JSON.stringify({
"offerExpiration": 7,
"offerLimit": 7,
"duration": 7
})
fetch("https://app.onlyfansapi.com/api/acct_XXXXXXXXXXXXXXX/trial-links", {
body
})
package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://app.onlyfansapi.com/api/acct_XXXXXXXXXXXXXXX/trial-links"
body := strings.NewReader(`{
"offerExpiration": 7,
"offerLimit": 7,
"duration": 7
}`)
req, _ := http.NewRequest("POST", 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/acct_XXXXXXXXXXXXXXX/trial-links"
body = {
"offerExpiration": 7,
"offerLimit": 7,
"duration": 7
}
response = requests.request("POST", 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("""{
"offerExpiration": 7,
"offerLimit": 7,
"duration": 7
}""");
HttpClient client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(10))
.build();
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
.uri(URI.create("https://app.onlyfansapi.com/api/acct_XXXXXXXXXXXXXXX/trial-links"))
.header("Content-Type", "application/json")
.POST(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("""
{
"offerExpiration": 7,
"offerLimit": 7,
"duration": 7
}
""", Encoding.UTF8, "application/json");
var client = new HttpClient();
var response = await client.PostAsync("https://app.onlyfansapi.com/api/acct_XXXXXXXXXXXXXXX/trial-links", body);
var responseBody = await response.Content.ReadAsStringAsync();
{
"data": {
"id": 123,
"trialLinkName": "My new trial link",
"url": "https://onlyfans.com/username/trial/code",
"subscribeDays": 123,
"subscribeCounts": 123,
"claimCounts": 123,
"expiredAt": "2025-01-05T00:00:00+00:00",
"createdAt": "2025-01-01T00:00:00+00:00",
"isFinished": false
},
"_pagination": {
"next_page": null
},
"_meta": {
"_credits": {
"used": 1,
"balance": 999999840,
"note": "Always"
},
"_cache": {
"is_cached": false,
"note": "Cache disabled for this endpoint"
},
"_rate_limits": {
"limit_minute": 1000,
"limit_day": 50000,
"remaining_minute": 998,
"remaining_day": 49993
}
}
}