Facebook URL To ID Scraper With Profile ID Enrichment avatar

Facebook URL To ID Scraper With Profile ID Enrichment

Pricing

$19.99/month + usage

Go to Apify Store
Facebook URL To ID Scraper With Profile ID Enrichment

Facebook URL To ID Scraper With Profile ID Enrichment

Facebook Url To Id Scraper converts any Facebook profile, page, group, or post URL into its exact numeric ID. Get fast, reliable ID extraction for automation, data workflows, and integrations. Ideal for marketers, analysts, and developers needing clean structured IDs.

Pricing

$19.99/month + usage

Rating

0.0

(0)

Developer

API Empire

API Empire

Maintained by Community

Actor stats

0

Bookmarked

20

Total users

0

Monthly active users

4 days ago

Last modified

Share

Facebook ID Scraper — Extract Page, Group and Post IDs as JSON

Facebook ID Scraper resolves any public Facebook page, group, or post URL — or a bare username — into its stable numeric Facebook ID, then enriches the row with public identity and engagement data: name, category, profile picture, page creation date, likes, followers, and talking-about count. Entity type (page, group, or post) is detected automatically. Every response is typed, normalized JSON — no HTML, no selectors, no manual page-opening. Paste one link or thousands and get a dataset ready for CRMs, ad tooling, or lead pipelines.

What is Facebook ID Scraper?

Facebook ID Scraper With Profile ID Enrichment is an Apify Actor that turns a list of public Facebook page, group, or post links (or plain usernames) into rows containing each entity's stable facebookId plus its public profile and engagement fields. It works entirely against Facebook's logged-out, public HTML surface — no Facebook account or login is required to run it. Each URL is fetched once, classified by entity type, and enriched from the same fetch, so there's no second round-trip per row.

  • Resolve page, group, and post/permalink URLs to their numeric Facebook ID
  • Enrich with engagement metrics: likes, followers (compact and raw text), talking-about count
  • Enrich with identity fields: name, category, profile picture URL, page creation date
  • Accept bare usernames (@handle) alongside full URLs, one item per line
  • Export as JSON, CSV, or any format the Apify dataset supports — no proxy setup required

What data does Facebook ID Scraper collect?

The Actor returns one row per resolved URL (or per matching object found on that URL, for pages and posts), covering three entity types plus a shared enrichment layer:

Data TypeKey FieldsJSON Field Names
Pages / profilesresolved ID, OpenGraph metadata, page ad-library referencefacebookId, user, openGraph, pageAdLibrary
Groupsgroup ID, name, join state, member count textgroup, groupTitle, node
Posts / permalinkspost ID, page ID, OpenGraph, ad-library referencepostId, pageId, node, openGraph
Profile enrichment (all types)name, category, likes, followers, talking-about, picture, creation datename, category, likes, followers, followersText, talkingAbout, talkingAboutText, profilePictureUrl, createdAt

Need more Facebook data?

If you need deeper profile fields — bio, current city, relationship status, gender, birthday, or a completeness score — pair this Actor with Facebook User Search Scraper With Profile Bio Enrichment, which searches by name and enriches matches with full demographic and bio data. For group-level metrics instead of page/profile IDs, Facebook Group Profile Scraper With Activity Quality Rating scores group health and tracks member growth over time.

Why not build this yourself?

Facebook's public pages have no stable, documented way for a third party to resolve an arbitrary URL or username to a numeric ID in bulk — the Graph API restricts ID and field access to assets you own or manage inside a verified Business Manager, and it does not offer a general-purpose "look up any public page's ID" endpoint for outside developers. Building this in-house means maintaining your own HTML parser against Facebook's frequently changing logged-out markup, plus your own proxy rotation, cookie warmup, and block-detection logic. This Actor already does that parsing, retry, and proxy-escalation work and returns a stable JSON schema, so you don't carry that maintenance load yourself.

Why do developers and teams scrape Facebook?

For lead-list and CRM cleanup

Sales and marketing teams often accumulate raw Facebook links — from ad exports, spreadsheets, or other scraping tools — without a stable identifier to key on. Feeding those links through pageUrls attaches a facebookId plus name and category to each row, so duplicate pages can be merged and CRM records can be deduplicated on a stable key instead of a URL string that may change with redirects or vanity-name updates.

For developers building data products

