Facebook URL to ID · Page, Profile, Group & Post avatar

Facebook URL to ID · Page, Profile, Group & Post

Pricing

from $2.00 / 1,000 resolved urls

Go to Apify Store
Facebook URL to ID · Page, Profile, Group & Post

Facebook URL to ID · Page, Profile, Group & Post

Turn any public Facebook URL into its numeric ID — pages, profiles, groups and posts, from vanity handles or profile.php links. Reads Facebook's own app-link for the canonical ID of that exact entity, not a random number in the markup. Bulk input, no login; bad URLs are named, never charged.

Pricing

from $2.00 / 1,000 resolved urls

Rating

0.0

(0)

Developer

Muhamed Didovic

Muhamed Didovic

Maintained by Community

Actor stats

0

Bookmarked

3

Total users

1

Monthly active users

a day ago

Last modified

Categories

Share

Facebook URL to ID

Facebook URL to ID

Paste any public Facebook URL, get its numeric ID back — for pages, profiles, groups and posts. No login, no cookies.

Input URLYou get
facebook.com/zuckid 4, type page_or_profile
facebook.com/profile.php?id=4id 4, type profile
facebook.com/groups/204246533058329id 204246533058329, type group
facebook.com/{page}/posts/pfbid…the numeric post id, type post
a non-Facebook URLan error row naming it, not charged

Pure HTTP. No browser, no login, no cookies.


Why Use This Scraper?

The numeric ID behind a Facebook URL is what the Graph API, ad tooling and most downstream scrapers actually key on — but Facebook hides it behind vanity handles (/nintendo) and opaque pfbid post links. This resolver turns a whole list of public URLs into their IDs in one run.

The reliable part is deliberate. The page HTML is full of numeric IDs; picking the one that identifies the exact entity the URL points at is the hard bit. This reads Facebook's own app-link metadata (fb://…), the canonical source for that entity, so facebook.com/zuck resolves to 4 and not to some unrelated number that happens to appear in the markup.


How It Works

How the Facebook URL to ID Actor works

Each URL is classified by its path shape first — a /groups/ link, a /posts/ link, a profile.php?id= link each carry the ID or point to where it lives. The page is then fetched once over plain HTTP and the canonical ID is read from the app-link metadata, with per-type fallbacks for shapes that don't expose one. Every URL becomes one flat row; a URL that can't be resolved becomes a named error row rather than vanishing.


Input

FieldTypeRequiredNotes
fbUrlsarrayYesPublic Facebook URLs. Each item is a bare URL string or {"url": "…"}. Mixed shapes are fine.
proxyobjectNoOptional. Direct works for public URLs; switch on a proxy only if you hit rate limits at volume.

Example input

{
"fbUrls": [
"https://www.facebook.com/nintendo",
{ "url": "https://www.facebook.com/zuck" },
"https://www.facebook.com/groups/204246533058329"
]
}

Output Schema

One flat row per URL.

{
"inputUrl": "https://www.facebook.com/nintendo",
"type": "page_or_profile",
"id": "100064368354094",
"canonicalUrl": "https://www.facebook.com/NintendoAmerica",
"name": "Nintendo of America",
"scrapedAt": "2026-08-28T19:40:00.000Z"
}
FieldNotes
idThe numeric Facebook ID — the point of the Actor. null never reaches the dataset as a billed row.
typeprofile, page, page_or_profile, group, post, video, photo. See the note below.
canonicalUrlFacebook's normalized URL (og:url), so a vanity handle shows its canonical form.
namePublic name/title of the object (og:title), when present.

A note on type for vanity handles

Facebook uses one namespace — fb://profile/{id} — for both people and Pages, and the logged-out page carries no marker that reliably separates them. So a bare vanity handle like facebook.com/nintendo resolves to the honest type: "page_or_profile" with the correct ID, rather than a guessed profile that would be wrong for a Page. When the URL itself is unambiguous — profile.php?id=, /groups/, /posts/ — the type is exact.

Error rows

errorMeaningCharged
invalid_urlNot a facebook.com URL. No request spent.No
not_foundFacebook returned 404/410 — private, removed, or wrong URL.No
id_not_foundFetched but no ID could be extracted (login-gated shell or unsupported shape).No

Pricing

EventWhenRate
Resolved URLEach URL that returns an IDset at publish

Error rows are never charged.


FAQ

Do I need a Facebook account, login, or cookies? No. Only public URLs are read, the same as any logged-out visitor sees.

Why does a page come back as page_or_profile? Facebook's own deep-link namespace does not distinguish a Person from a Page for vanity handles. The ID is still correct; the type is only marked exact when the URL structure proves it.

Do vanity group URLs work? Numeric group URLs (/groups/204246533058329) always resolve. A vanity group alias may return id_not_found if Facebook serves a login-gated shell for it — use the numeric group URL in that case.


🤖 For AI Agents & LLM Apps

Purpose: resolve a public Facebook URL to its numeric ID. Give it URLs, get one flat row per URL with the canonical ID and object type.

Minimal tested input:

{ "fbUrls": [{ "url": "https://www.facebook.com/zuck" }, "https://www.facebook.com/groups/204246533058329" ] }

Output fields (one row per URL): inputUrl, type (page_or_profile / profile / page / group / post / video / photo), id, canonicalUrl, name, scrapedAt.

Error rows carry inputUrl + error + message and no id. Branch on the presence of error. Values: invalid_url, not_found, id_not_found.

Billing: one resolved-url event per resolved row, plus one actor start. Error rows are not charged.

Behaviour worth knowing: accepts bare URL strings and { "url": ... } objects, in fbUrls or urls; a vanity page/profile resolves to type: "page_or_profile" because Facebook's logged-out shell uses one namespace for both; numeric-id URLs (profile.php?id=, numeric groups, /posts/{id}) resolve without ambiguity; an empty run fails loudly unless every URL was a genuine 404.


⚠️ Disclaimer

This Actor reads only publicly available information from Facebook URLs — the same data any logged-out visitor can see. It does not log in, use cookies, or access private content. You are responsible for using the output in line with Facebook's terms and applicable data protection law.


SEO Keywords

facebook url to id, facebook page id finder, facebook profile id, facebook group id, facebook numeric id, facebook id lookup, facebook post id, facebook vanity url resolver, facebook graph id, facebook url resolver