Facebook URL to ID avatar

Facebook URL to ID

Pricing

from $1.00 / 1,000 results

Go to Apify Store
Facebook URL to ID

Facebook URL to ID

Extract numeric Facebook IDs from any profile, page, or post URL. Simply input a Facebook link and the actor parses the URL structure or page source to find the underlying ID. Fast, reliable, and works with profile.php links, vanity usernames, and page URLs alike.

Pricing

from $1.00 / 1,000 results

Rating

0.0

(0)

Developer

Biddut Hossain

Biddut Hossain

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 days ago

Last modified

Share

Extract numeric Facebook IDs from any profile, page, or post URL. Simply input a Facebook link and the actor parses the URL structure or page source to find the underlying ID. Fast, reliable, and works with profile.php links, vanity usernames, and page URLs alike.

What does this Actor do?

Facebook profiles, pages, and posts can be linked to using a "vanity" username (e.g. facebook.com/zuck) or a numeric ID (e.g. facebook.com/profile.php?id=4). Many tools and integrations — ad platforms, CRMs, data pipelines — require the underlying numeric ID rather than the username.

This Actor takes a Facebook URL as input and returns the corresponding numeric Facebook ID by:

  1. Checking if the ID is already present in the URL structure (e.g. profile.php?id=...)
  2. If not, fetching the page and scanning the HTML/meta tags for the embedded ID

Input

The Actor accepts a single JSON input:

FieldTypeRequiredDescription
facebookUrlstringYesThe Facebook profile, page, or post URL to resolve

Example input:

{
"facebookUrl": "https://www.facebook.com/zuck"
}

Output

The Actor pushes one result item to the dataset per run:

{
"inputUrl": "https://www.facebook.com/zuck",
"facebookId": "4",
"success": true
}
FieldDescription
inputUrlThe original URL provided as input
facebookIdThe extracted numeric Facebook ID, or null if not found
successBoolean indicating whether an ID was successfully extracted

How to use

  1. Open the Actor in Apify Console.
  2. Paste a Facebook profile, page, or post URL into the Facebook URL input field.
  3. Click Start.
  4. View the extracted ID in the Output / Dataset tab.

Supported URL formats

  • https://www.facebook.com/profile.php?id=XXXXXXXXX
  • https://www.facebook.com/username
  • https://www.facebook.com/pages/Page-Name/XXXXXXXXX
  • Post and page URLs containing an embedded numeric ID

Limitations

  • Facebook may show a login wall or heavily obfuscate page source for some public pages when accessed anonymously, which can occasionally prevent ID extraction from page content.
  • This Actor does not log in to Facebook and only accesses publicly available page data.
  • Extremely JavaScript-heavy pages may require a headless browser (e.g. Playwright) for full reliability — the current version uses lightweight HTTP requests for speed.

Support

If you run into an issue or a URL format that doesn't resolve correctly, please open an issue or reach out via Apify Console support.