# OnlyFans Content Scraper (posts + media) (`leon.operator/onlyfans-content-scraper`) Actor

Scrape an OnlyFans creator's posts and media in bulk — text, PPV prices, likes, comments, and media URLs. Choose posts, media items, or profile info. Fast, structured JSON/CSV output.

- **URL**: https://apify.com/leon.operator/onlyfans-content-scraper.md
- **Developed by:** [Leon Operator](https://apify.com/leon.operator) (community)
- **Categories:** Social media, Videos, Integrations
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 post scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## OnlyFans Content Scraper

Extract an OnlyFans creator's **posts and media** in bulk — structured, paginated,
and ready to export. Give it a list of creators and choose what to pull: profile
info, posts, or individual media items.

### Modes

| Mode | Output |
|---|---|
| **Profile info** | one profile record per creator |
| **Posts** | one record per post — text, price, likes, comments, embedded media |
| **Media items** | one record per media item — URL, thumbnail, type, duration, dimensions |

### You use your own OnlyFans login

Posts and media are **subscriber-gated**, so the actor reads them **as you** — using
your OnlyFans session — and returns the content **you already have access to**
(creators you subscribe to or follow for free). Your session is used only for these
requests and is **never stored or logged**.

### Input

```json
{
  "profiles": ["some_creator_you_follow"],
  "type": "POSTS",
  "maxItems": 50,
  "sess": "<your sess cookie>",
  "authId": "<your user id>",
  "xBc": "<x-bc header>"
}
````

| Field | Type | Description |
|---|---|---|
| `profiles` | array | Creator usernames or profile URLs (required) |
| `type` | string | `INFO`, `POSTS`, or `MEDIA` (default `POSTS`) |
| `maxItems` | integer | Max posts / media items per creator (default 20) |
| `includeFreeOnly` | boolean | Skip posts behind a PPV price |
| `sess` | string (secret) | Your OnlyFans `sess` cookie |
| `authId` | string | Your OnlyFans user ID (`auth_id` cookie — a public number) |
| `xBc` | string (secret) | The `x-bc` request header |
| `userAgent` | string | *Optional* — defaults to a standard Chrome UA |

#### Fastest: the one-click extension

Install the free **OF Session Exporter** browser extension, log in to OnlyFans, click
**Capture session**, and paste the result here — done, no DevTools. Prefer to do it by
hand? Use the manual steps below.

#### How to get your session manually (once, ~1 min)

Log in at **onlyfans.com** in Chrome/Edge/Brave, then open DevTools (**F12**, or
right-click → Inspect).

**1 & 2 — `sess` and `authId`** (from the cookie panel — `sess` is HttpOnly, so it
can only be read here, not from the console):

- **Application** tab → left sidebar **Cookies** → **https://onlyfans.com**
- Copy the **Value** of the **`sess`** row → that's your `sess`
- Copy the **Value** of the **`auth_id`** row → that's your `authId`

**3 — `xBc`** (from a request header):

- **Network** tab → type **`api2`** in the filter box
- Reload the page (**F5**) so requests appear → click any request in the list
- In the right panel, scroll to **Request Headers** → copy the value of **`x-bc`** →
  that's your `xBc`

Paste the three values into the `sess`, `authId`, and `xBc` fields, and run.

**Faster shortcut (grabs 2 of the 3):** paste this in the DevTools **Console** on
onlyfans.com — it prints `authId` and captures `xBc` from the next request (then click
anything on the page). Get `sess` from the cookie panel above.

```js
console.log('authId =', document.cookie.match(/auth_id=([^;]+)/)?.[1] || '(use cookie panel)');
const _f = fetch; fetch = (...a) => { const h = a[1]?.headers; const bc = h && (h.get ? h.get('x-bc') : h['x-bc']); if (bc) console.log('xBc =', bc); return _f(...a); };
console.log('now click around the page to reveal xBc…');
```

If your values stop working, you've logged out or the session expired — just re-copy
them. You only ever scrape what your own account can already see; this is your access,
not a bypass.

### Output

**Posts** — one record per post:

```json
{
  "profile": "onlyfans",
  "postId": 123456,
  "text": "…",
  "postedAt": "2026-06-30T…",
  "price": 0,
  "likesCount": 1200,
  "commentsCount": 45,
  "isPinned": false,
  "mediaCount": 3,
  "media": [{ "id": 1, "type": "photo", "full": "https://…", "thumb": "https://…" }],
  "scrapedAt": "2026-07-05T…"
}
```

**Media** — one record per item: `mediaId`, `type` (photo/video/audio/gif), `url`,
`thumbnail`, `duration`, `width`, `height`, plus the parent post reference.

Media URLs are **time-limited CDN links** and can expire — download what you need promptly.

### Use cases

- Content analysis and trend tracking across creators
- Building media/post datasets for research
- Monitoring posting cadence, pricing, and engagement over time

### Pricing

Pay per result — you're charged per post or media item returned. No subscription.

### Notes

This actor accesses content the connected session is entitled to view. Please ensure
your use complies with OnlyFans' Terms of Service, content licensing, and applicable
laws in your jurisdiction.

# Actor input Schema

## `profiles` (type: `array`):

OnlyFans creator URLs or usernames to scrape content from.

## `type` (type: `string`):

INFO = profile only; POSTS = one record per post; MEDIA = one record per media item.

## `maxItems` (type: `integer`):

Cap on posts (POSTS) or media items (MEDIA) returned per profile.

## `includeFreeOnly` (type: `boolean`):

Only include free posts (skip those behind a PPV price).

## `sess` (type: `string`):

The value of your `sess` cookie on onlyfans.com while logged in. Posts/media are subscriber-gated, so the actor uses YOUR session to read content you have access to. Never stored or logged. See README for how to copy it.

## `authId` (type: `string`):

Your `auth_id` cookie value (your numeric OnlyFans user ID).

## `xBc` (type: `string`):

The `x-bc` request header from a logged-in onlyfans.com request (a device token).

## `userAgent` (type: `string`):

Optional — defaults to a standard Chrome user-agent. Only set this if you hit auth errors; then paste the user-agent from the browser your session came from.

## `proxyConfiguration` (type: `object`):

Proxy for the OnlyFans API requests. Apify Proxy by default; light — the authenticated API needs little proxying.

## Actor input object example

```json
{
  "profiles": [
    "onlyfans"
  ],
  "type": "POSTS",
  "maxItems": 20,
  "includeFreeOnly": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `content` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "profiles": [
        "onlyfans"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("leon.operator/onlyfans-content-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "profiles": ["onlyfans"] }

# Run the Actor and wait for it to finish
run = client.actor("leon.operator/onlyfans-content-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "profiles": [
    "onlyfans"
  ]
}' |
apify call leon.operator/onlyfans-content-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=leon.operator/onlyfans-content-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "OnlyFans Content Scraper (posts + media)",
        "description": "Scrape an OnlyFans creator's posts and media in bulk — text, PPV prices, likes, comments, and media URLs. Choose posts, media items, or profile info. Fast, structured JSON/CSV output.",
        "version": "0.1",
        "x-build-id": "IgSGJz7V9kAclBGz4"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/leon.operator~onlyfans-content-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-leon.operator-onlyfans-content-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/leon.operator~onlyfans-content-scraper/runs": {
            "post": {
                "operationId": "runs-sync-leon.operator-onlyfans-content-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/leon.operator~onlyfans-content-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-leon.operator-onlyfans-content-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "profiles"
                ],
                "properties": {
                    "profiles": {
                        "title": "Profiles",
                        "type": "array",
                        "description": "OnlyFans creator URLs or usernames to scrape content from.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "type": {
                        "title": "Extract",
                        "enum": [
                            "INFO",
                            "POSTS",
                            "MEDIA"
                        ],
                        "type": "string",
                        "description": "INFO = profile only; POSTS = one record per post; MEDIA = one record per media item.",
                        "default": "POSTS"
                    },
                    "maxItems": {
                        "title": "Max items per profile",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Cap on posts (POSTS) or media items (MEDIA) returned per profile.",
                        "default": 20
                    },
                    "includeFreeOnly": {
                        "title": "Skip locked/PPV posts",
                        "type": "boolean",
                        "description": "Only include free posts (skip those behind a PPV price).",
                        "default": false
                    },
                    "sess": {
                        "title": "Your OnlyFans session cookie (sess)",
                        "type": "string",
                        "description": "The value of your `sess` cookie on onlyfans.com while logged in. Posts/media are subscriber-gated, so the actor uses YOUR session to read content you have access to. Never stored or logged. See README for how to copy it."
                    },
                    "authId": {
                        "title": "Your OnlyFans user ID (auth_id)",
                        "type": "string",
                        "description": "Your `auth_id` cookie value (your numeric OnlyFans user ID)."
                    },
                    "xBc": {
                        "title": "x-bc header",
                        "type": "string",
                        "description": "The `x-bc` request header from a logged-in onlyfans.com request (a device token)."
                    },
                    "userAgent": {
                        "title": "Browser user-agent (optional)",
                        "type": "string",
                        "description": "Optional — defaults to a standard Chrome user-agent. Only set this if you hit auth errors; then paste the user-agent from the browser your session came from."
                    },
                    "proxyConfiguration": {
                        "title": "Proxy",
                        "type": "object",
                        "description": "Proxy for the OnlyFans API requests. Apify Proxy by default; light — the authenticated API needs little proxying.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
