FB Friends Count
Pricing
Pay per usage
FB Friends Count
Checks Facebook friend counts for up to 25 cookie + c_user sessions per run. Returns one contract-shaped dataset item per account.
Pricing
Pay per usage
Rating
0.0
(0)
Developer
Ratul Islam
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
8 days ago
Last modified
Categories
Share
What does FB Friends Count do?
FB Friends Count reads the friend count of up to 25 Facebook profiles per run, using your own logged-in Facebook sessions. Give it {cookie, cUser} pairs and it returns one result item per account — either the count or a machine-readable error. It is a lightweight API-style Actor (plain HTTPS + regex, no browser), ported from a proven readFriendCount helper, so runs finish in seconds. It only touches facebook.com profile pages you already have session cookies for.
Why use FB Friends Count?
- Session health + count in one call: a returned count proves the cookie is alive; an
invalid_cookieorsession_challengeerror tells you exactly which session needs replacing. - Batch-ready: check up to 25 sessions in one run with per-account items, so one expired cookie never sinks the whole batch.
- Stable contract: every item has identical keys; branch on
error.code, never on message text. - Platform advantages: schedule nightly session-health checks, call it from the Apify API, rotate through Apify Proxy automatically, and monitor runs in Console.
Main features
- Cookie → friend count via the
friends_allprofile view - Contract envelope on every item (success and failure share one shape)
- Flat error catalog:
invalid_input,invalid_cookie,session_challenge,rate_limited,upstream_error,service_unavailable - Run summary (
OUTPUT) with totals and errors grouped by code
What data can FB Friends Count extract?
| Field | Type | Description |
|---|---|---|
friendCount | integer | Number of friends, or 0 for a valid page with no count |
ok | boolean | true when the check ran (even for 0 friends) |
input | string | Echo of the cUser that was checked |
error | object | {code, message, retryable} — null on success |
checkedAt | string | ISO timestamp of the check |
runId | string | Apify run id (or local-run locally) |
Unused contract fields (eligible, pageName, linkedNumber, banReason) are always null for this Actor.
How to check Facebook friend counts
- Log in to Facebook in your browser and copy the raw cookie header plus the
c_uservalue of each session you want to check. - Open the Actor, paste up to 25
{cookie, cUser}pairs into the accounts input, and leave Proxy configuration on Apify Proxy. - Click Start and wait for status SUCCEEDED (usually under a minute).
- Open the Dataset tab: each item holds one account's
friendCountor its error. - Replace any cookie whose item reports
invalid_cookieorsession_challenge, then re-run.
How much will it cost to check friend counts?
Each account is one tiny HTTPS request, so compute usage is minimal — far below one compute unit per run at 25 accounts. Apify Proxy traffic is likewise a few kilobytes per account. The free tier covers thousands of such checks per month; larger plans just raise the scheduling and retention limits.
Input
See the input tab for full configuration options. accounts is a JSON array (1–25 items) of {"cookie": "<raw cookie header>", "cUser": "<numeric id>"}. The cookie must belong to the cUser it is paired with. proxyConfiguration uses the standard proxy editor and defaults to Apify Proxy, which Facebook-facing runs need.
{"accounts": [{ "cookie": "c_user=61592912563278; xs=...; fr=...", "cUser": "61592912563278" }],"proxyConfiguration": { "useApifyProxy": true }}
Output
You can download the dataset in various formats such as JSON, HTML, CSV, or Excel. A success item and an error item look like this:
{"ok": true,"actor": "fb-friends-count","input": "61592912563278","eligible": null,"pageName": null,"linkedNumber": null,"banReason": null,"friendCount": 132,"error": null,"checkedAt": "2026-10-13T12:00:00.000Z","runId": "abc123XYZ"}
{"ok": false,"actor": "fb-friends-count","input": "61592912563278","eligible": null,"pageName": null,"linkedNumber": null,"banReason": null,"friendCount": null,"error": { "code": "invalid_cookie", "message": "Cookie was rejected by Facebook (HTTP 400). Get a fresh logged-in cookie and retry.", "retryable": false },"checkedAt": "2026-10-13T12:00:00.000Z","runId": "abc123XYZ"}
The OUTPUT record in the key-value store summarizes the run:
{ "actor": "fb-friends-count", "runId": "abc123XYZ", "total": 2, "succeeded": 1, "failed": 1, "errorsByCode": { "invalid_cookie": 1 } }
Tips
- Keep batches at 25 or fewer. Larger lists are rejected with
invalid_input— split them across runs instead. - Pair cookies correctly. A cookie checked against someone else's
cUserreads the wrong profile; always echo-checkinputin the output. - Back off on
rate_limited. That error is retryable; wait a few minutes before re-running those accounts. - Refresh proactively. Schedule a daily run over your session pool and rotate cookies as soon as
invalid_cookieappears, before downstream automations feel it.
FAQ, disclaimers, and support
Is this an official Facebook API?
No. It reads the same profile page a logged-in browser sees, using sessions you supply. Respect Facebook's Terms of Service and your local laws.
Why did I get session_challenge?
Facebook showed a login/2FA challenge for that session. Log in as that account in a real browser, complete the challenge, export a fresh cookie, and retry.
Why is friendCount 0 — is that an error?
No. ok: true with 0 means the page loaded fine but exposed no count (for example a brand-new profile). Only ok: false items are failures.
Our Actors are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. We therefore believe that our Actors, when used for ethical purposes by Apify users, are safe. However, you should be aware that your results could contain personal data. Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers.
Found a bug or need a feature? Use the Issues tab. For programmatic access (scheduling, API calls, integrations), see the API tab.


