# Facebook Pages, Reviews & Comments (`prooflio/facebook-pages-reviews-comments`) Actor

All-in-one Facebook collector: page info, reviews (recommendations) and comments via the official Graph API for owned pages, or a delegated Store scraper for public pages. Unified, GDPR-aware output.

- **URL**: https://apify.com/prooflio/facebook-pages-reviews-comments.md
- **Developed by:** [Prooflio AI](https://apify.com/prooflio) (community)
- **Categories:** AI, Automation, Social media
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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, Reviews & Comments

An all-in-one Facebook collector that returns **page info, reviews (recommendations), and comments** in one unified, GDPR-aware schema — from either the official Facebook Graph API (for pages you own or manage) or a delegated Store scraper (for public pages).

This Actor is an **intelligence layer**, not another raw scraper: it normalizes, de-duplicates, and (optionally) anonymizes data from two very different sources into a single clean shape your app or BI tools can consume directly.

### Two backends, two risk profiles

| Backend | Use for | How it works | Compliance |
|---|---|---|---|
| **Graph API** (`graph`) | Pages your users own/manage | Official `GET /{page}/ratings` and `/{object}/comments` with a Page access token (`pages_read_user_content`) obtained via OAuth | ToS-compliant, reliable, no proxies |
| **Delegated scraper** (`scrape`) | Public pages you don't manage | Forwards your input to a maintained Store scraper via `Actor.call`, then normalizes its output | You choose the scraper and accept responsibility for scraping public data |

For a SaaS, the **Graph API path is strongly preferred**: your customer connects their own Facebook Page, and you read their data with their consent. It doesn't break when Facebook changes its frontend, needs no residential proxies, and sidesteps the Terms-of-Service and CFAA-style exposure that comes with scraping logged-in or public data you weren't authorized to collect.

### Input

```json
{
    "backend": "graph",
    "pages": ["123456789012345"],
    "collectPageInfo": true,
    "collectReviews": true,
    "collectComments": false,
    "graphAccessToken": "<page-access-token>",
    "anonymizeReviewers": false,
    "maxItemsPerTarget": 100
}
```

Delegated-scraper example:

```json
{
    "backend": "scrape",
    "scraperActorId": "apify/facebook-reviews-scraper",
    "scraperInput": { "startUrls": [{ "url": "https://www.facebook.com/SomePublicPage/reviews" }] },
    "scrapeItemType": "review",
    "anonymizeReviewers": true
}
```

Key fields: `backend`, `pages`, `postUrls` (object IDs for comments), `collectPageInfo/Reviews/Comments`, `graphAccessToken` (secret), `graphApiVersion`, `scraperActorId` + `scraperInput`, `maxItemsPerTarget`, and `anonymizeReviewers`.

### Output

One unified item per page / review / comment. Note that modern Facebook reviews are **positive/negative recommendations, not 1–5 stars** — `recommendation` is the primary field; `rating` is legacy and usually null.

```json
{
    "type": "review",
    "backend": "graph",
    "pageId": "123456789012345",
    "recommendation": "positive",
    "rating": null,
    "text": "Excellent service, highly recommend.",
    "createdAt": "2026-01-01T00:00:00+0000",
    "reviewerName": "Jane D.",
    "likes": null,
    "permalink": null
}
```

### Privacy & GDPR

Reviews and comments contain personal data. Set `anonymizeReviewers: true` to hash reviewer/commenter names and drop their profile IDs when you don't have a lawful basis to store identifiers. You remain the data controller for anything this Actor outputs; document your lawful basis and retention policy.

### Running locally

```bash
npm install
apify run        # reads storage/key_value_stores/default/INPUT.json
```

Deploy with `apify push`.

### Acceptable use

The Graph API backend accesses only data the authorizing Page owner has granted via OAuth. The delegated-scraper backend runs a separate Actor of your choosing; automated access to Facebook is restricted by Facebook's Terms of Service, and you are responsible for ensuring your use of any scraper complies with those terms, applicable law (including GDPR/CCPA), and copyright. This Actor does not bypass authentication, manage Facebook credentials, or use fake accounts.

# Actor input Schema

## `backend` (type: `string`):

How to collect data. 'graph' uses the official Facebook Graph API (compliant; for pages you own/manage). 'scrape' delegates to a maintained Store scraper for public pages.

## `pages` (type: `array`):

Facebook Page IDs or usernames to fetch page info and reviews for (Graph backend).

## `postUrls` (type: `array`):

Facebook object IDs (posts, photos, videos) to fetch comments for (Graph backend).

## `collectPageInfo` (type: `boolean`):

Fetch page-level details (name, category, fan count, overall rating).

## `collectReviews` (type: `boolean`):

Fetch reviews (positive/negative recommendations) for each page.

## `collectComments` (type: `boolean`):

Fetch comments for each object ID listed in 'Post / object IDs'.

## `anonymizeReviewers` (type: `boolean`):

Replace reviewer/commenter names with a stable hash and drop their profile IDs. Use when you do not have a lawful basis to store personal identifiers.

## `maxItemsPerTarget` (type: `integer`):

Cap on reviews/comments fetched per page or object.

## `graphAccessToken` (type: `string`):

Page access token with pages_read_user_content (Graph backend). Obtained via OAuth from the page owner.

## `graphApiVersion` (type: `string`):

Facebook Graph API version. Bump as Meta releases new versions.

## `scraperActorId` (type: `string`):

Store Actor to delegate public scraping to, e.g. 'apify/facebook-reviews-scraper' (scrape backend).

## `scraperInput` (type: `object`):

Input object forwarded as-is to the delegated scraper. Use that scraper's own input schema.

## `scrapeItemType` (type: `string`):

How to normalize the delegated scraper's output.

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

Forwarded to the delegated scraper if it accepts a proxyConfiguration field.

## Actor input object example

```json
{
  "backend": "graph",
  "collectPageInfo": true,
  "collectReviews": true,
  "collectComments": false,
  "anonymizeReviewers": false,
  "maxItemsPerTarget": 100,
  "graphApiVersion": "v21.0",
  "scraperInput": {},
  "scrapeItemType": "review",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

All collected items in the default dataset (Overview view).

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("prooflio/facebook-pages-reviews-comments").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("prooflio/facebook-pages-reviews-comments").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 '{}' |
apify call prooflio/facebook-pages-reviews-comments --silent --output-dataset

```

## MCP server setup

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

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/Ytee6CuprlKDRrbEK/builds/7NMZs77grqFSaagmK/openapi.json
