You can scrape OnlyFans profile data with about 60 lines of Python and a real browser. For bios, subscription prices and media counts, you don't need to subscribe to anyone.
Reading the page is the easy part. OnlyFans signs its own API requests in JavaScript, so a plain HTTP client gets turned away before it sees any data.
This guide lets Playwright load each profile and capture the JSON response the site fetches for itself. You skip the signing code entirely, and you never depend on CSS class names that change with every front-end build.
Everything runs on your own machine. Nothing here unlocks paid posts, because nothing can; the section on bypassers explains why.
How do you scrape OnlyFans?
To scrape OnlyFans, open a creator's profile in Playwright and capture the JSON that OnlyFans' own front end requests from /api2/v2/users/ while the page loads. The browser handles the signed headers, and you get bio, subscription price and media counts as clean fields. Save each run to SQLite to track price changes over time.
| Method | What you get | Login needed | Breaks when |
|---|---|---|---|
| 1. Rendered page text | Page title, subscription price | No | The subscribe button wording changes |
| 2. Profile JSON | Every profile field as JSON | No | The endpoint path or field names change |
| 3. Your own session | Post dates, post prices, like and comment counts | Yes, subscribed | Your session expires |
| 4. Price tracker | Price and media-count history per creator | No | Method 2 breaks |
Method 2 does the real work. Method 1 is the fallback, and Method 4 is Method 2 on a schedule.
What OnlyFans data can you scrape?
Logged out, a creator's profile shows their display name, bio, subscription price, media counts and total likes. Anything inside the feed needs a subscription, and some data never leaves OnlyFans' servers at all.
| Data | Logged out | Subscribed to the creator |
|---|---|---|
| Name, username, avatar, bio, links | Yes | Yes |
| Subscription price, promotions, bundles | Yes | Yes |
| Post, photo, video and like counts | Yes | Yes |
| Post text, publish dates, like and comment counts | No | Yes |
| Locked photos, videos and PPV messages | No | Only what you paid for |
| Earnings, subscriber lists, other people's messages | No | No |
OnlyFans changes what guests can see from time to time. Open a profile in a private window and check before you build on any row of this table.
This guide stops at metadata. It doesn't download media, and for pricing or market research you won't need any.
Step 0: check what's protecting OnlyFans
Run antibot-detect against the site before writing scraper code. It makes one browser-like request and reports which bot-management product answers, with a confidence level and the evidence it found.
It installs from a clone of the repo; there's no PyPI release.
git clone https://github.com/mmewni/antibot-detect && cd antibot-detect
python -m venv .venv && source .venv/bin/activate
pip install -e .
antibot-detect https://onlyfans.com/ --verbose # add --json for machine-readable output
--verbose prints the status code, redirect chain, sampled headers and cookies, which is usually enough to see what's in front of the site.
Know its limit: the check is passive. OnlyFans' request signing happens in JavaScript, which a single request can't see, so a clean result doesn't mean requests will work.
Prerequisites
You need Python 3.10 or newer and Playwright with its bundled Chromium.
pip install playwright
playwright install chromium
- A list of creator usernames you want to study, one per line in
usernames.txt. - For Method 3 only: a spare OnlyFans account with the subscriptions you need. Don't use the account you pay your own subscriptions on.
Method 1: read the rendered profile page
The fastest way to get a creator's page title and subscription price is to load the profile in Playwright and read the visible text. Treat it as the fallback for days when Method 2's endpoint moves.
It matches text instead of class names. OnlyFans' class names come out of its front-end build and can change without notice; the words "per month" on the subscribe button change far less often.
import re
from playwright.sync_api import sync_playwright
PRICE = re.compile(r"\$\s?(\d+(?:\.\d{2})?)\s*per month", re.I)
SUBSCRIBE_TEXT = re.compile(r"per month|for free", re.I)
def read_profile_page(page, username):
page.goto(f"https://onlyfans.com/{username}", wait_until="domcontentloaded")
# Wait for the subscribe button text instead of a CSS class
page.get_by_text(SUBSCRIBE_TEXT).first.wait_for(timeout=20_000)
body = page.inner_text("body")
match = PRICE.search(body)
is_free = "for free" in body.lower()
return {
"username": username,
"title": page.title(), # carries the display name
"price": float(match.group(1)) if match else (0.0 if is_free else None),
}
Run it with a headed browser first so you can watch what loads:
with sync_playwright() as p:
browser = p.chromium.launch(headless=False) # switch to True once it works
page = browser.new_page()
print(read_profile_page(page, "onlyfans"))
browser.close()
When a creator runs a promotion, the button wording changes and price comes back None. Method 2 reads the base price and the promotion as separate fields, so use it whenever it's working.
Method 2: capture the profile JSON OnlyFans already loads
When a profile page loads, OnlyFans' front end calls its own API at /api2/v2/users/<username> and gets the whole profile back as JSON. Playwright's expect_response hands you that response without you ever building the request.
That request carries headers the page's JavaScript computes per call, including sign, time and app-token. The browser computes them and you read the result.
import re
def is_profile_response(username):
# Match /api2/v2/users/<username> but not /api2/v2/users/<id>/posts
pattern = re.compile(rf"/api2/v2/users/{re.escape(username)}(\?|$)", re.I)
return lambda r: r.request.method == "GET" and pattern.search(r.url) is not None
def fetch_profile_json(page, username):
with page.expect_response(is_profile_response(username), timeout=30_000) as info:
page.goto(f"https://onlyfans.com/{username}", wait_until="domcontentloaded")
response = info.value
if response.status != 200:
raise RuntimeError(f"{username}: profile API returned {response.status}")
return response.json()
The (\?|$) at the end of the pattern matters. Without it, a posts or stories call for the same creator can match first and you'll parse the wrong JSON.
Next, map OnlyFans' keys to your own column names. Keeping the mapping in one dict means a renamed field costs you one line.
import re
FIELDS = {
"id": "id", "username": "username", "name": "name", "bio": "about",
"price": "subscribePrice", "posts": "postsCount", "photos": "photosCount",
"videos": "videosCount", "likes": "favoritedCount", "verified": "isVerified",
"joined": "joinDate", "location": "location", "website": "website",
}
def to_row(raw):
row = {ours: raw.get(theirs) for ours, theirs in FIELDS.items()}
if row["bio"]:
row["bio"] = re.sub(r"<[^>]+>", " ", row["bio"]).strip() # bios can carry HTML
promos = raw.get("promotions") or []
row["promo_price"] = promos[0].get("price") if promos else None
return row
Confirm the key names in your own browser before you scale this up. Open DevTools, go to the Network tab, filter on api2/v2/users, reload a profile and read the response. If a key differs, change the right-hand side of FIELDS.
To run it across a list of creators, reuse one page and pause between profiles:
import random
import time
from playwright.sync_api import sync_playwright
def scrape_profiles(usernames):
rows = []
with sync_playwright() as p:
browser = p.chromium.launch(headless=False)
page = browser.new_page()
for name in usernames:
try:
rows.append(to_row(fetch_profile_json(page, name)))
except Exception as exc: # log it and move on to the next creator
print(f"skip {name}: {exc}")
time.sleep(random.uniform(4, 8)) # one profile every few seconds
browser.close()
return rows
One failed profile shouldn't kill a 300-name run, which is why the loop logs and continues. If every profile starts failing, stop and read the troubleshooting section before retrying.
Method 3: use your own session for post metadata
Post-level data, such as publish dates, post prices and like and comment counts, only appears for creators your account subscribes to. Log in once by hand, save the session, and capture the posts JSON while the page scrolls.
Saving a session with Playwright's storage_state keeps your cookies and local storage in one file. The Playwright authentication guide covers the options in more detail.
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch(headless=False)
context = browser.new_context()
page = context.new_page()
page.goto("https://onlyfans.com/")
input("Log in in the browser window (including 2FA), then press Enter here...")
context.storage_state(path="of_session.json") # cookies + localStorage
browser.close()
of_session.json gives full access to the account, the same as your password. Keep it out of git and off shared drives.
Now load a creator's profile with that session and record each batch of posts the feed requests as you scroll:
import re
POSTS = re.compile(r"/api2/v2/users/\d+/posts")
KEEP = ("id", "postedAt", "price", "isOpened", "likesCount", "commentsCount", "mediaCount")
def make_post_collector(posts):
def on_response(response):
if not (POSTS.search(response.url) and response.status == 200):
return
try:
body = response.json()
except Exception:
return # not JSON, skip it
items = body.get("list", []) if isinstance(body, dict) else body
posts.extend({key: item.get(key) for key in KEEP} for item in items)
return on_response
The collector appends to a list you own. Attach it, open the profile, and scroll so the feed requests more posts:
def collect_post_metadata(context, username, scrolls=10):
posts = []
page = context.new_page()
page.on("response", make_post_collector(posts))
page.goto(f"https://onlyfans.com/{username}", wait_until="domcontentloaded")
for _ in range(scrolls):
page.mouse.wheel(0, 4000)
page.wait_for_timeout(2500) # let the next batch load
page.close()
return posts
KEEP deliberately leaves out the media array, which is where file URLs live. You get counts and dates, not content.
Call it with the saved session:
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch(headless=False)
context = browser.new_context(storage_state="of_session.json")
posts = collect_post_metadata(context, "creator_you_subscribe_to")
print(len(posts), posts[:2])
browser.close()
The posts endpoint uses the creator's numeric ID rather than the username, which is why the pattern matches \d+. Check the field names in DevTools the same way you did for Method 2.
Method 4: track subscription prices over time
A price history needs one SQLite table and a daily run of Method 2. Each run appends a snapshot, so you can see when a creator raised prices or started a promotion.
import sqlite3
from datetime import datetime, timezone
def save_snapshot(rows, db_path="onlyfans_prices.db"):
con = sqlite3.connect(db_path)
con.execute("""CREATE TABLE IF NOT EXISTS snapshots (
username TEXT, taken_at TEXT, price REAL, promo_price REAL,
posts INTEGER, photos INTEGER, videos INTEGER, likes INTEGER)""")
now = datetime.now(timezone.utc).isoformat(timespec="seconds")
con.executemany(
"INSERT INTO snapshots VALUES (?, ?, ?, ?, ?, ?, ?, ?)",
[(r["username"], now, r["price"], r["promo_price"], r["posts"],
r["photos"], r["videos"], r["likes"]) for r in rows],
)
con.commit()
con.close()
Store timestamps in UTC. A daily job that crosses a daylight-saving change will otherwise produce two snapshots with the same local hour.
To list every price change, compare each snapshot with the one before it:
SELECT username, taken_at, prev_price, price
FROM (
SELECT username, taken_at, price,
LAG(price) OVER (PARTITION BY username ORDER BY taken_at) AS prev_price
FROM snapshots
)
WHERE prev_price IS NOT NULL AND price != prev_price;
Put the runner in track.py and schedule it with cron:
from pathlib import Path
usernames = Path("usernames.txt").read_text().split()
save_snapshot(scrape_profiles(usernames))
17 6 * * * cd /home/you/of-tracker && .venv/bin/python track.py >> track.log 2>&1
Cron has no display, so a headed browser won't start there. Either set headless=True in scrape_profiles for scheduled runs, or wrap the command in xvfb-run.
Why the browser should do the signing
Calling OnlyFans' API from plain Python fails on the request signature, not only on your network fingerprint. Each call carries headers that the site's JavaScript computes per request, and the recipe can change whenever OnlyFans ships new front-end code.
Some open-source archivers track those signing rules for you. Running your own signer means you're on call every time OnlyFans updates its JavaScript.
A browser-impersonating HTTP client fixes a different layer: the TLS and HTTP/2 handshake. In Python that's primp, which also ships Safari and Firefox profiles, or curl_cffi. For Node there's hellojs. None of them computes a sign header, so they only help after you've solved signing yourself.
| Approach | Who signs requests | Network fingerprint | Upkeep |
|---|---|---|---|
| Playwright + response capture | The page's own JavaScript | Real Chromium | Low |
requests / httpx |
You | Python's default, easy to flag | High |
| primp, curl_cffi or hellojs | You | Browser-like | Medium to high |
For a few hundred profiles a day, one browser tab costs less than maintaining a signer. Revisit that choice if you ever need tens of thousands of profiles a day.
OF-Scraper, FanScrape and bypassers: what each one does
OF-Scraper archives content from creators you already subscribe to, FanScrape files those downloads into the Stash media manager, and "bypassers" don't work. None of them gets you anything a subscription doesn't.
| Tool | What it is | Needs a subscription | Use it for |
|---|---|---|---|
| OF-Scraper | Open-source CLI that archives your own subscriptions | Yes, per creator | Backing up what you've paid for |
| FanScrape (GitHub) | Stash plugin that reads OF-Scraper or UltimaScraper SQLite files | Indirectly | Tagging a local library you already have |
| "Bypasser" or "unlocker" sites | Sites promising free access to locked posts | They claim not | Nothing; expect surveys, malware or a stolen login |
OF-Scraper's README says it plainly: the tool "can not bypass pay walls," and every creator needs an active subscription, free or paid.
The name FanScrape causes confusion. The GitHub project is a metadata plugin that never contacts OnlyFans itself. A separate website uses the same name to advertise free access to locked posts, which isn't something it can deliver.
OnlyFans only serves locked files to accounts it has authorized. A logged-out or unsubscribed browser gets a page without them, so a script has nothing to unlock. Any site that asks for your OnlyFans login to "unlock" a profile is after the login.
Rate limits, proxies and your account
Go slow, keep one browser profile per account, and add proxies only when your own IP starts getting challenged.
- OnlyFans doesn't publish a rate limit. Start with the 4 to 8 second gap in
scrape_profilesand stop on the first run of non-200 responses. - Don't rotate User-Agents. A Chrome User-Agent on a Firefox handshake looks more suspicious than one consistent browser.
- Keep Method 3 on a dedicated account. A ban removes your subscriptions and your saved session together.
- If your IP gets challenged at volume, move to residential IPs with sticky sessions so one browser keeps one IP. Roundproxies sells residential pools; any provider with sticky sessions works.
Proxies don't help with geo-blocked profiles, and you shouldn't use them for that. Creators block regions to stay out of sight of people who know them. Skip any profile that's blocked for your location.
Troubleshooting
TimeoutError: Timeout 30000ms exceeded while waiting for event "response"
Why: Method 2 never saw a matching response. The username is wrong, the profile is deleted or blocked for your region, or the endpoint path changed.
Fix: Log every API call the page makes, then read the paths:
page.on("response", lambda r: "/api2/" in r.url and print(r.status, r.url))
Executable doesn't exist at ...
Why: The Playwright package is installed, but its browsers aren't.
Fix: Run playwright install chromium in the same virtual environment.
Every field comes back None
Why: OnlyFans renamed the keys in its profile JSON.
Fix: Add print(sorted(raw.keys())) inside to_row, find the new names, and update FIELDS.
Method 3 returns an empty list
Why: Your session expired and the page redirected to the login screen, or the account doesn't subscribe to that creator.
Fix: Print page.url after goto. If it's the login page, run the session script again.
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Why: The response was an HTML challenge page instead of JSON, usually after too many requests from one IP.
Fix: Check response.status before parsing, pause the run for an hour, and lengthen the delay.
FAQ
Is it legal to scrape OnlyFans?
Scraping public profile fields carries less risk than anything behind the paywall, but it isn't risk-free. Several reviews of OnlyFans' terms say they restrict automated access, so account bans are a realistic outcome. Bios are also personal data under laws like the GDPR, and this isn't legal advice.
Can you scrape OnlyFans without an account?
Yes, for profile-level data. Methods 1, 2 and 4 run logged out and return the display name, bio, subscription price and media counts. Post-level data needs an account that subscribes to the creator.
Is there an official OnlyFans API?
No, there's no public one. OnlyFans doesn't issue API keys to developers. The /api2/v2/ paths in this guide belong to the private API its own front end uses, and they can change without notice.
Can you download OnlyFans content without subscribing?
No. OnlyFans only sends locked media to accounts it has authorized, and tools that claim otherwise are usually after your login. Even OF-Scraper requires a subscription to each creator.
Do you need proxies to scrape OnlyFans?
Not for a few dozen profiles. Your home connection and a headed browser are enough to start. Add residential proxies with sticky sessions once you track hundreds of profiles a day or your IP starts getting challenged.
How many profiles can you scrape per day?
OnlyFans doesn't publish a limit, so treat any number you read online as a guess. A few hundred a day at 4 to 8 second gaps is a sensible start. Slow down at the first non-200 responses.
Wrapping up
Build Method 2 first. The browser handles the signing, you read clean JSON, and a renamed field is a one-line fix in FIELDS.
Keep Method 1 as the fallback, put Method 4 on a schedule once you have a username list, and use Method 3 only for post data from creators your account already pays for. The same response-capture idea carries over to other creator platforms; the Fansly scraping guide is the closest sibling.