Alfalfa

Facebook scraper API: posts, comments, pages, events and ads as JSON

Five endpoints for public Facebook data, hosted on Apify and called like any REST API: token, JSON in, JSON out, pagination, webhooks, schedules. They read what a signed-out visitor sees, need no Facebook account or app review, and return the field names of the official Apify scrapers. This page is the overview; each endpoint has its own reference.

Updated September 2026. Endpoint hosted on Apify; an Apify account and API token are the only requirements.

What the Graph API gives you today

Meta's Graph API serves the assets you own. Reading other pages' posts, comments or contact details, searching events, or listing commercial ads needs features granted after app review (Page Public Content Access, Page Public Metadata Access, the Ad Library API's identity check) that most developers never obtain, and public event search was removed altogether. These endpoints exist for everything the Graph API will not give you.

The endpoint

One HTTP call. The synchronous form waits for the run and returns the records in the same response (fine for up to a few minutes of work); the asynchronous form returns a run id at once and you read the dataset when it has finished, with webhooks if you want a callback.

Synchronous

curl -X POST "https://api.apify.com/v2/acts/alfalfa~facebook-posts-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN&format=json" \
  -H 'Content-Type: application/json' \
  -d '{"startUrls": [{"url": "https://www.facebook.com/humansofnewyork"}], "resultsLimit": 20}'

Asynchronous

# start the run (returns immediately with the run id and dataset id)
curl -X POST "https://api.apify.com/v2/acts/alfalfa~facebook-posts-scraper/runs?token=$APIFY_TOKEN" \
  -H 'Content-Type: application/json' -d '{"startUrls": [{"url": "https://www.facebook.com/humansofnewyork"}], "resultsLimit": 20}'
# read the results when the run has finished (JSON, CSV or XLSX; paginate with offset and limit)
curl "https://api.apify.com/v2/datasets/<defaultDatasetId>/items?token=$APIFY_TOKEN&format=json&offset=0&limit=1000"

Python

from apify_client import ApifyClient  # pip install apify-client

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("alfalfa/facebook-posts-scraper").call(run_input={
  "startUrls": [
    {
      "url": "https://www.facebook.com/humansofnewyork"
    }
  ],
  "resultsLimit": 20
})
items = list(client.dataset(run.default_dataset_id).iterate_items())
print(len(items), items[0])

JavaScript

import { ApifyClient } from 'apify-client'; // npm install apify-client

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('alfalfa/facebook-posts-scraper').call({"startUrls": [{"url": "https://www.facebook.com/humansofnewyork"}], "resultsLimit": 20});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.length, items[0]);

Request fields

FieldTypeMeaning
startUrls / searchQueries / pageIdsarrayWhat to read: URLs, keywords or page IDs, depending on the endpoint.
resultsLimit / maxEvents / maxAdsintegerHow many records per input.
filtersvariousDate ranges, country, status, media type, comment mode, add-ons such as organizer email, About text, video transcript, ad details.
proxyConfigurationobjectResidential proxies by default, included in the price; your own proxies optional.

Response fields

One JSON object per record. Field names are the ones the official Apify Actor uses, so code written for it works unchanged.

FieldMeaning
postspostId, text, time, likes, comments, shares, media, reaction split
commentscommentId, text, date, profileName, likesCount, threadingDepth, parent links
pagestitle, email, phone, website, address, likes, followers, rating, about_me
eventsname, utcStartDate, location with coordinates, ticketsInfo, usersGoing, organizerEmail
adsadArchiveID, pageName, isActive, dates, snapshot with creative, CTA and link, ad_details with EU reach

The five endpoints

DataActorReturnsPer 1,000
Postsalfalfa/facebook-posts-scraperposts of any public page or profile with reactions, comments, shares, media$2
Commentsalfalfa/facebook-comments-scrapercomments and reply threads of any public post$0.50
Pagesalfalfa/facebook-pages-scraperpage details with email, phone, website, address, followers, rating$3.50
Eventsalfalfa/facebook-events-scraperevents by keyword, city, page or URL, with organizer email$5
Ad Libraryalfalfa/facebook-ads-library-scraperads by keyword, advertiser page or URL, with creatives and EU reach$0.50

Every endpoint takes the same shape of call: POST the input JSON to /v2/acts/alfalfa~<actor>/runs (or the run-sync-get-dataset-items variant), read the dataset. Field names match the official Apify Actors for each surface, so switching is a one-word change.

Limits, pagination, scheduling

Pricing

From $0.50 per 1,000 records (comments, ads) to $5 per 1,000 (events), no start fees. Platform usage and residential proxies are included; you pay only for records written to the dataset. The Apify free plan includes $5 of usage a month, enough to try it properly.

Questions people ask

Is there an official Facebook scraper API?

No. Meta offers the Graph API for assets you own and the Ad Library API for political and EU ads. Everything else public is read from the pages themselves; these endpoints do that and expose it as an API.

Do I need a Facebook account or app review?

No. An Apify account and its API token. The endpoints read only what a visitor without a Facebook account can see.

Can I call it from n8n, Make, Zapier or an AI agent?

Yes. The Apify node in n8n, Make and Zapier runs any of the five Actors, and the Apify MCP server exposes them as tools for AI agents.

Is the output compatible with the official Apify scrapers?

Yes. Each endpoint returns the field names of its official counterpart, so existing code, sheets and workflows keep working after the Actor name changes.

Open the Actor on Apify Compare with the official Actors