Create Data Export
Create a new data export request. This will calculate the required credits and prepare the export for starting.
Authorization
default Get your API Key from OnlyFansAPI Console - https://app.onlyfansapi.com/api-keys
In: header
Request Body
application/json
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.
"transactions" | "chat_messages" | "media_vault" | "trial_links" | "tracking_links" | "smart_links" | "payouts" | "chargebacks" | "public_profiles" | "fans" | "followings" | "profile_visitors" | "fansly_chat_messages"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.
The start date for the export (ISO 8601 format).
The end date for the export (ISO 8601 format).
Array of column names to include in the export (optional, defaults to all columns for the export type)
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.
"csv" | "xlsx" | "zip"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).
When true, automatically starts the export after creation.
Response Body
application/json
curl -X POST "https://app.onlyfansapi.com/api/data-exports" \ -H "Content-Type: application/json" \ -d '{ "type": "transactions", "start_date": "2024-01-01T00:00:00Z", "end_date": "2024-12-31T23:59:59Z", "file_type": "csv" }'{
"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": ""
}
}
}