Data Exports

Create Data Export

Changed on

Create a new data export request. This will calculate the required credits and prepare the export for starting.

post/api/data-exports

Request

  • Base URL
    https://app.onlyfansapi.com
  • URL
    https://app.onlyfansapi.com/api/data-exports
  • Auth
    HTTP bearer

Request body

type'transactions' | 'chat_messages' | 'media_vault' | 'trial_links' | 'tracking_links' | 'smart_links' | 'payouts' | 'chargebacks' | 'public_profiles' | 'fans' | 'followings' | 'profile_visitors' | 'fansly_chat_messages' required

The type of data to export. Use fansly_chat_messages to export Fansly chat messages (all other types are OnlyFans). profile_visitors returns one row per account per day, scraped one day at a time so the daily numbers are not aggregated away by OnlyFans.

account_idsstring[]

Array of account prefixed IDs to export data from. Not required for public_profiles type. For fansly_chat_messages, pass Fansly account prefixed IDs (fansly_acct_...); all other types take OnlyFans account IDs.

start_datestring required

The start date for the export (ISO 8601 format).

end_datestring required

The end date for the export (ISO 8601 format).

export_columnsstring[]

Array of column names to include in the export (optional, defaults to all columns for the export type)

file_type'csv' | 'xlsx' | 'zip' required

The output file format. Supported formats vary by export type: csv or xlsx for transactions, chat_messages, fansly_chat_messages, trial_links, tracking_links, smart_links, payouts, chargebacks, public_profiles, fans, followings, profile_visitors; zip for media_vault.

optionsobject

Type-specific export options. For chat_messages: maxMessages (required per account, max 10,000,000), maxChats (optional per-account chat scrape limit), skipMassMessages (optional, bool), chatIds (optional array of numeric fan/chat IDs; filters output and can drastically reduce totals). For fansly_chat_messages: maxMessages (required per account, max 10,000,000), maxChats (optional per-account chat scrape limit), chatIds (optional array of Fansly group ID strings; filters output and can drastically reduce totals). For media_vault: mediaType (required, one of: all, photo, gif, video, audio). For fans: type (required, one of: all, active, expired, latest). For followings: type (required, one of: all, active, expired). For public_profiles: query (optional, full-text search), gender (optional, filter: male, female, trans, couple), minSubscribePrice (optional, USD), maxSubscribePrice (optional, USD), location (optional), minPostsCount (optional, minimum posts), minPhotosCount (optional, minimum photos), minVideosCount (optional, minimum videos), minSubscribersCount (optional, minimum subscribers), maxSubscribersCount (optional, maximum subscribers), minJoinDate (optional, ISO 8601 date), minLastSeenAt (optional, ISO 8601 date), createdAtFrom (optional, ISO 8601 date, profile added to DB after), createdAtTo (optional, ISO 8601 date, profile added to DB before), instagram (optional), twitter (optional), tiktok (optional), maxResults (optional, limit results).

auto_startboolean

When true, automatically starts the export after creation.

Example request

{
  "type": "transactions",
  "account_ids": [
    "acc_abc123",
    "acc_def456"
  ],
  "start_date": "2024-01-01T00:00:00Z",
  "end_date": "2024-12-31T23:59:59Z",
  "export_columns": [
    "transaction_id",
    "amount",
    "created_at"
  ],
  "file_type": "csv",
  "options": {
    "maxChats": 100,
    "maxMessages": 50000,
    "skipMassMessages": false
  },
  "auto_start": true
}

Response

Success

Example response

{
  "data": {
    "id": "data_export_abc123xyz789",
    "type": "chat_messages",
    "status": "calculating_credits",
    "start_date": "2024-01-01T00:00:00+00:00",
    "end_date": "2024-12-31T23:59:59+00:00",
    "file_type": "csv",
    "created_at": "2024-12-02T12:00:00+00:00",
    "requires_scraping": true,
    "credit_calculation_note": "This export type requires data scraping. Credits will be calculated and charged after scraping completes."
  },
  "_meta": {
    "_credits": {
      "used": 0,
      "balance": 9500,
      "note": "Always"
    },
    "_cache": {
      "is_cached": false,
      "note": "Cache disabled for this endpoint"
    },
    "_rate_limits": {
      "limit_minute": 60,
      "limit_day": null,
      "remaining_minute": 56,
      "remaining_day": null,
      "notice": ""
    }
  }
}

Changes