# Facebook Profile Scraper (`dtrungtin/facebook-profile-scraper`) Actor

Facebook Profile Scraper extracts public information from any profile or page URL — **name, username, numeric user ID, profile picture, cover photo, bio, follower / friend / like counts, verification badge and category**

- **URL**: https://apify.com/dtrungtin/facebook-profile-scraper.md
- **Developed by:** [Tin](https://apify.com/dtrungtin) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.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.

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/docs.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.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/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 Profile Scraper

**Facebook Profile Scraper** extracts public information from any [Facebook](https://www.facebook.com) profile or page URL — **name, username, numeric user ID, profile picture, cover photo, bio, follower / friend / like counts, verification badge and category** — and returns it as clean, structured JSON. Point it at a profile such as `https://www.facebook.com/leomessi`, run it, and download the data as JSON, CSV, or Excel.

Running on the [Apify platform](https://apify.com) gives you API access, scheduling, ready-made integrations (Google Sheets, Zapier, Make, webhooks), automatic proxy rotation, and run monitoring out of the box.

### What does Facebook Profile Scraper do?

Give the Actor one or more Facebook profile/page URLs (or plain usernames) and it will open each page in a real browser, wait for it to render, and pull the available profile fields into a dataset. For each input it produces a single structured record. Optionally, it can also collect the most recent posts shown on the timeline.

It works on:

- **Personal profiles** — `https://www.facebook.com/leomessi`
- **Numeric-ID profiles** — `https://www.facebook.com/profile.php?id=100001234567890`
- **Pages** — `https://www.facebook.com/apify`
- **Bare usernames** — `leomessi`

### Why scrape Facebook profiles?

- **Lead generation & outreach** — enrich a list of profiles with names, categories, and follower counts.
- **Influencer research** — compare follower counts and verification status across creators.
- **Brand & competitor monitoring** — track how Pages describe themselves and grow over time.
- **Market research** — aggregate public profile metadata at scale for analysis.

### How to use Facebook Profile Scraper

1. Open the Actor and go to the **Input** tab.
2. Paste one or more profile URLs or usernames into **Facebook profile URLs or usernames**.
3. (Recommended) Choose **Residential** proxies under **Proxy configuration**.
4. (Optional) Paste **Session cookies** to scrape while logged in and unlock far more detail.
5. (Optional) Enable **Also scrape recent posts** and set a post limit.
6. Click **Start** and watch the results appear in the **Output** tab.
7. Export the dataset as JSON, CSV, Excel, or pull it through the [Apify API](https://docs.apify.com/api/v2).

### Input

The only input you need to provide is **`startUrls`** — the list of Facebook profiles or pages to scrape.

| Field       | Type  | Description                                                                                                                             |
| ----------- | ----- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `startUrls` | array | **Required.** Facebook profile/page URLs, `profile.php?id=…` URLs, or bare usernames (e.g. `leomessi`) to scrape. One item per profile. |

#### Example input

```json
{
    "startUrls": [{ "url": "https://www.facebook.com/leomessi" }, { "url": "https://www.facebook.com/apify" }]
}
````

### Output

Results are stored in the run's dataset. **You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.** Here is a representative item:

```json
{
    "url": "https://www.facebook.com/copperkettleyqr",
    "profileUrl": "https://www.facebook.com/copperkettleyqr/",
    "userId": "100064027242849",
    "username": "copperkettleyqr",
    "name": "The Copper Kettle Restaurant",
    "type": "page",
    "isVerified": false,
    "category": "Pizza place",
    "bio": "Longstanding local restaurant. Mediterranean specialties, signature gourmet pizzas.",
    "description": "The Copper Kettle Restaurant, Regina. 3,254 likes · 32 talking about this · 1,148 were here.",
    "profilePictureUrl": "https://scontent.xx.fbcdn.net/....jpg",
    "coverPhotoUrl": "https://scontent.xx.fbcdn.net/....jpg",
    "followerCount": 3200,
    "followingCount": 369,
    "friendCount": null,
    "likeCount": 3254,
    "address": "1953 Scarth Street, Regina, SK, Canada, Saskatchewan",
    "phone": "+1 306-525-3545",
    "email": "copperkettle.events@gmail.com",
    "website": "http://www.thecopperkettle.online/",
    "priceRange": "££",
    "hours": "Closed now",
    "rating": "94% recommend (201 reviews)",
    "services": ["Outdoor seating"],
    "socialLinks": [{ "platform": "instagram", "url": "https://www.instagram.com/copperkettleyqr" }],
    "externalLinks": ["https://www.instagram.com/copperkettleyqr", "http://www.thecopperkettle.online/"],
    "introItems": ["Page · Pizza place", "1953 Scarth Street, Regina, SK, Canada, Saskatchewan", "..."],
    "scrapedAt": "2026-07-19T10:00:00.000Z",
    "inputUrl": "https://www.facebook.com/copperkettleyqr/"
}
```

#### Data fields

| Field               | Description                                                     |
| ------------------- | --------------------------------------------------------------- |
| `url`               | Canonical profile URL.                                          |
| `profileUrl`        | The URL the browser actually landed on.                         |
| `userId`            | Numeric Facebook ID.                                            |
| `username`          | Vanity username (if the profile has one).                       |
| `name`              | Display name.                                                   |
| `type`              | `profile` or `page`.                                            |
| `isVerified`        | Whether the profile carries a verified badge.                   |
| `category`          | Page category (Pages only).                                     |
| `bio`               | Short bio / intro text (when available).                        |
| `description`       | Open Graph description snippet.                                 |
| `profilePictureUrl` | Profile picture image URL.                                      |
| `coverPhotoUrl`     | Cover photo image URL (when available).                         |
| `followerCount`     | Number of followers (rounded, as Facebook displays it).         |
| `followingCount`    | Number of accounts followed.                                    |
| `friendCount`       | Number of friends (personal profiles).                          |
| `likeCount`         | Number of likes (Pages).                                        |
| `address`           | Street address (Pages).                                         |
| `phone`             | Contact phone number.                                           |
| `email`             | Contact email address.                                          |
| `website`           | Website URL (unwrapped from Facebook's redirect).               |
| `priceRange`        | Price range indicator, e.g. `££` (Pages).                       |
| `hours`             | Opening-hours status, e.g. `Closed now`.                        |
| `rating`            | Recommendation / review summary text.                           |
| `work`              | Work entries from a person's About panel (array).               |
| `education`         | Education entries from a person's About panel (array).          |
| `about`             | Full typed About list: `[{ type, text }]` (work, education, …). |
| `services`          | Other Intro details (e.g. `Outdoor seating`).                   |
| `socialLinks`       | Linked social profiles: `[{ platform, url }]`.                  |
| `externalLinks`     | All outbound links found on the page.                           |
| `introItems`        | Raw, ordered text of every Intro/About row (nothing lost).      |
| `posts`             | Array of recent posts (only when `scrapePosts` is enabled).     |
| `scrapedAt`         | ISO timestamp of the scrape.                                    |
| `inputUrl`          | The original input URL/username.                                |

### Logged-out vs. authenticated scraping

Facebook shows **very little** to logged-out visitors and often presents a login wall. Without cookies you can still reliably get the public meta fields (name, username, user ID, profile picture, canonical URL) and sometimes follower counts, but detailed fields (bio, cover photo, friends, posts) are frequently unavailable.

To scrape full details, export your Facebook cookies with a browser extension such as **Cookie-Editor** or **EditThisCookie**, and paste the exported JSON array into the **Session cookies** input. Use a dedicated, disposable account — automated access can get an account rate-limited or restricted.

### How much does it cost to scrape Facebook?

Cost is driven by compute usage (the Actor runs a headless browser) and residential proxy traffic. A handful of profiles typically costs a small fraction of a compute unit. To keep runs cheap:

- Batch profiles into a single run rather than many tiny runs.

New Apify accounts include free monthly usage and proxy trial credits, which is enough to try the Actor out.

### Tips & advanced options

- **Always use residential proxies.** Facebook blocks datacenter IPs almost immediately.
- Provide session cookies for anything beyond basic public fields.
- If a profile returns only partial data, it is usually behind a login wall — add cookies and retry.
- Facebook changes its markup often; the Actor prefers stable Open Graph tags and degrades gracefully when a field can't be found (it returns `null` instead of failing).

### Related Actors you might like

Speed up your whole scraping workflow with these companion tools from the same developer:

- **[AI Dataset Search](https://apify.com/dtrungtin/ai-dataset-search)** — Search and explore your scraped datasets in plain English. Ask questions and instantly surface the profiles or records you need from the output of this and other Actors, without writing manual filters.
- **[AI Scraper Input Generator](https://apify.com/dtrungtin/ai-scraper-input-generator)** — Turn a plain-language description of what you want to scrape into a ready-to-run input configuration, so you can set up Actor runs in seconds instead of hand-editing JSON.

Together with **Facebook Profile Scraper**, they cover the full loop: generate the input, run the scrape, then search the results.

### FAQ, disclaimers & support

**Is scraping Facebook legal?** Scraping publicly available data is generally permissible in many jurisdictions, but Facebook's Terms of Service restrict automated access. You are responsible for how you use this Actor and the data it returns. Only collect public data, respect applicable laws (including data-protection laws such as GDPR/CCPA), and do not scrape or store personal data without a lawful basis.

**Why is some data missing?** Facebook heavily restricts logged-out access and frequently changes its page structure. Missing fields are returned as `null` rather than causing the run to fail. Adding session cookies and residential proxies significantly improves coverage.

**Does it scrape private profiles?** No. It only reads what the provided session is allowed to see.

**Found a bug or need a field that's missing?** Open an issue on the Actor's **Issues** tab. Custom scraping solutions can also be arranged.

# Actor input Schema

## `startUrls` (type: `array`):

List of Facebook profile pages to scrape. You can paste full URLs (e.g. https://www.facebook.com/leomessi), plain usernames (e.g. leomessi), or numeric-id URLs (e.g. https://www.facebook.com/profile.php?id=100001234567890).

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/leomessi"
    }
  ]
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://www.facebook.com/leomessi"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("dtrungtin/facebook-profile-scraper").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 = { "startUrls": [{ "url": "https://www.facebook.com/leomessi" }] }

# Run the Actor and wait for it to finish
run = client.actor("dtrungtin/facebook-profile-scraper").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 '{
  "startUrls": [
    {
      "url": "https://www.facebook.com/leomessi"
    }
  ]
}' |
apify call dtrungtin/facebook-profile-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Facebook Profile Scraper",
        "description": "Facebook Profile Scraper extracts public information from any profile or page URL — **name, username, numeric user ID, profile picture, cover photo, bio, follower / friend / like counts, verification badge and category**",
        "version": "0.0",
        "x-build-id": "23FXriFnGYhBmANQZ"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/dtrungtin~facebook-profile-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-dtrungtin-facebook-profile-scraper",
                "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/dtrungtin~facebook-profile-scraper/runs": {
            "post": {
                "operationId": "runs-sync-dtrungtin-facebook-profile-scraper",
                "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/dtrungtin~facebook-profile-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-dtrungtin-facebook-profile-scraper",
                "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",
                "required": [
                    "startUrls"
                ],
                "properties": {
                    "startUrls": {
                        "title": "Facebook profile URLs or usernames",
                        "type": "array",
                        "description": "List of Facebook profile pages to scrape. You can paste full URLs (e.g. https://www.facebook.com/leomessi), plain usernames (e.g. leomessi), or numeric-id URLs (e.g. https://www.facebook.com/profile.php?id=100001234567890).",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
