# Facebook Pages Scraper (`barefoot_grade/facebook-pages-scraper`) Actor

Collect public Facebook page profiles from page links or usernames: exact follower count, category, intro, website, email and phone when listed, profile and cover images, verified badge, and the latest post with its reaction, comment and share counts. You only pay for pages delivered.

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

## Pricing

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

## Facebook Pages Scraper

Turn a list of Facebook page links or usernames into clean page profiles. Every page becomes one row with its exact follower count, category, intro text, the website, email, phone and address it lists, profile and cover images, the verified badge, and its latest post with reaction, comment and share counts. Local businesses also return their price range, services, review score and map coordinates when the page shows them.

No Facebook account, login or cookies are needed. You only pay for pages that are actually delivered.

### Use cases

- **Lead lists:** collect the public email, phone, website and address of brands, shops and venues.
- **Competitor and brand tracking:** follow exact follower counts, "talking about this" and check-ins over time.
- **Influencer and media research:** compare audience size and recent engagement across many pages.
- **Data enrichment:** add category, verified status and links to a list of Facebook pages you already have.

### Quick Start

```json
{
  "startUrls": [
    "https://www.facebook.com/nike",
    "https://www.facebook.com/NASA",
    "katzsdeli"
  ],
  "maxPages": 20
}
```

Page links, bare usernames, `profile.php?id=` links and numeric page IDs all work. Mobile links (`m.facebook.com`) and links to a page's sub-tabs or posts are reduced to the page itself, and duplicates are returned once.

### Input

| Input | Type | Default | Meaning |
| --- | --- | --- | --- |
| `startUrls` | array | required | Facebook page links, usernames or numeric page IDs. One row per page. |
| `maxPages` | integer | `20` | Cap on the number of pages read in this run. |
| `proxyConfiguration` | object | Apify proxy, United States | Where requests come from. The default suits almost every page; change the country if you need pages as seen from elsewhere. |
| `residentialFallback` | boolean | `true` | Pages that keep refusing anonymous visitors are retried on a residential address for their last attempts. Turn off to stay strictly on the proxy chosen above. |

### What it returns

The dataset contains one row per page:

| Field | Meaning |
| --- | --- |
| `pageId`, `profileId`, `url`, `username` | Page identity and its canonical link. |
| `name`, `category`, `categories` | Page name and category as shown on the page. |
| `followers`, `likes`, `following` | Exact counts (likes only for pages that still show them). |
| `talkingAbout`, `wereHere` | People talking about the page and check-ins. |
| `intro`, `description` | The page's intro text and short description. |
| `email`, `phone`, `website`, `websites`, `address` | Contact details listed in the page's intro. |
| `latitude`, `longitude` | Coordinates of the listed address, when there is one. |
| `priceRange`, `services`, `recommendPercent`, `reviewCount` | Business details for shops, restaurants and venues. |
| `socialLinks` | Other accounts linked from the page, such as Instagram. |
| `responsibleEntity` | The organisation listed as responsible for the page. |
| `introItems` | Every intro line as shown, with its type, for anything not covered above. |
| `verified` | Whether the page shows the verified badge. |
| `profilePictureUrl`, `coverPhotoUrl` | Profile picture and cover photo links. |
| `latestPosts` | The first post Facebook includes on the page itself, normally the newest: `postId`, `url`, `text`, `createdAt`, `mediaTypes`, `reactions`, `comments`, `shares`, `videoViews` and a per-reaction `reactionBreakdown`. |
| `input`, `scrapedAt` | The link you supplied and the collection time (UTC, ISO 8601). |
| `error` | Always `null` in the dataset. Failures are reported in the run summary instead. |

Fields the page does not show are `null` (or an empty list). The run summary (`OUTPUT`) reports `pages` (rows delivered), `errors` and the failed pages at `pageErrors`.

### Example queries

- Brand pages: `nike`, `cocacola`, `starbucks`
- Media and public bodies: `https://www.facebook.com/NASA`, `https://www.facebook.com/bbcnews`
- Local businesses: `https://www.facebook.com/katzsdeli`
- Pages without a username: `https://www.facebook.com/profile.php?id=100064470440594`

### Output example

