# Facebook URL to ID (`data_minds/facebook-url-to-id`) Actor

Convert any public Facebook URL, username or numeric ID into the real Facebook ID. Works for pages, profiles, groups, posts, videos and reels. Get name, category, followers and website too. No login or cookies. Bulk input, auto proxy fallback. Export JSON, CSV or Excel.

- **URL**: https://apify.com/data_minds/facebook-url-to-id.md
- **Developed by:** [Data Minds](https://apify.com/data_minds) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 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.
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

### 📖 What is Facebook URL to ID Finder?

> ⚡ Fast start · 🆔 Every ID type in one row · 📦 Export to JSON, CSV or Excel · 🤖 Works with AI agents

**Facebook URL to ID Finder** turns public Facebook links, usernames and numeric IDs into the real Facebook ID behind them. Paste your list, press Start, and you get one row per input with the ID, the canonical link, the type of content and, if you like, name, followers, category and post details. It suits marketers, analysts and developers who need clean identifiers without writing code, for one link or a long list.

- 🔑 **Get the ID Facebook uses:** page, profile, group, post, video and photo IDs from whatever link format you have.
- 📣 **Prepare ads research:** every page row comes with its page ID and a ready Ads Library link.
- 🧹 **Clean up messy lists:** mix full links, share links, usernames and numbers in one run and get one tidy table back.
- 🔁 **Look up in reverse:** paste a numeric ID and get the canonical link and username back.
- 📈 **Enrich your data:** add name, category, verified badge and follower counts to every page.
- 🤖 **Keep it running:** schedule runs and send the IDs to your sheet, your CRM or your AI agent.

#### ✨ What can Facebook URL to ID Finder do?

- 📄 **Pages:** paste a page link or username and get the page ID, plus a Facebook page ID lookup with name and category.
- 👤 **Profiles:** get the profile ID from a profile link, or run a profile ID lookup from a username.
- 👥 **Groups:** paste a public group link to get the group ID.
- 🎬 **Videos and reels:** paste a video or reel link and read the video ID and its owner.
- 📷 **Photos:** paste a photo link to get the photo ID.
- 🔢 **Numeric IDs:** paste a number and get the canonical link and username back, a reverse ID lookup.
- 📚 **Long lists:** send hundreds of mixed inputs in one run and get one tidy table back.
- 🔗 **Share links:** paste a share link and see the real post, video or page behind it.
- 🧹 **Messy data:** collect links from anywhere, mix the formats, and get one clean ID for each.
- ✅ **List checks:** spot private or wrong links quickly from the status column.

***

### 📦 What data can Facebook URL to ID Finder extract?

Every row in the results table is one input. The fields are grouped below; each row holds only the fields that apply to its type, so a video row has video fields and a page row has page fields.

| Data | Fields |
|---|---|
| 🆔 IDs | `facebookId`, `pageId`, `profileId`, `groupId`, `postId`, `videoId`, `photoId` |
| 🔗 Input and link | `input`, `facebookUrl`, `url`, `type`, `username` |
| ✅ Status | `status`, `error` |
| 👤 Name and badges | `name`, `category`, `verified`, `description` |
| 📈 Page numbers | `followers`, `likes`, `talkingAboutThis`, `approximateFields` |
| 🌐 Web and ads | `websites`, `adsLibraryUrl` |
| 📷 Images | `profilePhoto`, `coverPhoto` |
| 👥 Groups | `groupPrivacy`, `groupMembers` |
| 🎬 Post and video | `ownerId`, `ownerName`, `ownerUrl`, `ownerPageId`, `text`, `createdAt`, `reactions`, `comments`, `shares`, `views`, `durationSec` |

Page rows add the Facebook page followers and category, and a lookup by number returns Facebook page details by ID.

> ❗ **Note:** Facebook shows some numbers rounded. The `approximateFields` list tells you which fields of a row are rounded. Fields Facebook does not show to visitors are left out, never guessed.

#### ❌ What can't Facebook URL to ID Finder extract?

- ❌ Content that needs a login, such as private profiles and private group posts.
- ❌ Links to general Facebook areas, for example the Groups or Watch home page, which do not point to one page, profile or post.
- ❌ Lists of posts, comments or reviews. This Actor returns the ID and details of each input only.

For emails, phone numbers and addresses of pages, try [Facebook Page Contact Info Scraper](https://apify.com/data_minds/facebook-page-contact-info-scraper). For page reviews, try [Facebook Review Scraper](https://apify.com/data_minds/facebook-review-scraper).

***

### 🚀 How to find a Facebook ID from a URL

Facebook URL to ID Finder is designed for an easy start, even if you have never extracted data from the web before.

1. 🔑 [Create a free Apify account](https://console.apify.com/sign-up) using your email.
2. 🌐 Open [Facebook URL to ID Finder](https://apify.com/data_minds/facebook-url-to-id) and go to the **Input** tab.
3. 📥 Paste your Facebook links, usernames or numeric IDs, one per line.
4. 🔧 Keep **Include details** on for names and numbers, or turn it off for lean rows with IDs only.
5. 🚀 Click **Start** and wait for the run to finish.
6. 📤 Open the **Output** tab to see the table, or download it as JSON, CSV, Excel, XML or HTML.

> 🚀 **Quick start:** the prefilled input contains four example inputs, so a first run is quick and cheap.

```json
{
  "urls": ["https://www.facebook.com/nintendo", "@nasa", "119240841493711"],
  "includeDetails": true
}
```

***

### 💰 How much does it cost to find Facebook IDs?

Facebook URL to ID Finder uses a pay per event model, with prices **from $0.0035 per result ($3.50 per 1,000 results)** on the Gold plan. You pay for each input that returns an ID. Inputs that cannot be resolved are saved with a status and an error text and are not charged. Apify platform usage is billed in addition.

| Apify plan | Price per result | Price per 1,000 results |
|---|---|---|
| 🆓 Free | $0.005 | $5.00 |
| 🥉 Bronze | $0.0045 | $4.50 |
| 🥈 Silver | $0.004 | $4.00 |
| 🥇 Gold | $0.0035 | $3.50 |

Each run also has one start event of $0.00005, which covers the default 1 GB of memory.

> ✅ **Good to know:** a row with the status `ok` or `partial` counts as a result. Rows with any other status are stored but never charged.

**What a run costs** (result price only, start event not included):

| Results | Free | Bronze | Silver | Gold |
|---|---|---|---|---|
| 100 | 100 x $0.005 = $0.50 | 100 x $0.0045 = $0.45 | 100 x $0.004 = $0.40 | 100 x $0.0035 = $0.35 |
| 1,000 | 1,000 x $0.005 = $5.00 | 1,000 x $0.0045 = $4.50 | 1,000 x $0.004 = $4.00 | 1,000 x $0.0035 = $3.50 |
| 10,000 | 10,000 x $0.005 = $50.00 | 10,000 x $0.0045 = $45.00 | 10,000 x $0.004 = $40.00 | 10,000 x $0.0035 = $35.00 |

#### 💰 Is finding Facebook IDs free?

You can start for free. The [Apify Free plan](https://apify.com/pricing) includes $5 of monthly credit. At the Free price of $0.005 per result, $5 / $0.005 = about 1,000 results before platform usage. Paid plans lower the price per result, as the table shows.

***

### 🔧 Input

Add the links, usernames or numeric IDs you want to resolve and choose how much detail you need. Set the input in the **Input** tab or send it as JSON through the API. Only the list of inputs is required.

| Field | Type | Default | What it does |
|---|---|---|---|
| `urls` | array of strings | none (required) | Facebook page, profile, group, post, video, reel or photo links, usernames such as `nintendo` or `@nasa`, or numeric IDs. Mix them freely. Each distinct input gives one row. |
| `includeDetails` | boolean | `true` | On: IDs plus name, category, followers, description, websites, photos and post or video details. Off: IDs, link, type, status, username and name only, for leaner rows. |
| `proxyConfiguration` | object | none | Optional network settings for the run. The defaults work for most runs. |

**Minimal input:**

```json
{
  "urls": ["https://www.facebook.com/nintendo"]
}
```

**Advanced input:** a page link, a video link, a username and a numeric ID in one run, with details on:

```json
{
  "urls": [
    "https://www.facebook.com/nintendo",
    "https://www.facebook.com/NintendoAmerica/videos/432168259120897/",
    "@nasa",
    "119240841493711"
  ],
  "includeDetails": true
}
```

The same input listed twice is looked up once and gives one row. Entries separated by commas or semicolons inside one line are split into separate inputs. See the [input tab](https://apify.com/data_minds/facebook-url-to-id/input-schema) for the full schema.

> 💡 **Tip:** Start with a handful of inputs to check the sample, then run your full list.

***

### 📤 Output

Results are stored in a dataset, which you can open in the **Output** or **Storage** tab. View them as a table or JSON, pick only the fields you need, and download them as JSON, CSV, Excel, XML or HTML. The table has ready-made views for the overview, all IDs, details, media and post or video fields.

Through the API, read the rows from this URL pattern:

```
https://api.apify.com/v2/datasets/<DATASET_ID>/items?format=json
```

Add `&view=overview` (or `ids`, `details`, `media`, `posts`) to get one of the views.

The fields of each result row:

| Field | Type | Description |
|---|---|---|
| `input` | string | The input exactly as you gave it. |
| `facebookUrl` | string | The input exactly as given (same value as `input`). |
| `url` | string | Canonical Facebook URL. |
| `type` | string | Kind of content: page, profile, group, post, video or photo. |
| `status` | string | `ok`, `partial`, `unavailable`, `login_required`, `blocked`, `invalid_input` or `error`. |
| `facebookId` | string | Main Facebook ID of the input: page ID for pages, user ID for profiles, and the group, post or video ID. |
| `pageId` | string | Linked public page ID. |
| `profileId` | string | Profile ID. |
| `groupId` | string | Group ID. |
| `postId` | string | Post ID. |
| `videoId` | string | Video ID. |
| `photoId` | string | Photo ID. |
| `username` | string | Public username. |
| `name` | string | Display name. |
| `approximateFields` | array | Fields whose number is rounded by Facebook. |
| `category` | string | Page category. |
| `verified` | boolean | True when the page has the verified badge. |
| `followers` | integer | Followers. |
| `likes` | integer | Likes. |
| `talkingAboutThis` | integer | People talking about this. |
| `description` | string | Description. |
| `websites` | array | Websites listed. |
| `profilePhoto` | string | Profile photo URL. |
| `coverPhoto` | string | Cover photo URL. |
| `adsLibraryUrl` | string | Link to the page in the Ads Library. |
| `groupPrivacy` | string | Group privacy. |
| `groupMembers` | integer | Group members. |
| `ownerId` | string | Owner ID of a post or video. |
| `ownerName` | string | Owner name. |
| `ownerUrl` | string | Owner URL. |
| `ownerPageId` | string | Owner page ID. |
| `text` | string | Post or video text. |
| `createdAt` | string | Creation time. |
| `reactions` | integer | Reactions. |
| `comments` | integer | Comments. |
| `shares` | integer | Shares. |
| `views` | integer | Views. |
| `durationSec` | number | Video length in seconds. |
| `error` | string | Why an input could not be resolved. |

An abridged example row for the video in the advanced input above:

```json
{
  "input": "https://www.facebook.com/NintendoAmerica/videos/432168259120897/",
  "type": "video",
  "status": "ok",
  "facebookId": "432168259120897",
  "postId": "5830990180318720",
  "videoId": "432168259120897",
  "ownerId": "100064368354094",
  "ownerName": "Nintendo of America",
  "ownerPageId": "119240841493711",
  "createdAt": "2022-11-18T17:00:09Z",
  "reactions": 765,
  "comments": 181,
  "views": 40914,
  "durationSec": 69.0
}
```

Every run also saves a short summary in the key-value store under the key `RUN_SUMMARY`:

| Field | Type | Description |
|---|---|---|
| `inputs` | integer | Number of distinct inputs in the run. |
| `rows` | integer | Results stored and charged. |
| `ok` | integer | Inputs that returned an ID. |
| `skipped` | integer | Results not stored because the spend limit was reached. |
| `failed` | integer | Inputs without an ID. See `status` and `error` in the dataset. |
| `seconds` | integer | Run time in seconds. |
| `spendLimitReached` | boolean | True when the run stopped early at your spend limit. |
| `message` | string | The final status message of the run. |

***

### 💡 Tips and advanced usage

#### 🔎 How to find Facebook page, group and video IDs

To find a Facebook page ID from a URL, paste the page link and read `facebookId`. For a Facebook group ID lookup or a Facebook profile ID lookup, paste the group or profile link.

To get the Facebook video ID from URL or a Facebook reel ID from URL, paste the video or reel link. A Facebook group ID from URL works the same way.

A Facebook numeric ID lookup takes a plain number and returns the canonical link, so a Facebook reverse ID lookup needs no extra setting. A Facebook share link to ID gives you the post, video or page behind it.

For a Facebook bulk ID lookup, paste your whole list and read the status column as a quick Facebook ID checker. To convert Facebook URL to ID for every row, run it once.

Whether you need a Facebook page ID finder or a Facebook group ID finder, the answer is in `facebookId`. It is a Facebook page ID lookup tool for one link or a long list.

#### ⚡ How to get faster or cheaper results

- ⚡ Turn off **Include details** when you only need IDs.
- 🧹 Remove duplicates and links that are not public before you run a long list.
- 🔎 Test a few inputs first, then raise the list size.

#### 📊 How to read the status column

`ok` means the ID was found. `partial` means a profile ID is returned but the classic page ID is not shown. `unavailable` means the content is deleted, private or the link is wrong. `login_required` means Facebook asks for a login. `invalid_input` means the entry is not a Facebook link, username or ID. `blocked` and `error` mean the page could not be loaded this time: run those inputs again later. Only `ok` and `partial` rows are charged.

#### 📦 How to export Facebook IDs to CSV

Open the **Output** tab, choose **Export** and select CSV to get your Facebook URL to ID table as a CSV file. The same menu offers JSON, Excel, XML and HTML.

#### 🧩 How to use it from Python, n8n, Zapier or Google Sheets

Developers can use it as a Facebook URL to ID Python helper with the Apify client shown below. No-code teams can add the Actor to an n8n workflow. A Zapier zap can run a Facebook ID lookup for every new row. Sheets users can send each new row for a Facebook ID lookup in Google Sheets.

#### 🔎 Why did I get fewer results than inputs?

The same input listed twice gives one row, and inputs without an ID are stored with a status but are not counted as results. Check the `status` and `error` fields of those rows, fix the links and run them again.

#### ❗ Known issues

- ❗ For a page, `facebookId` is the classic page ID and the profile behind it is in `profileId`. Personal profiles return the user ID as `facebookId`.
- ❗ Facebook rounds some follower and like counts. The `approximateFields` list shows which ones.
- ❗ Private profiles and private group posts show `unavailable` or `login_required` in `status`.

***

### 🔌 Integrations and API

#### 🔌 Can I use Facebook URL to ID Finder as an API?

Yes. Start runs, read results and schedule jobs through the Apify API. Use your token from **Settings > API & Integrations**.

| Action | Method and URL |
|---|---|
| 🚀 Start a run | `POST https://api.apify.com/v2/actors/data_minds~facebook-url-to-id/runs` |
| ⚡ Run and get the results in one call | `POST https://api.apify.com/v2/actors/data_minds~facebook-url-to-id/run-sync-get-dataset-items` |
| 📥 Read results of a run | `GET https://api.apify.com/v2/datasets/<DATASET_ID>/items?format=json` |
| 🔌 OpenAPI definition | `GET https://api.apify.com/v2/actors/data_minds~facebook-url-to-id/builds/default/openapi.json` |

**curl**

```bash
curl -X POST "https://api.apify.com/v2/actors/data_minds~facebook-url-to-id/run-sync-get-dataset-items" \
  -H "Authorization: Bearer <YOUR_APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://www.facebook.com/nintendo", "@nasa"], "includeDetails": true}'
```

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("data_minds/facebook-url-to-id").call(
    run_input={"urls": ["https://www.facebook.com/nintendo", "@nasa"], "includeDetails": True}
)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["input"], item["status"], item.get("facebookId"))
```

**JavaScript**

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

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('data_minds/facebook-url-to-id').call({
    urls: ['https://www.facebook.com/nintendo', '@nasa'],
    includeDetails: true,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

**CLI**

```bash
echo '{"urls": ["https://www.facebook.com/nintendo", "@nasa"], "includeDetails": true}' | apify call data_minds/facebook-url-to-id --silent --output-dataset
```

The one-call endpoint suits runs that finish in about five minutes. Use the start-a-run endpoint for longer jobs. More code is on the [API tab](https://apify.com/data_minds/facebook-url-to-id/api).

#### 🧩 Can I connect Facebook URL to ID Finder to other apps?

Yes. Connect it with Make, Zapier, n8n, Slack, Google Sheets, Google Drive, Airbyte, GitHub and more through [Apify integrations](https://apify.com/integrations). Use [webhooks](https://docs.apify.com/integrations/webhooks) to send new IDs to your team whenever a run finishes. Use [schedules](https://docs.apify.com/platform/schedules) to refresh your ID list every day or week.

#### 🤖 Can I use Facebook URL to ID Finder with AI agents (MCP server)?

Yes. AI agents can call it directly through the hosted [Apify MCP server](https://docs.apify.com/mcp). The **Server** tab of this Actor shows the same connection settings.

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

The hosted server signs you in with OAuth the first time you connect, so no API token belongs in this configuration. If your client cannot use OAuth, send the header `Authorization: Bearer <YOUR_APIFY_TOKEN>`.

***

### 🔗 Other Facebook scrapers

| Scraper | What it does |
|---|---|
| 🔗 [Facebook Page Contact Info Scraper](https://apify.com/data_minds/facebook-page-contact-info-scraper) | Get emails, phone numbers, websites, address, social links and follower counts from public Facebook pages. |
| 🔗 [Facebook Review Scraper](https://apify.com/data_minds/facebook-review-scraper) | Scrape public reviews from any Facebook page: reviewer, recommend or not, text, tags, photos, reactions, comments and the owner's reply, plus page recommend rate and followers. |

***

### ❓ FAQ

#### 🛡 Is it legal to find Facebook IDs from public links?

Web scraping is generally legal if you extract publicly available data. However, you should respect personal data, for example under GDPR, and intellectual property regulations, only collect personal data with a legitimate reason, and take Facebook's [Terms of Service](https://www.facebook.com/terms.php) into account before you run it.

#### 🔧 How does Facebook URL to ID Finder work?

You paste Facebook links, usernames or numeric IDs and press Start. For every input, the Actor reads what any visitor can see and returns one row with the type, the IDs and, if you keep details on, the name, numbers and post information. Inputs that cannot be resolved get a clear status and error text.

#### 🔌 Can I use Facebook URL to ID Finder as an API?

Yes. Start a run with the Apify API, pass your inputs as JSON, and read the dataset items when it finishes. A one-call endpoint returns results directly for short runs, and an OpenAPI definition is available. Ready-made curl, Python, JavaScript and CLI examples are in the Integrations and API section above.

#### 🤖 Can I use Facebook URL to ID Finder with AI agents (MCP server)?

Yes. Add the hosted Apify MCP server URL with the tools parameter set to data_minds/facebook-url-to-id, and your AI assistant can run the Actor and read the IDs. The first connection signs you in with OAuth. The Server tab of the Actor shows the same connection settings.

#### 🧩 Can I connect it to Google Sheets, Make or Zapier?

Yes. Apify integrations connect the Actor with Google Sheets, Make, Zapier, n8n, Slack and many other tools. Schedule a run, then use a webhook or an integration to send each new batch of IDs to your sheet, CRM or workflow automatically when the run finishes.

#### 🆔 What is the difference between a page ID and a profile ID?

A Facebook page has a classic page ID, returned in facebookId and used by the Graph API and the Ads Library, and a separate profile ID, returned in profileId. For personal profiles, the user ID is returned in facebookId. Group, post, video and photo inputs fill their own ID fields.

#### 🔎 Why did I get fewer results than inputs?

Duplicate inputs are looked up once and give one row. Inputs without an ID are saved with a status and an error text, but they are not counted as results and not charged. Open the dataset, filter on the status field, correct those links and run them again in a small batch.

#### 📊 Why do the numbers differ from what Facebook shows?

Facebook sometimes shows rounded follower and like counts, and the Actor returns the same rounded values. The approximateFields list tells you which fields of a row are rounded. Numbers also change over time, so a later run can show different counts than an earlier one.

#### ❗ Why is my input marked unavailable, or the Actor is not working?

The content may be deleted, private or login-only, or the link may be wrong. Open it in a private browser window: if you cannot see it there, the Actor cannot either. If the link is public and it still fails, report it on the [Issues tab](https://apify.com/data_minds/facebook-url-to-id/issues/open).

***

### 💬 Support and feedback

Found a bug or have a feature request? Please create an issue on the [Issues tab](https://apify.com/data_minds/facebook-url-to-id/issues/open).

Need a **custom solution** or more data? Contact us at hello.dataminds@gmail.com.

Built and maintained by [data_minds](https://apify.com/data_minds). This Actor is an independent tool and is not affiliated with, endorsed by or sponsored by Facebook or Meta.

# Changelog

This Actor's version history is a separate document: https://apify.com/data_minds/facebook-url-to-id/changelog.md

# Actor input Schema

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

Facebook page, profile, group, post, video, reel or photo links, plain usernames (nintendo, @nasa) or numeric IDs. Mix them freely. Each input gives one row.

## `includeDetails` (type: `boolean`):

On: IDs plus name, category, followers, description, websites, photos and post or video details. Off: IDs, canonical URL, type, status, username and name only, leaner rows.

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

Optional. The defaults work for most runs.

## Actor input object example

```json
{
  "urls": [
    "https://www.facebook.com/nintendo",
    "https://www.facebook.com/NintendoAmerica/videos/432168259120897/",
    "@nasa",
    "119240841493711"
  ],
  "includeDetails": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

No description

## `ids` (type: `string`):

No description

## `details` (type: `string`):

No description

## `media` (type: `string`):

No description

## `posts` (type: `string`):

No description

# 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/nintendo",
        "https://www.facebook.com/NintendoAmerica/videos/432168259120897/",
        "@nasa",
        "119240841493711"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("data_minds/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 = {
    "urls": [
        "https://www.facebook.com/nintendo",
        "https://www.facebook.com/NintendoAmerica/videos/432168259120897/",
        "@nasa",
        "119240841493711",
    ],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("data_minds/facebook-url-to-id").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/nintendo",
    "https://www.facebook.com/NintendoAmerica/videos/432168259120897/",
    "@nasa",
    "119240841493711"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call data_minds/facebook-url-to-id --silent --output-dataset

```

## MCP server setup

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

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/79YisNmv1GeuKxf0g/builds/rDT4ZlEHcC6TYU3zG/openapi.json
