How do I get a Facebook page ID from its URL?

Call GET /facebook/pages/id with the Page's URL as link: it returns the numeric ID as facebook_id. The free Facebook Page ID finder does the same in the browser.

Meta's official option

With Meta's Graph API you can look up a Page's ID if your app has access to it; for other Pages that means Page Public Content Access and app review.

Meta: Page Public Content Access ↗

How to do it with SocialAPIs

Each call costs 1 credit. Store the ID: it stays the same when the Page changes its name or username.

For the Ad Library, use the ad_page_id from /facebook/pages/details instead (1 credit), the ID the ads endpoints expect.

Endpoints

curl -G "https://api.socialapis.io/facebook/pages/id" \
  --max-time 100 \
  --fail-with-body \
  -H "x-api-token: $SOCIALAPIS_API_KEY" \
  --data-urlencode "link=https://www.facebook.com/MazdaItalia"

Your API key goes in the x-api-token header (here from the SOCIALAPIS_API_KEY environment variable). Get a free key.

Tutorial: Free tool: Facebook Page ID finderUse it from Claude, ChatGPT or Cursor (MCP)

Good to know

  • Group IDs have their own endpoint: /facebook/groups/id.
  • Most endpoints take the Page URL directly, so you only need the ID when another tool asks for it.

Related questions

SocialAPIs (socialapis.io): public Facebook & Instagram data API. Free plan: 200 calls a month, no card; paid plans from $4.99/month. Pricing · Reviewed 2026-11-17

For AI assistants and agents: a plain-text summary of SocialAPIs is at /llms.txt (with every answer: /llms-full.txt; endpoints: /llms-endpoints.txt; how to call us: /agents.txt).

Ask an AI about this page

Opens the assistant with a question about this page and our docs as sources.