Facebook URL to ID Scraper

Resolve public Facebook URLs into stable numeric IDs, typed canonical URLs, and clear per-link resolution metadata.

Data fields

FieldTypeDescription
sourceUrlstringValue exported as sourceUrl.
canonicalUrlstringValue exported as canonicalUrl.
facebookIdstring | nullValue exported as facebookId.
objectTypestringValue exported as objectType.
parentIdstring | nullValue exported as parentId.
ownerHandlestring | nullValue exported as ownerHandle.
canonicalEntityUrlstring | nullValue exported as canonicalEntityUrl.
resolutionMethodstringValue exported as resolutionMethod.

Input preview

facebookUrlsFacebook URLs *
maxItemsMaximum URLs to process

API and agents

This actor can be run through Apify API, datasets, webhooks, schedules, and the official Apify MCP server.

How this actor works

See example inputs, outputs, API usage, and practical limits before running this actor on Apify.

Open Apify page

Use this Facebook ID finder to convert public Facebook URLs into stable numeric IDs, typed canonical URLs, and integration-ready resolution records. Process pages, profiles, posts, photos, reels, videos, groups, and events in one batch without logging in or scraping private content. It works as a bulk Facebook page ID finder and Facebook URL converter for downstream workflows.

Use the Actor to normalize social links before API calls, CRM enrichment, deduplication, analytics joins, or spreadsheet exports. Numeric URL formats resolve locally; public vanity Page and Profile links are resolved when Facebook exposes a target-bound public identity.

Input example

{
  "facebookUrls": [
    {"url": "https://www.facebook.com/nasa"},
    {"url": "https://www.facebook.com/profile.php?id=4"},
    {"url": "https://www.facebook.com/reel/10155466919515153"}
  ],
  "maxItems": 3
}

Output example

{
  "sourceUrl": "https://www.facebook.com/profile.php?id=4",
  "canonicalUrl": "https://www.facebook.com/profile.php?id=4",
  "facebookId": "4",
  "objectType": "profile",
  "parentId": null,
  "ownerHandle": null,
  "canonicalEntityUrl": "https://www.facebook.com/profile.php?id=4",
  "resolutionMethod": "query_parameter",
  "status": "resolved",
  "error": null,
  "resolvedAt": "2026-08-13T12:00:00.000Z"
}

What Facebook URLs are supported?

  • Pages and profiles: numeric paths, profile.php?id=..., and publicly visible vanity aliases
  • Posts: numeric /posts/ and group post/permalink paths, plus story_fbid
  • Photos: photo.php?fbid=...
  • Videos and reels: /videos/, /reel/, and watch/?v=...
  • Groups and events: numeric /groups/ID and /events/ID links
  • Desktop, mobile, facebook.com, and fb.com hosts

Opaque pfbid... tokens, vanity groups/events, private objects, deleted links, and login-only pages may be returned as unresolved. The Actor never guesses an ID.

Input settings

Field Type Description
facebookUrls array One or more public Facebook URL objects, up to 10,000
maxItems integer Maximum unique URLs to process, from 1 to 10,000

The runtime also accepts facebookUrls entries as plain strings through the API. Legacy startUrls and fbUrls aliases remain accepted for workflow compatibility.

Input recipes

Resolve known numeric objects cheaply

{"facebookUrls":[{"url":"https://www.facebook.com/groups/20531316728"},{"url":"https://www.facebook.com/events/113779332012976"}]}

Normalize mixed URLs for a CRM import

{"facebookUrls":[{"url":"https://m.facebook.com/profile.php?id=4&utm_source=test"},{"url":"https://www.facebook.com/nasa"}],"maxItems":2}

Who is it for?

  • Developers normalizing Facebook links before API calls
  • Data teams deduplicating social profiles and joining records by stable IDs
  • CRM and automation teams validating public links in bulk
  • Analysts preparing clean Facebook URL datasets for spreadsheets or databases

Tips and limits

  • Keep numeric IDs in links whenever your upstream source provides them.
  • Filter on status = resolved before passing IDs to downstream APIs.
  • Preserve sourceUrl for lineage and use facebookId for stable joins.
  • Duplicate normalized URLs are processed once per run.
  • One inaccessible URL does not discard successful rows from the same batch.
  • Facebook can change what anonymous public pages expose; unresolved rows explain the limitation.

API usage

JavaScript

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('fetch_cat/facebook-url-to-id-scraper').call({
  facebookUrls: [{ url: 'https://www.facebook.com/nasa' }],
  maxItems: 1,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();

Python

from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("fetch_cat/facebook-url-to-id-scraper").call(run_input={
    "facebookUrls": [{"url": "https://www.facebook.com/profile.php?id=4"}],
    "maxItems": 1,
})

cURL

curl -X POST "https://api.apify.com/v2/acts/fetch_cat~facebook-url-to-id-scraper/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"facebookUrls":[{"url":"https://www.facebook.com/nasa"}],"maxItems":1}'

MCP and AI agents

Add Apify MCP to Claude Code:

claude mcp add apify --transport http "https://mcp.apify.com?tools=fetch_cat/facebook-url-to-id-scraper"

Or configure any MCP-compatible client:

{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=fetch_cat/facebook-url-to-id-scraper"
    }
  }
}

Example prompts:

  • “Resolve these Facebook URLs and return only records whose status is resolved.”
  • “Convert this list of Facebook page, group, and post links to numeric IDs.”
  • “Normalize these Facebook links and preserve the source URL for each row.”

Use only public URLs you are authorized to process. Facebook IDs can be personal data when linked to individuals, so apply appropriate privacy and retention controls. The Actor does not log in, bypass access controls, or access private Facebook content.

Support

If a public URL format should resolve but does not, open an issue on the Actor page with a non-private example URL and the run ID. Do not share credentials or private links.

Common questions

Questions and answers reused from the canonical actor README.

What data can I export with Facebook ID Finder?

Each row includes the source and canonical URLs, numeric Facebook ID, object type, parent ID when present, owner handle, canonical entity URL, resolution method, status, error detail, and resolution timestamp. Export the dataset as JSON, CSV, Excel, XML, or another Apify-supported format.

Can I run Facebook URL to ID Scraper through an API, schedule, or MCP client?

Yes. Use the Apify API or client libraries for programmatic runs, Schedules for recurring batches, webhooks for completion events, or the Apify MCP server from a compatible AI client.

How much does it cost to use Facebook URL to ID Scraper?

The Actor charges one Start event per run and one Item extracted event only for each successfully resolved Facebook ID. Rates vary by Apify plan; the live Pricing tab is authoritative.

Why is a vanity group unresolved?

Vanity groups do not consistently expose a public numeric identity. Use a URL containing the numeric group ID.

Why is a pfbid post unresolved?

A pfbid is opaque. The Actor will not mislabel it as a stable numeric ID.