Teams building dashboards, monitoring tools, or internal directories on top of Facebook data need a numeric ID that doesn't change even if a page's vanity URL does. Because the Actor resolves usernames and full URLs alike and returns the same schema either way, it's a simple ID-normalization step to bolt onto an existing ingestion pipeline before storing records in a database.

For marketers and ad ops teams

Ad ops teams tracking competitor or partner pages need the numeric page ID to cross-reference against Facebook's Ad Library or other page-scoped tools. Running a batch of competitor page URLs through this Actor returns each page's ID alongside its category and current likes/followers snapshot in one pass, without opening each page manually.

For AI engineers and agent builders

Agents that receive free-text Facebook mentions or links as part of a workflow need to normalize them into a canonical entity before storing or joining them against other data. Because the output is typed JSON keyed on facebookId and entityType, an agent can call this Actor as a resolution step and pass the result directly into a vector store or downstream tool call without writing an HTML parser.

How to scrape Facebook (step by step)

  1. Open the Actor's page in the Apify Store and click Run (or call it via the Apify API/client).
  2. Provide the pageUrls array — one Facebook page, group, or post link (or bare username) per line.
  3. Toggle includeEngagement and includeProfileFields depending on whether you want the likes/followers columns, the identity columns, or both (both default to on).
  4. Leave proxyConfiguration on its default Residential setting and start the run.
  5. Download results as JSON or CSV from the run's dataset, or read them via the Apify API.

What to do when Facebook changes its structure

The Actor's parsing logic is maintained against Facebook's logged-out HTML and JSON-in-script structure. The output schema — field names and types — stays stable on your end even when the underlying markup changes, so downstream integrations built against this Actor's fields keep working without changes on your side.

⬇️ Input

ParameterRequiredTypeConstraintsDescription
pageUrlsNoarrayeditor: stringListPublic Facebook page or profile links (or bare usernames) to resolve and enrich. One item per line. The legacy startUrls key is still accepted.
includeEngagementNobooleandefault trueAppend engagement columns: likes (int), followers (compact → int + raw text), talkingAbout. Parsed from the page's public OpenGraph description + HTML.
includeProfileFieldsNobooleandefault trueAppend identity columns: name, category, profilePictureUrl, and page createdAt (ISO date). Parsed from the same logged-out page HTML.
proxyConfigurationNoobjecteditor: proxyApify Proxy. Residential is used by default for Facebook anti-bot resilience (guest cookie warmup + sticky session + block/403 retries built in).

Example input:

{
"pageUrls": [
"https://www.facebook.com/NintendoAmerica",
"@nasa"
],
"includeEngagement": true,
"includeProfileFields": true,
"proxyConfiguration": {
"useApifyProxy": true,
"apifyProxyGroups": ["RESIDENTIAL"]
}
}

No parameter is required — an empty pageUrls array means the run exits immediately with no rows written. The most common mistake is turning off the default Residential proxy: logged-out Facebook fetches are far more likely to hit login-wall or 403 responses without it.

⬆️ Output

Every response is typed, normalized JSON written to the run's default dataset — exportable as JSON, CSV, Excel, or any other format the Apify dataset supports. Fields are emitted only when actually found on the public page; missing values stay empty rather than being guessed. The Actor detects three entity types per URL, and each row carries the same enrichment columns regardless of type.

Scraped page / profile entity

{
"url": "https://www.facebook.com/NintendoAmerica",
"facebookUrl": "https://www.facebook.com/NintendoAmerica",
"facebookId": "20126997013",
"type": "page",
"entityType": "page",
"user": {
"id": "20126997013",
"name": "Nintendo"
},
"openGraph": {
"type": "website",
"title": "Nintendo",
"description": "12,500,000 likes · 45,000 talking about this",
"url": "https://www.facebook.com/NintendoAmerica",
"image": "https://scontent.xx.fbcdn.net/nintendo_og.jpg",
"locale": "en_US"
},
"pageAdLibrary": { "id": "20126997013" },
"name": "Nintendo",
"category": "Video Game",
"likes": 12500000,
"followers": 13100000,
"followersText": "13.1M",
"talkingAbout": 45000,
"talkingAboutText": "45K",
"profilePictureUrl": "https://scontent.xx.fbcdn.net/nintendo_profile.jpg",
"createdAt": "2009-04-15T00:00:00Z",
"openGraphText": "{\"type\":\"website\",\"title\":\"Nintendo\", ...}",
"userText": "{\"id\":\"20126997013\",\"name\":\"Nintendo\"}",
"groupText": null,
"nodeText": null,
"pageAdLibraryText": "{\"id\":\"20126997013\"}",
"rawText": "{\"url\":\"https://www.facebook.com/NintendoAmerica\", ...}"
}

