Skip to content
Fans API
[official python sdk]

OnlyFans
Python SDK

A typed, production-ready Python client for the OnlyFans API. Authenticate once, call any endpoint, and ship reliable creator tools with less boilerplate.

Install
# install from PyPI
pip install onlyfans
/Python 3.9+/Sync & Async Clients/Built-in Retries
[code examples]

Link stats, chats, messages, media

Fetch the dashboard summary for a tracking link and derive ARPS and lifetime revenue from the typed totals.
from onlyfansapi import OnlyFansAPI

client = OnlyFansAPI()

stats = client.tracking_links.get_stats(
    "tracking_link_id",
    account="acct_XXXXXXXXXXXXX",
)

summary = stats.data.summary
arps = summary.revenue_total / max(summary.subs_total, 1)
print(f"Clicks: {summary.clicks_total} · Subs: {summary.subs_total}")
print(f"ARPS: ${arps:.2f} · Lifetime: ${summary.revenue_total:.2f}")

# Output:
# Clicks: 1240 · Subs: 300
# ARPS: $12.40 · Lifetime: $3720.00
[features]

Made for modern
Python applications

From a quick script to a high-concurrency service, the client scales with you.

  • Sync and async

    Use OnlyFans API for synchronous work or Async OnlyFans API with await.

  • Typed models

    TypedDict requests and Pydantic responses bring autocomplete to every call.

  • Flexible uploads

    Upload bytes, PathLike values, or filename and media-type tuples.

[built for real products]

Turn API access into useful creator tools

Use one consistent client across dashboards, internal operations, and automated workflows.

  • Analytics Dashboards

    Bring account and performance data into reporting experiences your team can act on.

  • Media Workflows

    Build upload flows around familiar file, stream, and byte-based objects.

  • Internal Automation

    Build upload flows around familiar file, stream, and byte-based objects.

  • Multi-account tools

    Create focused interfaces for teams working across multiple connected accounts.

  • Reporting Pipelines

    Move structured API responses into warehouses, spreadsheets, and custom reports.

  • Custom integrations

    Extend the typed client with custom requests when your product needs more flexibility.

[keep exploring]

Everything you need
for the next step

Move from the quick start to complete endpoint details and source code.

  • Screenshot of the Python SDK documentation

    Python SDK docs

    Installation, configuration, examples, and language-specific guidance.

  • Screenshot of the OnlyFans API reference

    API reference

    Explore endpoints, parameters, response schemas, and error details.

  • Screenshot of the onlyfansapi-python GitHub repository

    Source on GitHub

    Review the SDK source, releases, examples, and contribution guide.

[faq]

Questions before you start

The questions agencies and developers actually ask, answered by the team that runs proxies at scale.

Do you have more questions?Contact Us

Python SDK hero
[start building]

Build your next integration with Python

Install the SDK, connect your API key, and make your first OnlyFans API request in minutes.