Facebook URL to ID
Pricing
from $1.00 / 1,000 results
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
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
4 days ago
Last modified
Categories
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:
- Checking if the ID is already present in the URL structure (e.g.
profile.php?id=...) - If not, fetching the page and scanning the HTML/meta tags for the embedded ID
Input
The Actor accepts a single JSON input:
| Field | Type | Required | Description |
|---|---|---|---|
facebookUrl | string | Yes | The 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}
| Field | Description |
|---|---|
inputUrl | The original URL provided as input |
facebookId | The extracted numeric Facebook ID, or null if not found |
success | Boolean indicating whether an ID was successfully extracted |
How to use
- Open the Actor in Apify Console.
- Paste a Facebook profile, page, or post URL into the Facebook URL input field.
- Click Start.
- View the extracted ID in the Output / Dataset tab.
Supported URL formats
https://www.facebook.com/profile.php?id=XXXXXXXXXhttps://www.facebook.com/usernamehttps://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.