Scraped group entity

{
"source_url": "https://www.facebook.com/groups/535363634111893",
"facebookUrl": "https://www.facebook.com/groups/535363634111893",
"url": "https://www.facebook.com/groups/535363634111893",
"facebookId": "535363634111893",
"type": "group",
"entityType": "group",
"group": {
"name": "Retro Game Collectors",
"url": "https://www.facebook.com/groups/535363634111893",
"id": "535363634111893",
"profile_picture": { "uri": "https://scontent.xx.fbcdn.net/group_pic.jpg" },
"viewer_join_state": "NOT_JOINED",
"viewer_forum_join_state": null,
"group_member_profiles": { "formatted_count_text": "24K members" }
},
"node": {
"__typename": null,
"actors": [{ "__typename": null, "name": null, "id": null }],
"creation_time": null,
"seo_title": null,
"id": null
},
"openGraph": {
"app_name": null,
"package": null,
"url": "https://www.facebook.com/groups/535363634111893",
"app_store_id": null,
"type": "group",
"title": "Retro Game Collectors",
"description": null,
"alt": null,
"image": null,
"locale": null
},
"groupTitle": "Retro Game Collectors",
"name": null,
"category": null,
"likes": null,
"followers": null,
"followersText": null,
"talkingAbout": null,
"talkingAboutText": null,
"profilePictureUrl": null,
"createdAt": null,
"openGraphText": "{\"type\":\"group\",\"title\":\"Retro Game Collectors\", ...}",
"groupText": "{\"name\":\"Retro Game Collectors\",\"id\":\"535363634111893\", ...}",
"nodeText": "{\"__typename\":null,\"actors\":[...],\"id\":null}",
"userText": null,
"pageAdLibraryText": null,
"rawText": "{\"source_url\":\"https://www.facebook.com/groups/535363634111893\", ...}"
}

Scraped post / permalink entity

{
"facebookId": "10160123456789012",
"postId": "10160123456789012",
"url": "https://www.facebook.com/NintendoAmerica/posts/10160123456789012",
"facebookUrl": "https://www.facebook.com/NintendoAmerica/posts/10160123456789012",
"pageId": "20126997013",
"node": {
"__typename": "Story",
"id": "10160123456789012",
"creation_time": 1717000000,
"seo_title": "Nintendo"
},
"pageAdLibrary": { "id": "20126997013" },
"openGraph": {
"type": "article",
"title": "Nintendo",
"description": "Check out the latest update.",
"url": "https://www.facebook.com/NintendoAmerica/posts/10160123456789012",
"alt": null,
"image": "https://scontent.xx.fbcdn.net/post_image.jpg",
"locale": "en_US"
},
"source_url": "https://www.facebook.com/NintendoAmerica/posts/10160123456789012",
"type": "post",
"entityType": "post",
"name": "Nintendo",
"category": "Video Game",
"likes": 12500000,
"followers": 13100000,
"followersText": "13.1M",
"talkingAbout": 45000,
"talkingAboutText": "45K",
"profilePictureUrl": "https://scontent.xx.fbcdn.net/nintendo_profile.jpg",
"createdAt": "2009-04-15T00:00:00Z",
"openGraphText": "{\"type\":\"article\",\"title\":\"Nintendo\", ...}",
"nodeText": "{\"__typename\":\"Story\",\"id\":\"10160123456789012\", ...}",
"pageAdLibraryText": "{\"id\":\"20126997013\"}",
"userText": null,
"groupText": null,
"rawText": "{\"facebookId\":\"10160123456789012\", ...}"
}

How many results can you scrape with Facebook ID Scraper?

There is no hard cap coded into the Actor itself — every URL listed in pageUrls is processed and, for pages and posts where multiple matching objects are found on one URL, each match is pushed as its own row. The Actor works through the list sequentially, with a 1-second delay between requests, and escalates from no-proxy to datacenter to sticky Residential proxy automatically if a fetch is blocked. Pasting more URLs simply means more sequential requests in the run; there is no pagination to configure, since each input line maps to a single fetch.

Integrate Facebook ID Scraper and automate your workflow

Facebook ID Scraper works with any language or tool that can send an HTTP request, using the standard Apify API.

