OnlyFans API Documentation
Complete developer documentation for integrating the OnlyFans API. RESTful endpoints, authentication, webhooks, and real-world examples. Learn how to build powerful creator tools with our enterprise-grade OnlyFans API solution.
OnlyFans API Authentication
OAuth 2.0 Authentication
The OnlyFans API uses OAuth 2.0 for secure authentication. Follow these steps to authenticate your application:
1. Register Your Application
Get your client_id and client_secret from the OnlyFans API dashboard
2. Request Authorization
Redirect users to OnlyFans authorization endpoint
3. Exchange Code for Token
Exchange the authorization code for an access token
Example: Get Access Token
POST https://api.of-api.com/oauth/token
Content-Type: application/json
{
"grant_type": "authorization_code",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"code": "AUTHORIZATION_CODE",
"redirect_uri": "https://yourapp.com/callback"
}
OnlyFans API Endpoints
User Management
GET /api/v1/users/{user_id}
ReadGet user profile information including stats and metadata
GET /api/v1/users/{user_id}/posts
ReadRetrieve all posts from a specific user with pagination
POST /api/v1/users/{user_id}/subscribe
WriteSubscribe to a creator's OnlyFans account
Content Management
POST /api/v1/posts
WriteCreate a new post with text, images, or videos
PUT /api/v1/posts/{post_id}
UpdateUpdate existing post content or settings
DELETE /api/v1/posts/{post_id}
DeleteDelete a post and all associated media
Messaging & Chat
GET /api/v1/messages
ReadGet all messages and conversations
POST /api/v1/messages/send
WriteSend a message to a subscriber or creator
OnlyFans API Webhooks
Receive real-time notifications when events occur in OnlyFans. Configure webhook endpoints to stay synchronized with user activities.
Available Webhook Events
Example Webhook Payload
{
"event": "subscription.created",
"timestamp": "2025-01-15T10:30:00Z",
"data": {
"subscriber_id": "12345",
"creator_id": "67890",
"price": 9.99,
"currency": "USD",
"status": "active"
}
}
OnlyFans API Code Examples
Python Example
import requests
# OnlyFans API Authentication
headers = {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
}
# Get user profile
response = requests.get(
'https://api.of-api.com/v1/users/123456',
headers=headers
)
user_data = response.json()
print(f"Username: {user_data['username']}")
print(f"Subscribers: {user_data['subscriber_count']}")
Node.js Example
const axios = require('axios');
// OnlyFans API client
const ofApi = axios.create({
baseURL: 'https://api.of-api.com/v1',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
}
});
// Create a new post
async function createPost(content, mediaIds) {
try {
const response = await ofApi.post('/posts', {
text: content,
media: mediaIds
});
return response.data;
} catch (error) {
console.error('Error:', error);
}
}
Rate Limits & Best Practices
API Rate Limits
- Standard: 1,000 requests per hour
- Premium: 10,000 requests per hour
- Enterprise: Custom limits available
Best Practices
- Use webhook events instead of polling
- Implement exponential backoff for retries
- Cache responses when appropriate
Ready to Build with OnlyFans API?
Get instant access to the most powerful OnlyFans API with comprehensive documentation and support.