# Facebook URL to ID Converter - Page Identifier Lookup (`scrapingmonkey/facebook-url-to-id-converter`) Actor

Resolve Facebook Page usernames and supported URLs into profile and Page IDs. Export names, public links, pictures and verification with visible success or failed results.

- **URL**: https://apify.com/scrapingmonkey/facebook-url-to-id-converter.md
- **Developed by:** [ScrapingMonkey](https://apify.com/scrapingmonkey) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

Resolve Facebook Page usernames and supported Page URLs into numeric identifiers and a compact identity record. **Facebook URL to ID Scraper** returns the available profile ID, Page ID, name, public link, picture and verification flag, with one row per processed target.

Use this focused lookup to match Page references across databases or prepare inputs for other tools. Its single table and JSON export contain the same nine scalar fields.

| At a glance | Details |
|---|---|
| 📥 Input | Page usernames, numeric identifiers or supported Page URLs |
| 📤 Output | Profile ID, Page ID, requested identifier and public identity fields |
| 📄 Collection | One lookup per distinct queued target |
| 🔐 Facebook login | Not required |
| 💾 Delivery | Nine scalar columns, matching JSON and dataset exports |

### What the Facebook URL to ID scraper returns 🔢

The Actor resolves the public identity behind a Page reference. It returns `id` and the separate `page_id` when available, plus a name, public profile URL, picture and verification flag.

IDs remain strings so long numbers are not rounded in your application. The `username` field contains the normalized requested identifier; it can be a number when the input resolves from a numeric or legacy Page URL. It does not promise to discover the current vanity name.

### How to resolve a Facebook URL to an ID 🚀

1. Add Page usernames or supported Page links to `inputList`.
2. Keep every input as a string, including numeric identifiers.
3. Start the Actor and inspect the ID and status columns.
4. Export the mappings or join them to your existing records.

```json
{"inputList":["Meta","https://www.facebook.com/NASA/"]}
```

For a numeric Page reference, `https://www.facebook.com/profile.php?id=20531316728` is an accepted URL form. Use your own public targets when preparing a production run.

### Facebook ID data fields and output 📦

| Field group | Included data |
|---|---|
| Request context | Original input and success or failed status |
| Identifiers | Profile ID, available Page ID and normalized requested identifier |
| Public identity | Display name, profile URL, picture URL and verification flag |

Complete illustrative success row; the sample Page and its identifiers are not a live lookup claim:

```json
{
  "input": "harborartscollective",
  "status": "success",
  "id": "100200300400500",
  "page_id": "100200300400500",
  "username": "harborartscollective",
  "name": "Harbor Arts Collective",
  "profile_url": "https://www.facebook.com/harborartscollective/",
  "profile_picture_url": "https://images.example.com/harbor-arts.jpg",
  "is_verified": false
}
```

Every field is a scalar in the same table and JSON object, so no nested-record handling is needed. Successful optional fields may be empty strings or `false` when the public source omits them. A failed row retains `input`, uses `status: failed` and sets the seven identity fields to `null`.

### Input requirements and Page coverage ⚙️

| Parameter | Type | Required | Default and limits |
|---|---|---|---|
| `inputList` | Array of strings | Yes | At least one item; no default target or configured item-count maximum |

Accepted forms include a plain Page username, a numeric string, a direct Page URL, `profile.php?id=NUMERIC_ID`, and a legacy `/pages/NAME/NUMERIC_ID` URL. Standard, mobile and web Facebook hosts are supported. Bare identifiers may contain letters, digits, dots, underscores or hyphens and be up to 100 characters long.

Do not supply a leading `@`, group or event link, or a post, Reel, photo or video URL. This is a Page identity lookup rather than a general converter for every Facebook content type. There is no pagination setting.

Repeated inputs that normalize to the same queued target are normally handled once. Different aliases may require separate lookups, so use the returned IDs when matching records.

### Facebook identifier use cases 🎯

#### Page record matching

Connect Page links from different datasets to numeric identifiers while retaining the original input for traceability.

#### Data preparation

Resolve known public references before using a downstream service that expects a numeric Page ID.

#### Directory maintenance

Keep a compact mapping of Page names, URLs and IDs without collecting a full Page detail record.

#### Link validation

Separate successful identity lookups from malformed or unavailable references before starting a larger enrichment job.

### Pricing and billable ID lookup rows 💰

Check the Actor's **Pricing** tab for the current model and rate. Under dataset-item pricing, each saved success or failed lookup row can count as a billable result.

Automatic retry attempts do not independently create rows. Duplicate normalized targets are normally queued once, but distinct aliases are not guaranteed to collapse into one record before lookup.

### Facebook URL to ID API and integrations 🔌

Replace `$ACTOR_ID` with the ID from the Actor API tab and `$APIFY_TOKEN` with your Apify token.

```bash
curl -X POST "https://api.apify.com/v2/acts/$ACTOR_ID/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"inputList":["Meta","https://www.facebook.com/NASA/"]}'
```

Use the dataset as a lookup table in a spreadsheet, CRM or database. Scheduled runs, webhooks and Apify integrations can connect this mapping step to a broader workflow.

### Reliability and identifier limits ⚠️

The Actor retries temporary request failures and returns a failed row when a lookup remains unavailable. Bad references are handled independently of valid inputs; startup or dataset storage failures can still interrupt the run.

Facebook can rename, restrict or remove Pages and omit optional fields. Profile IDs and Page IDs can represent different identifiers; keep both rather than assuming they are interchangeable. No identifier is guaranteed permanent by this tool.

### Frequently asked questions ❓

#### Can I submit Page URLs as well as usernames?

Yes. Direct Page links and supported numeric or legacy Page URL forms are accepted alongside plain usernames.

#### Does it resolve post, event or group IDs?

No. Use the corresponding Facebook actor for those entities. This Actor focuses on public Page identity references.

#### Why is `username` a number in my result?

That field retains the normalized requested identifier. Numeric Page references can therefore produce a numeric string there.

#### Are `id` and `page_id` always the same?

No. They are separate source fields. Either may differ, and the Page-specific value may be absent.

#### Do I need Facebook credentials?

No Facebook login or cookies are requested. Restricted identities can still be unavailable to the Actor.

### Support, responsible use, and related actors 🛟

Share the run ID and a safe public Page reference that reproduces the issue. Do not include credentials or API tokens.

Use public identity data in accordance with applicable privacy and platform requirements.

# Actor input Schema

## `inputList` (type: `array`):

Add one Facebook Page username or full Page URL per item. Every input produces success or failed output.

## Actor input object example

```json
{
  "inputList": [
    "Meta"
  ]
}
```

# Actor output Schema

## `results` (type: `string`):

Actor dataset results with input and status columns.

# 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 = {
    "inputList": [
        "Meta"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapingmonkey/facebook-url-to-id-converter").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 = { "inputList": ["Meta"] }

# Run the Actor and wait for it to finish
run = client.actor("scrapingmonkey/facebook-url-to-id-converter").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 '{
  "inputList": [
    "Meta"
  ]
}' |
apify call scrapingmonkey/facebook-url-to-id-converter --silent --output-dataset

```

## MCP server setup

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

```

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/W2JxmxJYZgSWZVRcS/builds/6HRe1b12sjaLeH51A/openapi.json