```json
{
  "pageId": "15087023444",
  "profileId": "100044541544829",
  "url": "https://www.facebook.com/nike",
  "username": "nike",
  "name": "Nike",
  "category": "Sportswear Store",
  "categories": ["Sportswear Store"],
  "followers": 39500692,
  "likes": null,
  "following": 24,
  "talkingAbout": 140904,
  "wereHere": 18567,
  "intro": null,
  "description": "Just Do It.",
  "email": null,
  "phone": "+972 54-292-7777",
  "website": "http://nike.com/",
  "websites": ["http://nike.com/"],
  "address": null,
  "latitude": null,
  "longitude": null,
  "priceRange": null,
  "recommendPercent": null,
  "reviewCount": null,
  "services": [],
  "socialLinks": [],
  "responsibleEntity": "NIKE, Inc.",
  "introItems": [
    {"type": "influencer_category", "text": "Page · Sportswear Store"},
    {"type": "confirmed_owner_label", "text": "NIKE, Inc.", "subtitle": "is responsible for this Page"},
    {"type": "profile_phone", "text": "+972 54-292-7777"},
    {"type": "website", "text": "nike.com", "url": "http://nike.com/"}
  ],
  "verified": true,
  "profilePictureUrl": "https://scontent.xx.fbcdn.net/v/t39.30808-1/284964043_10159903868513445_7696353984967674128_n.jpg",
  "coverPhotoUrl": "https://scontent.xx.fbcdn.net/v/t39.30808-6/285211224_10159903868008445_5477337468887983165_n.png",
  "latestPosts": [
    {
      "postId": "1393461115481927",
      "url": "https://www.facebook.com/reel/2166091230582141/",
      "text": "Leave your limits at the surface. #JustDoIt",
      "createdAt": "2025-09-15T16:01:59+00:00",
      "mediaTypes": ["video"],
      "reactions": 8372,
      "comments": 2686,
      "shares": 1179,
      "videoViews": 508812,
      "reactionBreakdown": {"like": 6919, "love": 1199, "care": 137, "wow": 45, "angry": 36, "haha": 32, "sad": 4}
    }
  ],
  "input": "nike",
  "scrapedAt": "2026-10-19T22:30:54+00:00",
  "error": null
}
```

### Failed pages

A page that cannot be read is listed in the run summary at `OUTPUT.pageErrors` with its link, a `code` and a `message`:

- `NOT_FOUND`: the page does not exist or was removed.
- `LOGIN_WALL`: Facebook only shows this page to logged-in visitors (age- or country-restricted pages, some personal profiles), or kept refusing anonymous visits.
- `SOURCE_CHANGED`: the page loaded but did not have the expected layout.

Failed pages are never dataset rows and are not charged. A run in which every page fails exits with an error instead of finishing green with an empty dataset.

### Limits and caveats

- Only public pages are supported. Groups, events, Marketplace and private personal profiles are not.
- `latestPosts` holds the first post Facebook includes on the page itself, normally the newest; on pages with a pinned post this may be the pinned one. For a page's full post history, use a dedicated posts scraper.
- Follower, "talking about this" and check-in counts are exact. Reaction, comment and share counts are those shown at collection time.
- Contact details appear only when the page lists them publicly.
- Automated access is subject to Facebook's terms; use this actor only where you have the necessary permissions and a lawful basis, especially for contact details of individuals.

### FAQ

**Do I need a Facebook account?** No. Pages are read the way any visitor who is not logged in sees them.

**Why is a page missing from my results?** Check `OUTPUT.pageErrors`. Most often the page was renamed, removed, or is restricted to logged-in visitors.

**Can I pass a link to a post or a page's About tab?** Yes. The actor reads the page that the link belongs to.

### Price

**$0.006 per page** delivered, plus **$0.005 per run start**. The run-start event is charged per GB of memory; the default 512 MB run is one start event. The start is charged even if the run saves no results. Failed pages are not charged. Platform usage is included in these prices.

# Actor input Schema

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

Page links (https://www.facebook.com/nike), usernames (nike), profile.php?id= links or numeric page ids. Duplicates are removed.

## `maxPages` (type: `integer`):

Cap on the number of pages read in this run. Pages beyond the cap are skipped.

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

Facebook shows a login wall to visitors who load many pages from one address, so every attempt uses a fresh address from this pool. The default Apify datacenter pool in the United States works for most pages.

## `residentialFallback` (type: `boolean`):

When the datacenter pool keeps getting the login wall for a page, the last two attempts for that page use an Apify residential address in the same country. Turn off to use only the proxy chosen above.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.facebook.com/nike",
    "https://www.facebook.com/NASA"
  ],
  "maxPages": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyCountry": "US"
  },
  "residentialFallback": true
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "startUrls": [
        "https://www.facebook.com/nike",
        "https://www.facebook.com/NASA"
    ],
    "maxPages": 20,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyCountry": "US"
    },
    "residentialFallback": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("barefoot_grade/facebook-pages-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": [
        "https://www.facebook.com/nike",
        "https://www.facebook.com/NASA",
    ],
    "maxPages": 20,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyCountry": "US",
    },
    "residentialFallback": True,
}

# Run the Actor and wait for it to finish
run = client.actor("barefoot_grade/facebook-pages-scraper").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 '{
  "startUrls": [
    "https://www.facebook.com/nike",
    "https://www.facebook.com/NASA"
  ],
  "maxPages": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyCountry": "US"
  },
  "residentialFallback": true
}' |
apify call barefoot_grade/facebook-pages-scraper --silent --output-dataset

```

## MCP server setup

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

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/Hypgrfadh2ht7fTZS/builds/rEpViefhP9S2lVNoV/openapi.json
