Skip to main content

What You Can Build

  • Revenue Dashboards: Real-time earnings tracking and visualization
  • Financial Reports: Transaction history, chargebacks, tax preparation
  • Performance Analytics: Track revenue by content type, time period, or category
  • Content Insights: See which posts, stories, and streams perform best

Quick Example

Get earnings chart data:
const response = await fetch("https://api.ofauth.com/v2/access/statistics/earnings/chart?" + new URLSearchParams({
  startDate: "2024-01-01",
  endDate: "2024-01-31",
  by: "total"
}), {
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123"
  }
})

const chart = await response.json()
console.log("Earnings data:", chart)

Common Operations

Get Earnings Chart

Overview of earnings with time-series data:
const response = await fetch("https://api.ofauth.com/v2/access/statistics/earnings/chart?" + new URLSearchParams({
  startDate: "2024-01-01",
  endDate: "2024-01-31",
  by: "total",        // See filter options below
  withTotal: "true"   // Include totals
}), {
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123"
  }
})

const chartData = await response.json()

Earnings Filter Options

Filter by earnings category:
// By total (default)
?by=total

// By source type
?by=subscribes    // Subscription earnings
?by=tips          // All tips
?by=messages      // PPV messages
?by=post          // PPV posts
?by=stream        // Stream earnings

// By tip source
?by=tips_profile  // Profile tips
?by=tips_post     // Post tips
?by=tips_chat     // Chat tips
?by=tips_stream   // Stream tips
?by=tips_story    // Story tips

// Referrals
?by=ref           // Referral earnings

List Transactions

Get detailed transaction history:
const response = await fetch("https://api.ofauth.com/v2/access/statistics/transactions?" + new URLSearchParams({
  startDate: "2024-01-01",
  type: "subscribes"  // Filter by type
}), {
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123"
  }
})

const transactions = await response.json()

Transaction Types

// Subscription payments
?type=subscribes

// Chat message purchases (PPV)
?type=chat_messages

// Post purchases
?type=post

// Stream purchases
?type=stream

// Tips (with optional source filter)
?type=tips&tipsSource=chat      // Chat tips
?type=tips&tipsSource=post_all  // Post tips
?type=tips&tipsSource=profile   // Profile tips
?type=tips&tipsSource=story     // Story tips
?type=tips&tipsSource=stream    // Stream tips

Get Chargebacks

Monitor disputed transactions:
const response = await fetch("https://api.ofauth.com/v2/access/statistics/chargebacks?" + new URLSearchParams({
  startDate: "2024-01-01",
  endDate: "2024-01-31",
  limit: "20",
  offset: "0"
}), {
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123"
  }
})

const chargebacks = await response.json()

Content Performance

Top Posts

See your best performing posts:
const response = await fetch("https://api.ofauth.com/v2/access/statistics/posts/top?" + new URLSearchParams({
  startDate: "2024-01-01",
  endDate: "2024-01-31",
  by: "purchases",  // purchases | tips | views | likes | comments
  limit: "10"
}), {
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123"
  }
})

const topPosts = await response.json()

Posts Chart

Time-series post performance:
const response = await fetch("https://api.ofauth.com/v2/access/statistics/posts/chart?" + new URLSearchParams({
  startDate: "2024-01-01",
  endDate: "2024-01-31",
  by: "purchases",  // purchases | posts | tips | views | likes | comments
  withTotal: "true"
}), {
  headers }
)

Top Stories

const response = await fetch("https://api.ofauth.com/v2/access/statistics/stories/top?" + new URLSearchParams({
  startDate: "2024-01-01",
  endDate: "2024-01-31",
  by: "views",  // views | tips | likes | comments
  limit: "10"
}), {
  headers
})

Top Streams

const response = await fetch("https://api.ofauth.com/v2/access/statistics/streams/top?" + new URLSearchParams({
  startDate: "2024-01-01",
  endDate: "2024-01-31",
  by: "purchases",  // purchases | duration | tips | views | likes | comments
  limit: "10"
}), {
  headers
})

Post Stats by ID

Get detailed stats for a specific post:
const response = await fetch("https://api.ofauth.com/v2/access/statistics/posts/POST_ID/stats", {
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123"
  }
})

const postStats = await response.json()
// Returns stats with chart data

Marketing Performance

Promotions Stats

const response = await fetch("https://api.ofauth.com/v2/access/statistics/promotions/top?" + new URLSearchParams({
  startDate: "2024-01-01",
  endDate: "2024-01-31"
}), {
  headers
})

Trials Stats

const response = await fetch("https://api.ofauth.com/v2/access/statistics/trials/top?" + new URLSearchParams({
  startDate: "2024-01-01",
  endDate: "2024-01-31"
}), {
  headers
})

Campaigns Stats

const response = await fetch("https://api.ofauth.com/v2/access/statistics/campaigns/top?" + new URLSearchParams({
  startDate: "2024-01-01",
  endDate: "2024-01-31"
}), {
  headers
})

Mass Message Buyers

See who purchased from a specific mass message:
const response = await fetch("https://api.ofauth.com/v2/access/statistics/messages/queue/QUEUE_ID/buyers?" + new URLSearchParams({
  limit: "20",
  offset: "0"
}), {
  headers
})

const buyers = await response.json()

API Endpoints

Earnings & Transactions

EndpointMethodDescription
/v2/access/statistics/earnings/chartGETEarnings time-series data
/v2/access/statistics/transactionsGETTransaction history
/v2/access/statistics/chargebacksGETChargebacks list

Content Performance

EndpointMethodDescription
/v2/access/statistics/posts/chartGETPosts chart data
/v2/access/statistics/posts/topGETTop performing posts
/v2/access/statistics/posts/{postId}/statsGETSingle post stats
/v2/access/statistics/stories/chartGETStories chart data
/v2/access/statistics/stories/topGETTop stories
/v2/access/statistics/streams/chartGETStreams chart data
/v2/access/statistics/streams/topGETTop streams

Marketing

EndpointMethodDescription
/v2/access/statistics/promotions/chartGETPromotions chart
/v2/access/statistics/promotions/topGETTop promotions
/v2/access/statistics/trials/chartGETTrials chart
/v2/access/statistics/trials/topGETTrials stats
/v2/access/statistics/campaigns/chartGETCampaigns chart
/v2/access/statistics/campaigns/topGETCampaigns stats
/v2/access/statistics/mass-messages/chartGETMass messages chart
/v2/access/statistics/mass-messages/boughtGETMass messages bought
/v2/access/statistics/messages/queue/{id}/buyersGETQueue message buyers

Other

EndpointMethodDescription
/v2/access/statistics/visitor-countries/chartGETVisitor countries chart
/v2/access/statistics/visitor-countries/topGETTop visitor countries

Full API Reference

See complete endpoint documentation

Query Parameters

Date Range

ParameterTypeDescription
startDatestringStart date (ISO format or YYYY-MM-DD)
endDatestringEnd date (ISO format or YYYY-MM-DD)
withTotalbooleanInclude totals in response

Pagination

ParameterTypeDefaultDescription
limitnumber20Results per page (1-20 for stats, 1-100 for some endpoints)
offsetnumber0Pagination offset
markernumber-Transaction pagination cursor

Tips & Best Practices

Date Ranges: All statistics endpoints accept startDate and endDate for filtering. Use ISO format or YYYY-MM-DD.
Currency: All amounts are in USD. OnlyFans converts payments from other currencies automatically.
Financial Data: Handle earnings data securely. This is sensitive financial information that should be protected appropriately.
Chart Data: Chart endpoints return time-series data useful for visualizations. Use withTotal: true to include summary totals.