# Facebook ID Finder (`axiomworks/facebook-id-finder`) Actor

Convert Facebook URLs, vanity names or @handles into numeric IDs. Works for pages, profiles, groups, posts, videos and reels, and returns the ID, name, vanity name, object type, current and classic Page IDs and the source URL. No Facebook login needed.

- **URL**: https://apify.com/axiomworks/facebook-id-finder.md
- **Developed by:** [Axiom Works](https://apify.com/axiomworks) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.31 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Facebook ID Finder

### What does Facebook ID Finder do?

Facebook ID Finder is a Facebook URL to ID converter: it turns public Facebook links into the numeric IDs that Facebook uses internally. You give it a list of page, profile, group, post, video or reel URLs, bare vanity names such as `cocacola`, or handles such as `@Meta`. For each distinct input it returns one row with the numeric ID, the object type and, for pages, the classic Page ID as well.

Numeric IDs are useful because vanity names change, while IDs stay the same. They let you:

- join and deduplicate lists that mix vanity URLs, `profile.php?id=` URLs and mobile links,
- feed tools and APIs that only accept numeric IDs,
- check that a list of Facebook links still points to live, public pages,
- tell a Facebook Page apart from a personal profile.

The Actor reads public pages only. It does not log in, and it does not use cookies or a Facebook account. Private groups, friends-only posts and removed pages are reported with a clear status instead of an ID.

Facebook pages now have two IDs. Since Facebook moved Pages to the "new Pages experience", every Page has a profile ID, and most also keep their older classic Page ID. Different tools expect different IDs. Facebook ID Finder returns both: `id` holds the current profile ID and `pageId` holds the classic Page ID. You don't need to guess which one your tool wants.

### What data can you get from Facebook ID Finder?

Each result row has these fields:

| Field | Description | Example |
| --- | --- | --- |
| `inputUrl` | The URL, vanity name or handle exactly as you entered it | `https://www.facebook.com/nasa` |
| `normalizedUrl` | The cleaned Facebook URL that was resolved | `https://www.facebook.com/nasa` |
| `sourceUrl` | The URL the data came from, after redirects | `https://www.facebook.com/NASA/` |
| `type` | `profile`, `page`, `group`, `group_post`, `post`, `video`, `photo` or `unknown` | `page` |
| `id` | The main numeric Facebook ID, as a string | `100044561550831` |
| `pageId` | The classic Page ID (Pages only) | `54971236771` |
| `vanity` | The public vanity name | `NASA` |
| `name` | The public display name | `NASA - National Aeronautics and Space Administration` |
| `canonicalUrl` | The canonical link of the page | `https://www.facebook.com/NASA/` |
| `ownerId` | The author or owner ID of a post or video, when shown | `54971236771` |
| `postId` | The feed post ID linked to a post or video, when shown | `1641734060655297` |
| `videoId` | The video ID of a video or reel | `28263630716612782` |
| `method` | `url_parse` if the ID was read from the URL, `html` if the page was fetched | `html` |
| `status` | `ok`, `not_found`, `login_required` or `error` | `ok` |
| `error` | The reason when the status is not `ok` | `HTTP 404` |
| `resolvedAt` | The time the row was produced, in UTC | `2026-09-29T19:57:10.512Z` |

All IDs are strings. Many Facebook IDs have 15 to 17 digits, which is more than a JavaScript number or a spreadsheet cell can hold exactly. Keeping them as strings means they never get rounded.

When a URL can't be resolved, the `id` field still holds a stable value that starts with `unresolved-`. Every row therefore has a unique `id`, and you can see which inputs failed. If two inputs resolve to the same Facebook object (for example `facebook.com/nasa` and `profile.php?id=100044561550831`), the second row gets a short suffix so ids stay unique.

### How to use Facebook ID Finder

1. Open the Actor in Apify Console and go to the **Input** tab.
2. Paste your Facebook links into **Facebook URLs**, one per line. Full URLs from `www.facebook.com`, `m.facebook.com`, `web.facebook.com`, `mbasic.facebook.com` and `fb.com` work, as do `fb.watch` short links, bare vanity names and `@handles`.
3. Set **Maximum results** to limit how many URLs are processed.
4. Leave **Fetch page details** on if you want names, vanity names, canonical URLs and classic Page IDs. Turn it off if you only need IDs and most of your URLs already contain them.
5. Keep the default residential proxy. Facebook sends most datacenter IP addresses to its login page.
6. Click **Start**. When the run finishes, open the **Output** tab to see the table, or download the results as JSON, CSV, Excel or HTML.

#### How the Actor resolves each URL

The Actor always reads the URL first. Many Facebook URLs already contain the ID: `profile.php?id=4`, `/groups/1449013568720516`, `/NASA/posts/1641734060655297`, `/reel/28263630716612782` or `watch?v=...`. If you turned off **Fetch page details**, these URLs are resolved instantly without any request to Facebook. They are marked `method: url_parse`.

Every other URL, such as a vanity name or a group slug, is requested once from Facebook through the proxy. The Actor follows up to five redirects on Facebook hosts and reads the IDs from the public page. These rows are marked `method: html`.

If Facebook answers with its login page, the Actor waits and retries with a new proxy session a few times before it reports `login_required`. Requests are spread out over time rather than sent all at once, so the Actor stays polite to Facebook. Each URL gets at most 30 seconds, including retries.

If the run is about to reach its timeout, or you abort it, the Actor stops fetching and saves the URLs it hasn't finished from the URL alone. You still get one row per input, and the rows that couldn't be fetched say so in `error`.

#### Tips

- Duplicates are removed after cleaning. `https://m.facebook.com/natgeo`, `facebook.com/natgeo/` and `natgeo` count as the same input.
- If a person or Page renames its vanity URL, the old URL may stop working. The numeric ID you stored earlier still identifies the same account.

### Input

| Field | Type | Description |
| --- | --- | --- |
| `urls` | array of strings | Facebook URLs, vanity names or `@handles` to resolve. You need at least one. |
| `maxItems` | integer | Maximum number of results (1-10,000, default 100). You get one result per distinct URL. |
| `fetchDetails` | boolean | Default `true`. Requests each page to add name, vanity, canonical URL, Page ID and owner ID. With `false`, URLs that already contain a numeric ID are resolved without a request; vanity URLs are still requested. |
| `resolveFromUrlOnly` | boolean | Default `false`. `true` never contacts Facebook and overrides `fetchDetails`. Only IDs already present in the URLs are returned. Vanity URLs get `not_found`. |
| `maxConcurrency` | integer | Number of URLs worked on in parallel, Default 3, min 1, max 10. |
| `proxyConfiguration` | object | Apify Proxy settings. Residential proxies work best for Facebook. |

Example input:

```json
{
  "urls": [
    "https://www.facebook.com/nasa",
    "https://m.facebook.com/natgeo",
    "@Meta",
    "cocacola",
    "https://www.facebook.com/groups/wordpress",
    "https://www.facebook.com/reel/28263630716612782"
  ],
  "maxItems": 10,
  "fetchDetails": true,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

The run stops straight away with a clear error message if the input is invalid. That includes an empty URL list, a link that isn't a Facebook link, an unknown input field, or a value of the wrong type. A run in which none of the URLs resolves to an ID is marked as failed after its rows are saved, so you notice a bad list quickly.

### Output

Every row carries all 16 fields; values that don't apply are `null`. The examples below omit null fields for brevity and come from a local test run. A Facebook Page, fetched with details:

```json
{
  "inputUrl": "https://www.facebook.com/nasa",
  "normalizedUrl": "https://www.facebook.com/nasa",
  "sourceUrl": "https://www.facebook.com/NASA/",
  "type": "page",
  "id": "100044561550831",
  "vanity": "NASA",
  "method": "html",
  "status": "ok",
  "resolvedAt": "2026-09-29T19:59:59.338Z",
  "pageId": "54971236771",
  "name": "NASA - National Aeronautics and Space Administration",
  "canonicalUrl": "https://www.facebook.com/NASA/"
}
```

A personal profile:

```json
{
  "inputUrl": "https://facebook.com/zuck",
  "normalizedUrl": "https://www.facebook.com/zuck",
  "sourceUrl": "https://www.facebook.com/zuck",
  "type": "profile",
  "id": "4",
  "vanity": "zuck",
  "method": "html",
  "status": "ok",
  "resolvedAt": "2026-09-29T20:00:02.361Z",
  "name": "Mark Zuckerberg",
  "canonicalUrl": "https://www.facebook.com/zuck/"
}
```

A reel resolved from the URL alone, with **Fetch page details** turned off:

```json
{
  "inputUrl": "https://www.facebook.com/reel/28263630716612782",
  "normalizedUrl": "https://www.facebook.com/reel/28263630716612782",
  "sourceUrl": "https://www.facebook.com/reel/28263630716612782",
  "type": "video",
  "id": "28263630716612782",
  "method": "url_parse",
  "status": "ok",
  "resolvedAt": "2026-09-29T19:58:47.680Z"
}
```

A URL that doesn't exist:

```json
{
  "inputUrl": "https://www.facebook.com/this.page.does.not.exist.xyz123",
  "normalizedUrl": "https://www.facebook.com/this.page.does.not.exist.xyz123",
  "sourceUrl": "https://www.facebook.com/this.page.does.not.exist.xyz123",
  "type": "profile",
  "id": "unresolved-d72efe38df69",
  "vanity": "this.page.does.not.exist.xyz123",
  "method": "html",
  "status": "not_found",
  "resolvedAt": "2026-09-29T20:00:04.526Z",
  "error": "No ID on the page: it is removed, private or restricted, or the URL does not exist."
}
```

### How much does it cost to use Facebook ID Finder?

The Actor uses pay-per-event pricing, so you pay per result. A URL resolved with `status: ok` is charged once. A URL whose ID is read straight from the URL, without any page request, is charged at a separate, lower per-result rate than a URL that needed a page fetch. Rows with `not_found`, `login_required` or `error` aren't charged. The current rates are on the Actor's **Pricing** tab. Apify platform usage, such as the residential proxy, is included in the per-result price.

To keep costs down:

- Turn off **Fetch page details** for URLs that already contain an ID, such as `/reel/28263630716612782`. Those rows show `method: url_parse` and use the lower rate. Rows fetched from the page show `method: html`.
- Turn on **Resolve from URL only** to send no page requests. Vanity URLs such as `https://www.facebook.com/nasa` can't be resolved this way and return `status: not_found`, which isn't charged.
- Set **Maximum results** to limit how many URLs are processed. Each URL gives one row.

### Use with the API

You can run the Actor through the Apify API. Replace `<YOUR_API_TOKEN>` with your Apify API token (in cURL, `$APIFY_TOKEN` holds it).

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("axiomworks/facebook-id-finder").call(run_input={
    "urls": ["https://www.facebook.com/nasa", "@Meta"],
    "maxItems": 10,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["inputUrl"], item["type"], item["id"], item.get("pageId"))
```

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('axiomworks/facebook-id-finder').call({
    urls: ['https://www.facebook.com/nasa', '@Meta'],
    maxItems: 10,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => console.log(item.inputUrl, item.type, item.id, item.pageId));
```

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/axiomworks~facebook-id-finder/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://www.facebook.com/nasa", "@Meta"], "maxItems": 10}'
```

You can also connect Facebook ID Finder to Make, Zapier, n8n, Google Sheets, Slack, webhooks and other tools from the **Integrations** tab.

### Use with AI agents (MCP)

You can call Facebook ID Finder from AI agents and assistants that support the Model Context Protocol (MCP), such as Claude Desktop, Claude Code, Cursor or VS Code. Add the Apify MCP server to your client configuration and load this Actor as a tool:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=axiomworks/facebook-id-finder"
    }
  }
}
```

Your client will ask you to sign in to Apify the first time. After that, the agent can run the Actor and read its results.

Example prompts:

- "Resolve these Facebook links to numeric IDs: https://www.facebook.com/nasa and https://www.facebook.com/natgeo."
- "For each Facebook Page in this list, give me both the new profile ID and the classic Page ID."
- "Which of these Facebook URLs no longer exist? Return the ones with status not\_found."
- "Get the numeric group ID of https://www.facebook.com/groups/wordpress."

The input and output schemas describe every field, so the agent knows which inputs to send and what each output field means.

### FAQ

#### Does Facebook ID Finder need a Facebook account?

No. It only reads pages that anyone can open without logging in. You never enter a Facebook password or cookies.

#### Why do I get fewer results than maxItems?

You get one result per distinct input URL. A run with 5 URLs returns at most 5 rows, even with `maxItems` set to 100. Duplicate inputs are merged.

#### What is the difference between id and pageId?

For Facebook Pages, `id` is the profile ID used by the new Pages experience, which is what you see in `profile.php?id=` links. `pageId` is the older classic Page ID, which some tools and integrations still expect. Personal profiles and groups have only `id`.

#### How does the Actor tell a Page from a profile?

A row is marked `page` when the fetched page carries a classic Page ID and Facebook labels it as a Page. Otherwise it is `profile`. Rows resolved from the URL alone use the URL pattern, so `profile.php?id=` links are reported as `profile` until you fetch details.

#### Why is a URL marked login\_required or not\_found?

Private groups, friends-only posts, age- or country-restricted pages and removed accounts can't be opened without logging in. The Actor reports them instead of guessing an ID. If many public URLs come back as `login_required`, check that you are using residential proxies.

#### Can it resolve short links?

Yes. `fb.watch` and `facebook.com/share/...` links are followed through up to five redirects on Facebook hosts, and the final page is resolved.

#### Does it collect personal data?

For profiles it returns only the numeric ID, public display name, vanity name and canonical URL. It doesn't collect posts, friends, photos or contact details.

#### Can the output change over time?

Facebook can change its page markup at any time. If a field suddenly stays empty, please report it on the Issues tab so the Actor can be updated.

### Is it legal to scrape Facebook?

This Actor only reads publicly available pages, without logging in, and it returns IDs and public names rather than personal content. Even so, public data can include personal data, which laws such as the GDPR and the CCPA protect. Facebook's terms of service also limit automated access. You are responsible for making sure your use is lawful and has a legitimate purpose. If you're unsure, ask a lawyer. This Actor is an independent tool. Meta and Facebook don't operate, sponsor or endorse it.

### Feedback

Found a URL type that doesn't resolve, a wrong ID or a missing field? Please open an issue on the Actor's **Issues** tab with the input URL and the run ID. Feature requests are welcome there too.

# Actor input Schema

## `urls` (type: `array`):

Facebook URLs, vanity names or @handles to resolve to numeric IDs, e.g. 'https://www.facebook.com/nasa', 'https://www.facebook.com/groups/wordpress' or '@Meta'. Each distinct URL returns one result.

## `maxItems` (type: `integer`):

Maximum number of results, one per distinct input URL (1-10,000, default 100), e.g. 100. URLs beyond this number are skipped.

## `fetchDetails` (type: `boolean`):

Default true. Requests Facebook pages to add name, vanity, canonicalUrl, pageId and ownerId. When false, URLs that already contain a numeric ID are resolved without a request; vanity URLs are still requested.

## `resolveFromUrlOnly` (type: `boolean`):

Default false. When true, makes no requests to Facebook at all and overrides fetchDetails: only IDs already in the URL (profile.php?id=, /groups/123, /posts/123, /reel/123, watch?v=) are returned and vanity URLs get status not\_found.

## `maxConcurrency` (type: `integer`):

Number of URLs resolved in parallel. Default 3, min 1, max 10. Requests stay spaced out across the whole run to be polite to Facebook.

## `proxyConfiguration` (type: `object`):

Apify Proxy settings for Facebook page requests, e.g. the RESIDENTIAL group. Facebook sends datacenter IPs to a login page, so residential proxies work best.

## Actor input object example

```json
{
  "urls": [
    "https://www.facebook.com/nasa",
    "https://www.facebook.com/natgeo",
    "https://www.facebook.com/groups/wordpress"
  ],
  "maxItems": 10,
  "fetchDetails": true,
  "resolveFromUrlOnly": false,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

Resolved URLs and IDs.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "urls": [
        "https://www.facebook.com/nasa",
        "https://www.facebook.com/natgeo",
        "https://www.facebook.com/groups/wordpress"
    ],
    "maxItems": 10,
    "fetchDetails": true,
    "maxConcurrency": 3,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("axiomworks/facebook-id-finder").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "urls": [
        "https://www.facebook.com/nasa",
        "https://www.facebook.com/natgeo",
        "https://www.facebook.com/groups/wordpress",
    ],
    "maxItems": 10,
    "fetchDetails": True,
    "maxConcurrency": 3,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("axiomworks/facebook-id-finder").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    "https://www.facebook.com/nasa",
    "https://www.facebook.com/natgeo",
    "https://www.facebook.com/groups/wordpress"
  ],
  "maxItems": 10,
  "fetchDetails": true,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call axiomworks/facebook-id-finder --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,axiomworks/facebook-id-finder"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/JEakHJU3DhzvoVDfQ/builds/s5iBw0lHuxnCjHbiw/openapi.json
