# Facebook URL to ID — Rich Metadata Extractor (`brilliant_gum/facebook-url-to-id`) Actor

Convert any Facebook URL (profiles, pages, groups, events, posts, videos, reels) to numeric ID + rich metadata: followers, verified status, category, contact info, website, and more. Supports bulk processing, all URL formats, and automatic entity type detection.

- **URL**: https://apify.com/brilliant\_gum/facebook-url-to-id.md
- **Developed by:** [Yuliia Kulakova](https://apify.com/brilliant_gum) (community)
- **Categories:** Developer tools, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## Facebook URL to ID — Rich Metadata Extractor

![Facebook URL to ID](https://i.imgur.com/dPvRcMo.png)

Convert any Facebook URL into its numeric ID — instantly. Pages, groups, profiles, events, posts, videos, reels. Paste a link, get the ID plus a full metadata snapshot: name, followers, likes, verified badge, category, website, and more.

---

### What it does

Facebook's numeric IDs are the foundation of every API call, ad campaign, and analytics integration. This tool resolves any Facebook URL — no matter the format — into the clean numeric ID your workflow needs, along with rich profile data pulled in the same request.

Built for:
- **Developers** — get page/profile IDs for Facebook Graph API calls without digging through source code
- **Advertisers & media buyers** — identify page IDs for custom audience targeting and ad placement
- **Marketers & analysts** — enrich your contact lists with follower counts, categories, and verified status
- **Lead generation** — check if a business page is actively running ads with one click
- **Data teams** — bulk-convert thousands of Facebook URLs in a single run

---

### Supported URL types

| Type | Example |
|---|---|
| Pages | `facebook.com/nike` |
| Profiles | `facebook.com/profile.php?id=4` |
| Groups | `facebook.com/groups/123456789` |
| Events | `facebook.com/events/987654321` |
| Posts | `facebook.com/permalink.php?story_fbid=...` |
| Videos & Reels | `facebook.com/watch/?v=...` |
| Short links | `fb.me/...`, `fb.watch/...` |
| Mobile URLs | `m.facebook.com/...` |

---

### Output fields

Every result includes:

| Field | Description |
|---|---|
| `facebookId` | Numeric Facebook ID |
| `entityType` | Type: page, group, profile, event, post, video |
| `name` | Page or profile name |
| `username` | Vanity username (e.g. `nike`) |
| `isVerified` | Blue verified badge |
| `likesCount` | Total likes |
| `followersCount` | Total followers |
| `category` | Page category (e.g. "Sportswear Store") |
| `description` | Page description or bio |
| `website` | Linked website URL |
| `profilePictureUrl` | Profile image URL |
| `coverPhotoUrl` | Cover photo URL |
| `hasActiveAds` | Whether the page is running ads right now (optional) |
| `status` | `success`, `partial`, or `failed` |

---

### Example output

```json
{
  "url": "https://www.facebook.com/nike",
  "facebookId": "15087023444",
  "entityType": "page",
  "status": "success",
  "page": {
    "name": "Nike",
    "username": "nikerunning",
    "isVerified": true,
    "category": "Sportswear Store",
    "likesCount": 39651856,
    "description": "Just Do It.",
    "profilePictureUrl": "https://lookaside.fbsbx.com/...",
    "coverPhotoUrl": "https://lookaside.fbsbx.com/...",
    "hasActiveAds": true
  }
}
````

***

### Input options

| Field | Description | Default |
|---|---|---|
| `fbUrls` | List of Facebook URLs to process | *(required)* |
| `extractMetadata` | Return name, followers, category, photos alongside the ID | `true` |
| `checkAdsLibrary` | Check if each page is currently running active ads | `false` |
| `maxConcurrency` | Parallel requests for bulk processing (max 50) | `5` |

#### Example input

```json
{
  "fbUrls": [
    { "url": "https://www.facebook.com/google" },
    { "url": "https://www.facebook.com/NASA" },
    { "url": "https://www.facebook.com/cocacola" }
  ],
  "extractMetadata": true,
  "checkAdsLibrary": true
}
```

***

### Pricing

**$0.01 per result** — that's $10 per 1,000 URLs processed.

Fast runs, minimal compute. A batch of 1,000 URLs typically completes in under 5 minutes.

***

### Integrations

Export results as JSON, CSV, or Excel. Plug into your stack via:

- Apify API
- Webhooks
- Make (Integromat), n8n, Zapier

***

### FAQ

**Does it work for private profiles and closed groups?**
The numeric ID is extracted instantly from the URL for events, groups, posts, and any URL containing a numeric ID — no login needed. For public pages, full metadata is returned. Private content returns the ID with a `partial` status.

**Can I process thousands of URLs at once?**
Yes — paste as many URLs as you need. Use `maxConcurrency` to control speed.

**What is `checkAdsLibrary` useful for?**
It tells you whether a Facebook page is actively running paid ads right now. Useful for lead scoring: pages spending on ads are typically active businesses with real budgets.

**Do I need a proxy?**
Not required for most public pages and any URL with a numeric ID. Residential proxy is recommended for high-volume bulk runs.

# Actor input Schema

## `fbUrls` (type: `array`):

Facebook URLs to convert. Accepts pages, groups, profiles, events, posts, videos, reels, photos — any format (www, m., fb.me, fb.watch). Compatible with apify/facebook-url-to-id.

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

Residential proxy recommended for vanity page/profile URLs. Events, posts, and URLs with numeric IDs in the path work without proxies.

## `extractMetadata` (type: `boolean`):

Return name, followers, likes, verified status, category, website, phone, email, address, cover photo alongside the ID. Disable for ID-only (faster, cheaper).

## `checkAdsLibrary` (type: `boolean`):

For each page, check Meta Ads Library to see if it's currently running active ads. Adds hasActiveAds: true/false to page results. Makes one extra request per page URL. Pages that run ads are typically active businesses — useful for lead scoring and prospect qualification.

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

Parallel requests. Increase for large batches (max 50). Default 5 is safe for most proxy setups.

## Actor input object example

```json
{
  "fbUrls": [
    {
      "url": "https://www.facebook.com/nike"
    },
    {
      "url": "https://www.facebook.com/cocacola"
    },
    {
      "url": "https://www.facebook.com/events/148397769056786"
    },
    {
      "url": "https://www.facebook.com/profile.php?id=4"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "extractMetadata": true,
  "checkAdsLibrary": false,
  "maxConcurrency": 5
}
```

# Actor output Schema

## `url` (type: `string`):

The original Facebook URL provided as input.

## `facebookId` (type: `string`):

Numeric Facebook ID extracted from the URL.

## `entityType` (type: `string`):

Type of Facebook entity: page, group, profile, event, post, video, reel.

## `username` (type: `string`):

Vanity username (e.g. nike, NASA).

## `name` (type: `string`):

Page or profile display name.

## `isVerified` (type: `string`):

Whether the page has a blue verified badge.

## `likesCount` (type: `string`):

Total number of likes on the page.

## `followersCount` (type: `string`):

Total number of followers.

## `category` (type: `string`):

Page category (e.g. Sportswear Store, Government organization).

## `description` (type: `string`):

Page description or bio.

## `website` (type: `string`):

Linked website URL from the page.

## `profilePictureUrl` (type: `string`):

URL of the profile picture.

## `coverPhotoUrl` (type: `string`):

URL of the cover photo.

## `hasActiveAds` (type: `string`):

Whether the page is currently running active ads in Meta Ads Library.

## `status` (type: `string`):

Extraction status: success, partial, or failed.

## `error` (type: `string`):

Error message if extraction failed or returned partial results.

## `scrapedAt` (type: `string`):

ISO timestamp of when this result was scraped.

# 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 = {
    "fbUrls": [
        {
            "url": "https://www.facebook.com/nike"
        },
        {
            "url": "https://www.facebook.com/cocacola"
        },
        {
            "url": "https://www.facebook.com/events/148397769056786"
        },
        {
            "url": "https://www.facebook.com/profile.php?id=4"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("brilliant_gum/facebook-url-to-id").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 = {
    "fbUrls": [
        { "url": "https://www.facebook.com/nike" },
        { "url": "https://www.facebook.com/cocacola" },
        { "url": "https://www.facebook.com/events/148397769056786" },
        { "url": "https://www.facebook.com/profile.php?id=4" },
    ],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

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

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

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

```

## CLI example

```bash
echo '{
  "fbUrls": [
    {
      "url": "https://www.facebook.com/nike"
    },
    {
      "url": "https://www.facebook.com/cocacola"
    },
    {
      "url": "https://www.facebook.com/events/148397769056786"
    },
    {
      "url": "https://www.facebook.com/profile.php?id=4"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call brilliant_gum/facebook-url-to-id --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=brilliant_gum/facebook-url-to-id",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Facebook URL to ID — Rich Metadata Extractor",
        "description": "Convert any Facebook URL (profiles, pages, groups, events, posts, videos, reels) to numeric ID + rich metadata: followers, verified status, category, contact info, website, and more. Supports bulk processing, all URL formats, and automatic entity type detection.",
        "version": "1.0",
        "x-build-id": "SFQDNAuWcLK0Fdaeo"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/brilliant_gum~facebook-url-to-id/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-brilliant_gum-facebook-url-to-id",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/brilliant_gum~facebook-url-to-id/runs": {
            "post": {
                "operationId": "runs-sync-brilliant_gum-facebook-url-to-id",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/brilliant_gum~facebook-url-to-id/run-sync": {
            "post": {
                "operationId": "run-sync-brilliant_gum-facebook-url-to-id",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "fbUrls": {
                        "title": "Facebook URLs",
                        "type": "array",
                        "description": "Facebook URLs to convert. Accepts pages, groups, profiles, events, posts, videos, reels, photos — any format (www, m., fb.me, fb.watch). Compatible with apify/facebook-url-to-id.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "proxyConfiguration": {
                        "title": "Proxy",
                        "type": "object",
                        "description": "Residential proxy recommended for vanity page/profile URLs. Events, posts, and URLs with numeric IDs in the path work without proxies."
                    },
                    "extractMetadata": {
                        "title": "Extract Rich Metadata",
                        "type": "boolean",
                        "description": "Return name, followers, likes, verified status, category, website, phone, email, address, cover photo alongside the ID. Disable for ID-only (faster, cheaper).",
                        "default": true
                    },
                    "checkAdsLibrary": {
                        "title": "Check Active Ads (Meta Ads Library)",
                        "type": "boolean",
                        "description": "For each page, check Meta Ads Library to see if it's currently running active ads. Adds hasActiveAds: true/false to page results. Makes one extra request per page URL. Pages that run ads are typically active businesses — useful for lead scoring and prospect qualification.",
                        "default": false
                    },
                    "maxConcurrency": {
                        "title": "Max Concurrency",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "Parallel requests. Increase for large batches (max 50). Default 5 is safe for most proxy setups.",
                        "default": 5
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
