The Proxy Management API provides endpoints for managing proxy configurations for OnlyFans accounts. These endpoints allow you to retrieve, assign, update, and manage proxies for different accounts.

Base URLs

API requests can be made to the following base URLs depending on the environment:
  • Production: https://onlyautomator.com
  • Local Web App: http://localhost:3000
  • Local Microservice: http://localhost:3001
// Example base URLs:
https://onlyautomator.com
http://localhost:3000
http://localhost:3001

Authentication

All proxy management endpoints require authentication using a bearer token passed in the Authorization header:
Authorization: Bearer YOUR_API_TOKEN

Endpoints Overview

Endpoints

Get Account Proxy Configuration

GET /api/proxy/account/{accountId}
Retrieves the proxy configuration for a specific OnlyFans account.

Path Parameters

ParameterTypeDescription
accountIdstringThe unique identifier of the account

Response

{
  "data": {
    "proxy_id": "ws_proxy_12345abcde",
    "proxy_address": "185.123.101.234",
    "proxy_port": 8080,
    "proxy_username": "username123",
    "proxy_password": "password123", // Decrypted for API response
    "proxy_country_code": "US",
    "proxy_assigned_at": "2023-09-15T14:32:45Z",
    "proxy_mode": "auto",
    "proxy_is_active": true,
    "proxy_region_preference": "EU"
  }
}

Assign Automatic Proxy

POST /api/proxy/account/{accountId}/assign-auto
Automatically assigns a Webshare proxy to the specified account.

Path Parameters

ParameterTypeDescription
accountIdstringThe unique identifier of the account

Request Body

{
  "countryCode": "US", // Optional preferred country code
  "forceReassign": false // Force reassignment even if account already has a proxy
}

Response

{
  "data": {
    "proxy_id": "ws_proxy_12345abcde",
    "proxy_address": "185.123.101.234",
    "proxy_port": 8080,
    "proxy_country_code": "US",
    "proxy_assigned_at": "2023-09-15T14:32:45Z",
    "proxy_mode": "auto",
    "message": "Proxy assigned successfully"
  }
}

Set Manual Proxy

POST /api/proxy/account/{accountId}/set-manual
Manually sets a proxy configuration for the specified account.

Path Parameters

ParameterTypeDescription
accountIdstringThe unique identifier of the account

Request Body

{
  "proxy_address": "185.123.101.234", // Required
  "proxy_port": 8080, // Required
  "proxy_username": "username123", // Required
  "proxy_password": "password123", // Required
  "proxy_country_code": "US" // Optional
}

Response

{
  "data": {
    "proxy_address": "185.123.101.234",
    "proxy_port": 8080,
    "proxy_country_code": "US",
    "proxy_mode": "manual",
    "proxy_assigned_at": "2023-09-15T14:32:45Z",
    "message": "Manual proxy configured successfully"
  }
}

Set Proxy Preferences

PUT /api/proxy/account/{accountId}/preference
Updates proxy preferences for the specified account.

Path Parameters

ParameterTypeDescription
accountIdstringThe unique identifier of the account

Request Body

{
  "proxy_region_preference": "EU", // Optional preferred region
  "proxy_is_active": true // Whether the proxy should be actively used
}

Response

{
  "data": {
    "proxy_region_preference": "EU",
    "proxy_is_active": true,
    "message": "Proxy preferences updated successfully"
  }
}

Disable Proxy

POST /api/proxy/account/{accountId}/disable
Disables the proxy configuration for the specified account.

Path Parameters

ParameterTypeDescription
accountIdstringThe unique identifier of the account

Response

{
  "data": {
    "proxy_is_active": false,
    "message": "Proxy disabled successfully"
  }
}

Handle Proxy Failure

POST /api/proxy/account/{accountId}/handle-failure
Reports and handles a proxy failure for the specified account.

Path Parameters

ParameterTypeDescription
accountIdstringThe unique identifier of the account

Request Body

{
  "error": "Connection timeout", // Description of the proxy failure
  "autoReassign": true // Whether to automatically assign a new proxy
}

Response

{
  "data": {
    "message": "Proxy failure handled",
    "reassigned": true,
    "new_proxy_info": {
      "proxy_id": "ws_proxy_12345abcde",
      "proxy_address": "185.123.101.234",
      "proxy_port": 8080,
      "proxy_country_code": "US"
    }
  }
}

Get Available Webshare Proxies

GET /api/proxy/webshare/available
Retrieves a list of available proxies from Webshare API.

Query Parameters

ParameterTypeDescription
countryCodestringFilter proxies by country code (optional)
limitintegerMaximum number of proxies to return (default: 10)

Response

{
  "data": [
    {
      "id": "ws_proxy_12345abcde",
      "address": "185.123.101.234",
      "port": 8080,
      "country_code": "US",
      "is_residential": true
    },
    {
      "id": "ws_proxy_67890fghij",
      "address": "46.137.89.123",
      "port": 8080,
      "country_code": "UK",
      "is_residential": true
    }
  ]
}

Utility Endpoints

Get Client IP

GET /api/whatsmyip
Returns the client’s IP address as seen by the server. Useful for testing proxy functionality.

Response

{
  "ip": "185.123.101.234"
}

Error Responses

All endpoints return standardized error responses:

400 Bad Request

{
  "error": "Invalid proxy configuration. All fields are required."
}

401 Unauthorized

{
  "error": "Unauthorized"
}

404 Not Found

{
  "error": "Account not found"
}

500 Server Error

{
  "error": "Failed to assign proxy"
}

Integration Examples

JavaScript Example (Assign Auto Proxy)

async function assignAutoProxy(accountId, countryCode) {
  const response = await fetch(`https://onlyautomator.com/api/proxy/account/${accountId}/assign-auto`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer YOUR_API_TOKEN' // Replace with your actual token
    },
    body: JSON.stringify({
      countryCode: countryCode
    })
  });
  
  if (!response.ok) {
    const errorData = await response.json();
    throw new Error(`API Error (${response.status}): ${errorData.error}`);
  }
  
  return await response.json();
}

// Usage
assignAutoProxy('acc_your_account_id', 'US')
  .then(result => console.log('Success:', result))
  .catch(error => console.error('Failed:', error));

Python Example (Get Proxy Config)

import requests
import json

def get_proxy_config(account_id, api_token):
    url = f"https://onlyautomator.com/api/proxy/account/{account_id}" # Use appropriate base URL
    headers = {
        "Content-Type": "application/json",
        "Authorization": f"Bearer {api_token}" # Replace with your actual token
    }
    
    try:
        response = requests.get(url, headers=headers)
        response.raise_for_status() # Raises HTTPError for bad responses (4XX, 5XX)
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f"Error fetching proxy config: {e}")
        if e.response is not None:
            try:
                print(f"Server response: {e.response.json()}")
            except json.JSONDecodeError:
                print(f"Server response (non-JSON): {e.response.text}")
        return None

# Usage
config = get_proxy_config("acc_your_account_id", "your_api_token")
if config:
    print("Proxy Config:", config)

Best Practices

  1. Security: Always keep your API tokens secure and never expose them in client-side code intended for end-users.
  2. Error Handling: Implement robust error handling for API responses, checking status codes and error messages.
  3. Proxy Usage: Avoid frequently changing proxies for the same account to maintain session validity.
  4. Rate Limiting: Be mindful of potential API rate limits when making multiple requests in quick succession.
  5. IP Validation: Use the /api/whatsmyip endpoint to verify proxy functionality after configuration or assignment.