REST API integration

import requests
TOKEN = "YOUR_APIFY_TOKEN"
ACTOR = "API-Empire~facebook-url-to-id-scraper-with-profile-id-enrichment"
resp = requests.post(
f"https://api.apify.com/v2/acts/{ACTOR}/run-sync-get-dataset-items",
params={"token": TOKEN},
json={
"pageUrls": ["https://www.facebook.com/NintendoAmerica", "@nasa"],
"includeEngagement": True,
"includeProfileFields": True,
},
)
rows = resp.json()
print(rows[0]["facebookId"], rows[0]["name"])

Works in Python, Node.js, Go, Ruby, cURL.

MCP for AI agents

Apify exposes every Actor, including this one, through its Actor MCP Server (mcp.apify.com), which lets MCP-compatible clients such as Claude Desktop and Cursor call an Actor by its ID (API-Empire/facebook-url-to-id-scraper-with-profile-id-enrichment) as a tool and receive typed JSON back directly in the agent loop.

Automation platforms (n8n, Make)

In n8n, the Apify node's Run Actor operation (or an HTTP Request node against the endpoint above) starts a run and the Get Dataset Items operation retrieves the rows once it finishes. In Make, the Apify app's Run Actor and Get Dataset Items module does both in a single step, so the enriched rows can feed directly into a CRM update, spreadsheet, or Slack notification module downstream.

Yes — Facebook ID Scraper only reads data that Facebook already serves on public, logged-out pages: OpenGraph metadata and public HTML for pages, groups, and posts. No login, no private data, and no content behind Facebook's authentication wall is accessed. Because the enrichment includes a page or profile name, treat resulting rows as personal data where they identify an individual, and apply GDPR/CCPA-appropriate lawful basis, retention, and access controls if you store or reuse them at scale. For business-facing pages, the data is closer to public business-record information governed by Facebook's own Terms of Service rather than personal-data law. Consult legal counsel for commercial use cases involving bulk personal data.

Frequently asked questions

Does Facebook ID Scraper work without a Facebook account?

Yes. It fetches Facebook's public, logged-out HTML for each URL — no Facebook login, session cookie, or account of your own is required to run it.

How often is the scraped data updated?

Every run performs a live fetch of the current logged-out page HTML for each URL you provide — there is no cached or pre-scraped data involved. Re-run the Actor to get current values.

What happens if a page, group, or post is deleted or unavailable?

If the fetch fails, is blocked after all proxy escalation attempts, or the extracted content matches a login/checkpoint page, the Actor logs a warning and skips that URL rather than writing a row with fabricated data. No row is pushed to the dataset for that URL.

Can I scrape private or restricted Facebook content?

No. Only publicly accessible, logged-out page content is returned. Private groups, login-gated profiles, and any content that requires being a member or being logged in are outside what this Actor can access.

Does Facebook ID Scraper work for AI agent workflows and LLM pipelines?

Yes. It's callable as an HTTP endpoint through the Apify API by any agent framework, and it's also reachable through Apify's Actor MCP Server for MCP-compatible clients. Every response is typed JSON with stable field names — no HTML parsing step is needed before passing results to an LLM.

How does Facebook ID Scraper handle Facebook's anti-bot system?

It performs a guest-cookie warmup request (seeding cookies like datr) before the real fetch, uses a sticky Residential proxy by default, and automatically escalates from no-proxy through datacenter to Residential proxy with retries when a response looks blocked (403/429/503, login redirects, checkpoint pages, or suspiciously short responses).

Does Facebook ID Scraper return data in a format LLMs can use directly?

Yes. Output is typed, normalized JSON with stable field names — no HTML, no selectors, no parsing step. Pass rows directly into an LLM context window, index them into a vector store, or route them through an agent tool call.

Can I use Facebook ID Scraper without managing proxies?

Yes. Apify Proxy with a Residential group is configured by default, and the Actor handles session stickiness, block detection, and retry/escalation internally — you don't need to supply or rotate your own proxies.

What happens when Facebook changes its structure or blocks the scraper?

The Actor is maintained against Facebook's current logged-out HTML and JSON-in-script structure. The output schema — field names and types — stays stable on your end; a structure change on Facebook's side does not change what your integration receives back.

Your feedback

Found a bug or missing a field? We want to know. Reach out through the Actor's page on the Apify Store or open an issue through Apify's support channel so it can be reviewed and fixed.