### List Stored Free Trial Links Source: https://docs.onlyfansapi.com/llms.mdx/api-reference/stored-free-trial-links/list-stored-free-trial-links This example shows how to make a GET request to retrieve a list of stored free trial links. It includes parameters for pagination and filtering. ```bash curl -X GET "https://app.onlyfansapi.com/api/acct_abc123/stored/trial-links?limit=10&offset=0" \ -H "accept: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Example Request Body for Get Transactions By Type Source: https://docs.onlyfansapi.com/llms.mdx/api-reference/analytics-financial/get-transactions-by-type This is an example of the JSON request body required to fetch transaction data. It includes account IDs, a start date, and an end date. ```json { "account_ids": [ "acc_abc123", "acc_def456" ], "start_date": "2024-01-01", "end_date": "2024-12-31" } ``` -------------------------------- ### Install @onlyfansapi/auth with bun Source: https://docs.onlyfansapi.com/auth/installation Install the authentication package using bun. ```bash bun add @onlyfansapi/auth ``` -------------------------------- ### OpenAPI Specification for Get Model Start Date Source: https://docs.onlyfansapi.com/api-reference/account/get-model-start-date This OpenAPI specification defines the GET request for the /api/{account}/me/model-start-date endpoint. It outlines the path parameter 'account' and the GET operation to retrieve the model start date. ```yaml https://app.onlyfansapi.com/scribe-docs/openapi.yaml get /api/{account}/me/model-start-date openapi: 3.0.3 info: title: OnlyFans API description: "" version: 1.0.0 servers: - url: https://app.onlyfansapi.com security: - default: [] tags: - name: API Keys description: "" - name: Account description: Endpoints for your linked accounts - name: Analytics - Financial description: APIs for retrieving financial analytics data - name: Analytics - Summary description: APIs for retrieving summary analytics data - name: Banking description: Operations related to user banking details, payout methods, legal and tax information, and account country settings. - name: Chargebacks description: "" - name: Chat Messages description: "" - name: Chats description: "" - name: Client Sessions description: "" - name: Connect OnlyFans Account description: "" - name: Data Exports description: APIs for managing data exports - name: Engagement / Messages description: "" - name: Fans description: APIs for managing OnlyFans fans (subscribers) - name: Fans - AI Summary description: APIs for generating and retrieving AI-powered fan profile summaries - name: Following description: APIs for managing OnlyFans followings (people you're subscribed to) - name: Free Trial Links description: APIs for managing Free Trial Links - name: Giphy description: "" - name: Link Tags description: APIs for managing tags on free trial links, tracking links, and Smart Links - name: Mass Messaging description: "" - name: Media description: "" - name: Media Vault description: "" - name: Media Vault Lists description: "" - name: Notifications description: Endpoints for managingr account notifications - name: Payouts description: "" - name: Post Comments description: "" - name: Post Labels description: APIs for managing your post labels - name: Posts description: APIs for managing OnlyFans posts - name: Promotions description: "" - name: Public Profiles description: "" - name: Queue description: "" - name: Release Forms description: APIs for managing OnlyFans release forms - name: Saved For Later (Messages) description: "" - name: Saved For Later (Posts) description: "" - name: Settings description: "" - name: Shared Free Trial Links description: APIs for Free Trial Links that other OF creators have shared with this account. Revenue, cost, and spender data are not available for shared links. - name: Shared Tracking Links description: APIs for Tracking Links (campaigns) that other OF creators have shared with this account. Revenue, cost, and spender data are not available for shared campaigns. - name: Smart Link Postbacks description: APIs for managing Smart Link postback destinations - name: Smart Links description: APIs for managing Smart Links (Free Trial Links and Tracking Links with pooled inventory) - name: Statistics description: "" - name: Stored Free Trial Links description: Instant APIs for retrieving stored free trial links from the OnlyFansAPI Cache (free, no credits used) - name: Stored Shared Free Trial Links description: Instant APIs for retrieving stored shared Free Trial Links from the OnlyFansAPI Cache (free, no credits used) - name: Stored Shared Tracking Links description: Instant APIs for retrieving stored shared Tracking Links (campaigns) from the OnlyFansAPI Cache (free, no credits used) - name: Stored Tracking Links description: Instant APIs for retrieving stored tracking links from the OnlyFansAPI Cache (free, no credits used) - name: Stories description: APIs for managing OnlyFans stories - name: Story Highlights description: APIs for managing OnlyFans story highlights - name: Subscription Bundles description: "" - name: Tracking Links description: APIs for managing tracking links - name: Transactions description: APIs for managing OnlyFans transactions - name: User List Collections description: "" - name: Users description: APIs for fetching OnlyFans users - name: Webhooks description: "" paths: /api/{account}/me/model-start-date: parameters: - in: path name: account description: The Account ID example: acct_XXXXXXXXXXXXXXX required: true schema: type: string get: summary: Get Model Start Date operationId: getModelStartDate ``` -------------------------------- ### Example Response Body for Get Transactions By Type Source: https://docs.onlyfansapi.com/llms.mdx/api-reference/analytics-financial/get-transactions-by-type This is an example of a successful JSON response. It shows transaction data aggregated by type, including the count and total amount for each type. ```json [ { "type": "subscription", "count": 100, "total": 5000 }, { "type": "tip", "count": 50, "total": 2500 } ] ``` -------------------------------- ### Initialize Prisma Source: https://docs.onlyfansapi.com/llms.mdx/auth/examples/nextjs-prisma Initializes Prisma in the project and sets up the schema.prisma file. ```bash npx prisma init ``` -------------------------------- ### List Available Payout Systems Source: https://docs.onlyfansapi.com/llms.mdx/api-reference/banking/list-available-payout-systems This example demonstrates how to call the API to retrieve a list of available payout systems. It shows the structure of the response, including details for each payout method. ```bash curl -X GET "https://api.onlyfansapi.com/v1/payouts/systems" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Get Model Start Date Source: https://docs.onlyfansapi.com/api-reference/account/get-model-start-date Fetches the date and time when a model's monetization was enabled. ```APIDOC ## GET /model/start-date ### Description Get the start date of the model (the date+time monetization was enabled) ### Method GET ### Endpoint /model/start-date ### Parameters ### Request Body ### Response #### Success Response (200) - **data** (object) - Contains the start date information. - **startDate** (string) - The date and time monetization was enabled (e.g., "2025-01-01 01:01:01"). - **_meta** (object) - Metadata about the API response. - **_credits** (object) - Information about API credit usage. - **used** (integer) - Number of credits used. - **balance** (integer) - Remaining credit balance. - **note** (string) - Note regarding credits. - **_cache** (object) - Information about caching. - **is_cached** (boolean) - Indicates if the response was served from cache. - **note** (string) - Note regarding caching. - **_rate_limits** (object) - Information about API rate limits. - **limit_minute** (integer) - The rate limit per minute. - **limit_day** (integer) - The rate limit per day. - **remaining_minute** (integer) - Remaining requests allowed per minute. - **remaining_day** (integer) - Remaining requests allowed per day. ### Request Example ```json { "example": "" } ``` ### Response Example ```json { "data": { "startDate": "2025-01-01 01:01:01" }, "_meta": { "_credits": { "used": 1, "balance": 999999841, "note": "Always" }, "_cache": { "is_cached": false, "note": "Cache disabled for this endpoint" }, "_rate_limits": { "limit_minute": 10000000, "limit_day": 50000, "remaining_minute": 9999998, "remaining_day": 49998 } } } ``` ``` -------------------------------- ### Example Request Body for Historical Performance Source: https://docs.onlyfansapi.com/llms.mdx/api-reference/analytics-summary/get-historical-performance This example shows how to structure the request body to get historical performance data for the last 12 months. Ensure the 'time_range' parameter is one of the allowed enum values. ```json { "time_range": "12m" } ``` -------------------------------- ### Initialize Prisma Database Source: https://docs.onlyfansapi.com/auth/examples/nextjs-prisma Use these commands to generate the Prisma client and push your schema to the database. Ensure Prisma is installed in your project. ```bash npx prisma generate npx prisma db push ``` -------------------------------- ### Client Session Token Response Example Source: https://docs.onlyfansapi.com/auth/installation The response contains a 'token' field, which is your client session token. This token starts with 'ofapi_cs_'. ```json { "data": { "token": "ofapi_cs_OriR8Sdocp0f97eFOdbMMZtiz4Aw5FLX", "display_name": "My Application / Model: John Doe" } } ``` -------------------------------- ### Install @onlyfansapi/auth with yarn Source: https://docs.onlyfansapi.com/auth/installation Install the authentication package using yarn. ```bash yarn add @onlyfansapi/auth ``` -------------------------------- ### Get Specific Chat Message OpenAPI Specification Source: https://docs.onlyfansapi.com/api-reference/chat-messages/get-specific-chat-message This OpenAPI specification defines the GET request for retrieving a specific chat message. It details the path parameters, including account ID, chat ID, and message ID, along with their descriptions and examples. ```yaml openapi: 3.0.3 info: title: OnlyFans API description: "" version: 1.0.0 servers: - url: https://app.onlyfans.com security: - default: [] tags: - name: API Keys description: "" - name: Account description: Endpoints for your linked accounts - name: Analytics - Financial description: APIs for retrieving financial analytics data - name: Analytics - Summary description: APIs for retrieving summary analytics data - name: Banking description: Operations related to user banking details, payout methods, legal and tax information, and account country settings. - name: Chargebacks description: "" - name: Chat Messages description: "" - name: Chats description: "" - name: Client Sessions description: "" - name: Connect OnlyFans Account description: "" - name: Data Exports description: APIs for managing data exports - name: Engagement / Messages description: "" - name: Fans description: APIs for managing OnlyFans fans (subscribers) - name: Fans - AI Summary description: APIs for generating and retrieving AI-powered fan profile summaries - name: Following description: APIs for managing OnlyFans followings (people you're subscribed to) - name: Free Trial Links description: APIs for managing Free Trial Links - name: Giphy description: "" - name: Link Tags description: APIs for managing tags on free trial links, tracking links, and Smart Links - name: Mass Messaging description: "" - name: Media description: "" - name: Media Vault description: "" - name: Media Vault Lists description: "" - name: Notifications description: Endpoints for managingr account notifications - name: Payouts description: "" - name: Post Comments description: "" - name: Post Labels description: APIs for managing your post labels - name: Posts description: APIs for managing OnlyFans posts - name: Promotions description: "" - name: Public Profiles description: "" - name: Queue description: "" - name: Release Forms description: APIs for managing OnlyFans release forms - name: Saved For Later (Messages) description: "" - name: Saved For Later (Posts) description: "" - name: Settings description: "" - name: Shared Free Trial Links description: APIs for Free Trial Links that other OF creators have shared with this account. Revenue, cost, and spender data are not available for shared links. - name: Shared Tracking Links description: APIs for Tracking Links (campaigns) that other OF creators have shared with this account. Revenue, cost, and spender data are not available for shared campaigns. - name: Smart Link Postbacks description: APIs for managing Smart Link postback destinations - name: Smart Links description: APIs for managing Smart Links (Free Trial Links and Tracking Links with pooled inventory) - name: Statistics description: "" - name: Stored Free Trial Links description: Instant APIs for retrieving stored free trial links from the OnlyFansAPI Cache (free, no credits used) - name: Stored Shared Free Trial Links description: Instant APIs for retrieving stored shared Free Trial Links from the OnlyFansAPI Cache (free, no credits used) - name: Stored Shared Tracking Links description: Instant APIs for retrieving stored shared Tracking Links (campaigns) from the OnlyFansAPI Cache (free, no credits used) - name: Stored Tracking Links description: Instant APIs for retrieving stored tracking links from the OnlyFansAPI Cache (free, no credits used) - name: Stories description: APIs for managing OnlyFans stories - name: Story Highlights description: APIs for managing OnlyFans story highlights - name: Subscription Bundles description: "" - name: Tracking Links description: APIs for managing tracking links - name: Transactions description: APIs for managing OnlyFans transactions - name: User List Collections description: "" - name: Users description: APIs for fetching OnlyFans users - name: Webhooks description: "" paths: /api/{account}/chats/{chat_id}/messages/{message_id}: parameters: - in: path name: account description: The Account ID example: acct_XXXXXXXXXXXXXXX required: true schema: type: string - in: path ``` -------------------------------- ### Install @onlyfansapi/auth with npm Source: https://docs.onlyfansapi.com/auth/installation Install the authentication package using npm. ```bash npm install @onlyfansapi/auth ``` -------------------------------- ### Install Dependencies Source: https://docs.onlyfansapi.com/auth/examples/nextjs-prisma Installs the necessary packages for authentication, Prisma ORM, and PostgreSQL adapter. ```bash npm install @onlyfansapi/auth prisma @prisma/client @prisma/adapter-pg pg ``` -------------------------------- ### Start OnlyFans Authentication with TypeScript Source: https://docs.onlyfansapi.com/auth/examples/nextjs-prisma Initiates the authentication flow and defines callbacks for success and error handling. Ensure you have the @onlyfansapi/auth package installed. ```typescript import { startOnlyFansAuthentication, AuthSuccessData, AuthFailureError } from "@onlyfansapi/auth"; startOnlyFansAuthentication(token, { onSuccess: (data: AuthSuccessData) => { console.log(data.accountId); // string console.log(data.username); // string console.log(data.onlyfansData.name); // string }, onError: (error: AuthFailureError) => { console.log(error.message); // string }, }); ``` -------------------------------- ### List Free Trial Link Tags Response Example Source: https://docs.onlyfansapi.com/llms.mdx/api-reference/free-trial-links/list-free-trial-link-tags This example shows the JSON response structure when successfully retrieving tags for a free trial link. It includes the tags themselves and metadata about the API call. ```json { "data": { "tags": [ "Instagram", "Twitter" ] }, "_meta": { "_credits": { "used": 0, "balance": 9529, "note": "Free endpoint" }, "_cache": { "is_cached": false, "note": "Cache disabled for this endpoint" }, "_rate_limits": { "limit_minute": 5000, "limit_day": null, "remaining_minute": 4999, "remaining_day": null } } } ``` -------------------------------- ### Get Earning Statistics Source: https://docs.onlyfansapi.com/api-reference/payouts/get-earning-statistics Fetches total and monthly time-series earning statistics for the account. You can specify a start and end date to filter the results. ```APIDOC ## GET /websites/onlyfansapi/earning-statistics ### Description Get total and monthly time-series earning statistics for the account. ### Method GET ### Endpoint /websites/onlyfansapi/earning-statistics ### Parameters #### Query Parameters - **startDate** (string) - Optional - The start date for earning statistics. Keep empty to get all earnings. - **endDate** (string) - Optional - The end date for earning statistics. Keep empty to get all earnings. ### Response #### Success Response (200) - **data** (object) - Contains the earning statistics. - **list** (object) - Monthly earning data. - **months** (object) - Earning data for each month, keyed by timestamp. - **[timestamp]** (object) - Earning details for a specific month. - **tips** (array) - List of tips for the month. - **time** (integer) - Timestamp of the tip. - **net** (integer) - Net amount of the tip. - **gross** (integer) - Gross amount of the tip. - **total_net** (integer) - Total net earnings for the month. - **total_gross** (integer) - Total gross earnings for the month. - **subscribes** (array) - List of subscriptions for the month. - **time** (integer) - Timestamp of the subscription. - **net** (integer) - Net amount of the subscription. - **gross** (integer) - Gross amount of the subscription. - **total** (object) - Aggregated total earnings. - **tips** (object) - Total tips. - **total_net** (number) - Total net tips. - **total_gross** (number) - Total gross tips. - **all** (object) - Overall total earnings. - **total_net** (number) - Total net earnings. - **total_gross** (number) - Total gross earnings. - **subscribes** (object) - Total subscriptions. - **total_net** (number) - Total net subscriptions. - **total_gross** (number) - Total gross subscriptions. - **chat_messages** (object) - Total chat message earnings. - **total_net** (number) - Total net chat message earnings. - **total_gross** (number) - Total gross chat message earnings. - **post** (object) - Total post earnings. - **total_net** (number) - Total net post earnings. - **total_gross** (number) - Total gross post earnings. - **_meta** (object) - Metadata about the API response. - **_credits** (object) - Information about API credits. - **used** (integer) - Credits used. - **balance** (integer) - Remaining credits. - **note** (string) - Note about credits. - **_cache** (object) - Information about caching. - **is_cached** (boolean) - Whether the response is cached. - **note** (string) - Note about caching. - **_rate_limits** (object) - Information about rate limits. - **limit_minute** (integer) - Rate limit per minute. - **limit_day** (integer) - Rate limit per day. - **remaining_minute** (integer) - Remaining requests per minute. - **remaining_day** (integer) - Remaining requests per day. ### Response Example ```json { "data": { "list": { "months": { "1735689661": { "tips": [ { "time": 1735689661, "net": 4, "gross": 5 } ], "total_net": 100, "total_gross": 125, "subscribes": [ { "time": 1735689661, "net": 16, "gross": 20 } ] } } }, "total": { "tips": { "total_net": 123.45, "total_gross": 123.45 }, "all": { "total_net": 123.45, "total_gross": 123.45 }, "subscribes": { "total_net": 123.45, "total_gross": 123.45 }, "chat_messages": { "total_net": 123.45, "total_gross": 123.45 }, "post": { "total_net": 123.45, "total_gross": 123.45 } } }, "_meta": { "_credits": { "used": 1, "balance": 999999842, "note": "Always" }, "_cache": { "is_cached": false, "note": "Cache disabled for this endpoint" }, "_rate_limits": { "limit_minute": 1000, "limit_day": 50000, "remaining_minute": 999, "remaining_day": 49846 } } } ``` ``` -------------------------------- ### Fansly Earnings Stats Response Example Source: https://docs.onlyfansapi.com/llms.mdx/api-reference/fansly/earnings/get-earnings-stats An example of the JSON response structure for the Get Earnings Stats endpoint. It details the 'data' array containing transaction types, gross and net totals, account IDs, and timestamps, along with '_meta' information for API usage. ```json { "data": [ { "type": 2116, "totalGross": 5000, "totalNet": 4000, "accountId": "800000000000000001", "timestamp": 1780358400000 }, { "type": 15001, "totalGross": 10000, "totalNet": 8000, "accountId": "800000000000000001", "timestamp": 1780444800000 } ], "_meta": { "_credits": { "used": 1, "balance": 10055765, "note": "Always" }, "_cache": { "is_cached": false, "note": "Cache disabled for this endpoint" }, "_rate_limits": { "limit_minute": 5000, "limit_day": null, "remaining_minute": 4999, "remaining_day": null, "notice": "We have decided to remove our daily rate limits. Please remove any references to these in your integrations." } } } ``` -------------------------------- ### Install @onlyfansapi/auth with pnpm Source: https://docs.onlyfansapi.com/auth/installation Install the authentication package using pnpm. ```bash pnpm add @onlyfansapi/auth ``` -------------------------------- ### Install fumadocs-ui components Source: https://docs.onlyfansapi.com/llms.mdx/introduction/guides/tiktok-pixel-smart-links Install the necessary components from fumadocs-ui to use steps and callouts in your documentation. ```bash npm install fumadocs-ui # or yarn add fumadocs-ui ``` -------------------------------- ### Get Model Start Date Source: https://docs.onlyfansapi.com/api-reference/account/get-model-start-date Fetches the date and time when a model's monetization was enabled. This is useful for tracking the history of a model's revenue-generating capabilities. ```APIDOC ## GET /api/{account}/me/model-start-date ### Description Get the start date of the model (the date+time monetization was enabled) ### Method GET ### Endpoint /api/{account}/me/model-start-date ### Parameters #### Path Parameters - **account** (string) - Required - The Account ID ### Response #### Success Response (200) - **startDate** (string) - The date and time monetization was enabled. ``` -------------------------------- ### Get Subscriber Statistics Source: https://docs.onlyfansapi.com/api-reference/statistics/get-subscriber-statistics Fetches subscriber and earning statistics for a given period. You can specify start and end dates, and filter by subscriber type (total, renew, new). ```APIDOC ## GET /websites/onlyfansapi/statistics/subscribers ### Description Get subscriber and earning statistics for an account for a specified timeframe. Optionally, filter by all, renews, or new subscribers. ### Method GET ### Endpoint /websites/onlyfansapi/statistics/subscribers ### Query Parameters - **start_date** (string) - Optional - The start date for the period. Keep empty to calculate everything. - **end_date** (string) - Optional - The end date for the period. Keep empty to calculate everything. - **type** (string) - Optional - Filter the subscriber statistics (default = total). Enum: total, renew, new. ### Response #### Success Response (200) - **data** (object) - Contains the statistics data. - **earnings** (array) - List of earnings per date. - **date** (string) - The date of the earnings. - **count** (number) - The amount earned. - **subscribes** (array) - List of subscriber counts per date. - **date** (string) - The date of the subscription count. - **count** (integer) - The number of subscribers. - **total** (number) - Total earnings. - **delta** (number) - Change in earnings. - **subscribers** (integer) - Total number of subscribers. - **_meta** (object) - Metadata about the API response. - **_credits** (object) - Information about API credit usage. - **used** (integer) - Credits used. - **balance** (integer) - Remaining credit balance. - **note** (string) - Note regarding credits. - **_cache** (object) - Information about caching. - **is_cached** (boolean) - Whether the response is cached. - **note** (string) - Note regarding caching. - **_rate_limits** (object) - Information about rate limits. - **limit_minute** (integer) - Rate limit per minute. - **limit_day** (integer) - Rate limit per day. - **remaining_minute** (integer) - Remaining requests per minute. - **remaining_day** (integer) - Remaining requests per day. ### Response Example ```json { "data": { "earnings": [ { "date": "2025-01-01T00:00:00+00:00", "count": 12.34 } ], "subscribes": [ { "date": "2025-01-01T00:00:00+00:00", "count": 123 } ], "total": 12.34, "delta": 12.3, "subscribers": 123 }, "_meta": { "_credits": { "used": 1, "balance": 999999287, "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": 49994 } } } ``` ```