# FB Profile Scraper (`devwithbobby/fb-profile-scraper`) Actor

Scrape data from any public FB Profile

- **URL**: https://apify.com/devwithbobby/fb-profile-scraper.md
- **Developed by:** [Dev with Bobby](https://apify.com/devwithbobby) (community)
- **Categories:** Social media, Lead generation, Integrations
- **Stats:** 774 total users, 64 monthly users, 99.5% runs succeeded, 12 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / result

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.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 Profile & Page Scraper

Extract comprehensive Facebook profile and page data with a single click. Enter usernames or URLs and get structured data including followers, likes, contact information, and engagement metrics.

### Features

- **Flexible Input** - Accepts usernames, full URLs, or mixed formats
- **Complete Profile Data** - Name, bio, followers, likes, categories, verification status
- **Contact Information** - Email, phone, website, address when available
- **Visual Assets** - Profile pictures and cover photos
- **Engagement Metrics** - Calculated engagement rates and audience size categories
- **Anti-Detection** - Session management, proxy rotation, rate limiting

### Quick Start

#### Step 1: Enter Profiles

Paste Facebook usernames or URLs (one per line):

````

nasaearth
ChrisBrecheensWritingAboutWriting
https://www.facebook.com/UNclimatechange
facebook.com/some-company

```

#### Step 2: Run the Actor

Click **Start** and wait for extraction to complete.

#### Step 3: Download Results

Get your data as JSON, CSV, or Excel from the **Storage** tab.

### Input Options

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `profiles` | String | (required) | Facebook usernames or URLs, one per line |
| `proxyType` | String | `BUYPROXIES94952` | Proxy type: Datacenter, Residential, or Static US |
| `maxConcurrency` | Integer | `2` | Parallel pages (1-5) |
| `maxRequestsPerMinute` | Integer | `15` | Rate limit (5-30) |
| `cookies` | String | (optional) | Facebook session cookies for authenticated scraping |

#### Supported Input Formats

All of these formats work:

```

nasaearth
NASA Earth
https://www.facebook.com/nasaearth
facebook.com/nasaearth
www.facebook.com/nasaearth/

````

### Output

#### Sample Output

```json
{
  "inputUrl": "https://www.facebook.com/nasaearth",
  "scrapedUrl": "https://www.facebook.com/nasaearth",
  "profileType": "page",
  "name": "NASA Earth",
  "username": "nasaearth",
  "facebookId": "123456789",
  "verified": true,
  "followers": 10921894,
  "likes": 10505363,
  "about": "Explore and learn more about our home planet.",
  "categories": ["Science Website"],
  "profilePicture": "https://scontent.xx.fbcdn.net/...",
  "coverPhoto": "https://scontent.xx.fbcdn.net/...",
  "email": "contact@nasa.gov",
  "website": "science.nasa.gov/earth",
  "engagementRatio": "0.962",
  "audienceSize": "Large (1M+)",
  "isComplete": true,
  "scrapedAt": "2026-01-26T12:30:45.123Z"
}
````

#### Output Fields

| Field | Type | Description |
|-------|------|-------------|
| `inputUrl` | String | Original URL/username provided |
| `scrapedUrl` | String | Final URL after redirects |
| `profileType` | String | `page`, `profile`, or `unknown` |
| `name` | String | Display name |
| `username` | String | Facebook username/handle |
| `facebookId` | String | Numeric Facebook ID |
| `verified` | Boolean | Official verification status |
| `followers` | Integer | Number of followers |
| `likes` | Integer | Number of page likes |
| `about` | String | Bio/description |
| `categories` | Array | Page categories |
| `profilePicture` | String | Profile image URL |
| `coverPhoto` | String | Cover image URL |
| `email` | String | Contact email (if available) |
| `phone` | String | Contact phone (if available) |
| `website` | String | Website URL (if available) |
| `address` | String | Physical address (if available) |
| `engagementRatio` | String | Likes-to-followers ratio |
| `audienceSize` | String | Size category (Micro/Small/Medium/Large) |
| `isComplete` | Boolean | Whether all data was extracted |
| `wasBlocked` | Boolean | Whether extraction was blocked |

### Authentication (Optional)

For higher success rates, provide your Facebook session cookies:

1. Log into Facebook in your browser
2. Install the **Cookie-Editor** browser extension
3. Click the extension icon on facebook.com
4. Click **Export** > **Export as JSON**
5. Paste the JSON array in the `cookies` field

#### Cookie Format

```json
[
  {"name": "c_user", "value": "YOUR_USER_ID", "domain": ".facebook.com"},
  {"name": "xs", "value": "YOUR_SESSION", "domain": ".facebook.com"}
]
```

### Proxy Options

| Option | Description | Best For |
|--------|-------------|----------|
| `BUYPROXIES94952` | Datacenter proxies (default) | Cost-effective general scraping |
| `RESIDENTIAL` | Residential proxies | Higher success rate, premium cost |
| `StaticUS3` | Static US IPs | Consistent identity across requests |

### Use Cases

#### Marketing & Social Media

- Competitor analysis and benchmarking
- Influencer research and discovery
- Campaign planning and audience research
- Brand monitoring

#### Business Intelligence

- Lead generation and prospecting
- Market research
- Partnership research
- Content strategy analysis

#### Research & Analysis

- Academic social media research
- Market trend analysis
- Communication studies

### Technical Details

#### Anti-Detection Measures

- **Session Pool** - Rotates sessions to avoid fingerprinting
- **Proxy Rotation** - Distributes requests across IPs
- **Rate Limiting** - Configurable request throttling
- **Random Delays** - Human-like timing between requests
- **Login Popup Dismissal** - Handles Facebook modals automatically

#### Limitations

- **Public data only** - Cannot access private profiles
- **Rate limits** - Facebook may block after many requests
- **Login walls** - Some pages trigger login requirements
- **Dynamic content** - Some data may not be available on all pages

#### Best Practices

1. **Keep concurrency low** (1-2) to avoid blocks
2. **Use residential proxies** for difficult pages
3. **Provide cookies** for authenticated access
4. **Space out runs** to avoid IP blocks

### Cost Estimation

- Datacenter proxy: ~$0.25 per 1000 requests
- Residential proxy: ~$12.50 per 1000 requests
- Compute: ~$0.10 per 100 profiles

### Error Handling

The scraper handles common issues gracefully:

- **Blocked profiles** - Marked with `wasBlocked: true`
- **Private profiles** - Returns available public data
- **Invalid URLs** - Skipped with error message
- **Timeouts** - Automatic retry with new session

### Support

For issues or feature requests, contact the author or open an issue on the Actor's page.

# Actor input Schema

## `profiles` (type: `string`):

Enter Facebook profiles to extract data from. You can use:
• Just usernames: nasaearth
• Full URLs: https://www.facebook.com/nasaearth
• Mix both formats (one per line)

Examples:
nasaearth
ChrisBrecheensWritingAboutWriting
https://www.facebook.com/UNclimatechange

## `proxyType` (type: `string`):

Select the proxy type to use. Datacenter is cost-effective for most scraping. Use RESIDENTIAL only if you experience high block rates.

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

Maximum number of pages to scrape in parallel. Keep low (1-3) to avoid Facebook blocks.

## `maxRequestsPerMinute` (type: `integer`):

Rate limit for requests. Keep low (10-20) to avoid triggering Facebook's anti-bot measures.

## `cookies` (type: `string`):

Optional: Paste your Facebook cookies as JSON array for authenticated scraping. This allows access to more profile data.

Format: \[{"name": "c\_user", "value": "...", "domain": ".facebook.com"}, ...]

You can export cookies using browser extensions like 'Cookie-Editor' or 'EditThisCookie'.

## Actor input object example

```json
{
  "profiles": "nasaearth\nNASA",
  "proxyType": "BUYPROXIES94952",
  "maxConcurrency": 2,
  "maxRequestsPerMinute": 15
}
```

# Actor output Schema

## `overview` (type: `string`):

Quick overview of scraped profiles with key metrics

## `contact` (type: `string`):

Email, phone, website and address for each profile

## `detailed` (type: `string`):

Full data for all scraped profiles

## `allData` (type: `string`):

Complete raw JSON data

## `summary` (type: `string`):

Statistics about the scraping run

# 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 = {
    "profiles": `nasaearth
NASA`
};

// Run the Actor and wait for it to finish
const run = await client.actor("devwithbobby/fb-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 = { "profiles": """nasaearth
NASA""" }

# Run the Actor and wait for it to finish
run = client.actor("devwithbobby/fb-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 '{
  "profiles": "nasaearth\\nNASA"
}' |
apify call devwithbobby/fb-profile-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "FB Profile Scraper",
        "description": "Scrape data from any public FB Profile",
        "version": "0.0",
        "x-build-id": "m63c63pNilYpwybtb"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/devwithbobby~fb-profile-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-devwithbobby-fb-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/devwithbobby~fb-profile-scraper/runs": {
            "post": {
                "operationId": "runs-sync-devwithbobby-fb-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/devwithbobby~fb-profile-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-devwithbobby-fb-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": [
                    "profiles"
                ],
                "properties": {
                    "profiles": {
                        "title": "Facebook Profiles",
                        "type": "string",
                        "description": "Enter Facebook profiles to extract data from. You can use:\n• Just usernames: nasaearth\n• Full URLs: https://www.facebook.com/nasaearth\n• Mix both formats (one per line)\n\nExamples:\nnasaearth\nChrisBrecheensWritingAboutWriting\nhttps://www.facebook.com/UNclimatechange"
                    },
                    "proxyType": {
                        "title": "Proxy Type",
                        "enum": [
                            "BUYPROXIES94952",
                            "RESIDENTIAL",
                            "StaticUS3"
                        ],
                        "type": "string",
                        "description": "Select the proxy type to use. Datacenter is cost-effective for most scraping. Use RESIDENTIAL only if you experience high block rates.",
                        "default": "BUYPROXIES94952"
                    },
                    "maxConcurrency": {
                        "title": "Max Concurrency",
                        "minimum": 1,
                        "maximum": 5,
                        "type": "integer",
                        "description": "Maximum number of pages to scrape in parallel. Keep low (1-3) to avoid Facebook blocks.",
                        "default": 2
                    },
                    "maxRequestsPerMinute": {
                        "title": "Max Requests Per Minute",
                        "minimum": 5,
                        "maximum": 30,
                        "type": "integer",
                        "description": "Rate limit for requests. Keep low (10-20) to avoid triggering Facebook's anti-bot measures.",
                        "default": 15
                    },
                    "cookies": {
                        "title": "Facebook Cookies (Optional)",
                        "type": "string",
                        "description": "Optional: Paste your Facebook cookies as JSON array for authenticated scraping. This allows access to more profile data.\n\nFormat: [{\"name\": \"c_user\", \"value\": \"...\", \"domain\": \".facebook.com\"}, ...]\n\nYou can export cookies using browser extensions like 'Cookie-Editor' or 'EditThisCookie'."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
