Facebook Posts Scraper avatar

Facebook Posts Scraper

Pricing

from $0.79 / 1,000 posts

Go to Apify Store
Facebook Posts Scraper

Facebook Posts Scraper

Facebook posts scraper and Facebook posts API for public pages: page links in; Facebook posts data out with text, reactions by type, comment and share counts, video views, photos and links, plus comments and replies if wanted. $1.49 per 1,000 posts and $0.24 per 1,000 comments on Starter. No login.

Pricing

from $0.79 / 1,000 posts

Rating

0.0

(0)

Developer

Preternix

Preternix

Maintained by Community

Actor stats

0

Bookmarked

13

Total users

6

Monthly active users

15 hours ago

Last modified

Features

Limited permissions

Share

Use this Facebook posts scraper to collect public posts from page, profile or post links, or find posts by keyword. The Facebook posts API returns text, reactions, share counts and media when available. Add video captions or collect comments as a separate dataset.

Key features

  • Collect posts in a date range or search for public posts by keyword and tagged location.
  • Get engagement counts, media and links. Video rows can include views and caption links, with optional plain text captions.
  • Turn on comments to collect them separately. Replies can be included as individual rows.

Quick start

Paste this JSON into the Apify input form or send it as the Actor input from code.

{
"startUrls": [
{
"url": "https://www.facebook.com/humansofnewyork"
}
],
"resultsLimit": 5,
"includeComments": false
}

Input parameters

ParameterTypeDefault or when omittedWhat it does
startUrlsListUnsetPublic Facebook page, profile or post URLs. A page name also works. Use links, keyword searches or both.
searchQueriesListUnsetOne keyword phrase per entry. Search rows include searchQuery.
searchSortByText"top"Facebook’s top order or most recent first for keyword searches. Choices: top, recent.
searchLocationTextUnsetA Facebook location ID or place link ending in that ID. With a location, keyword results are newest first.
resultsLimitInteger1000000 upper limit when omittedMaximum posts per page or keyword. When omitted, the Actor reads as far as Facebook makes posts available, up to 1,000,000 per input. Minimum: 1.
captionTextBooleanfalseAdd transcriptText for videos that have captions, at no extra charge.
onlyPostsNewerThanTextUnsetKeep posts after a date, ISO timestamp or relative period such as 7 days.
onlyPostsOlderThanTextUnsetKeep posts before a date, ISO timestamp or relative period.
includeCommentsBooleanfalseCollect comments in a separate Comments dataset. Each saved comment or reply has a separate charge.
maxCommentsPerPostInteger20Maximum comment rows per post when comments are enabled. Minimum: 1.
viewOptionText"RANKED_UNFILTERED"Facebook’s comment order: all comments, most relevant or newest first, respectively. Choices: RANKED_UNFILTERED, RANKED_THREADED, RECENT_ACTIVITY.
includeNestedCommentsBooleanfalseInclude replies up to three levels deep when collecting comments.
onlyCommentsNewerThanTextUnsetKeep comments after a date or relative period. Comments are then read newest first.
apifyCompatibleBooleanfalseAdjust the shape of topComments and collaborators for code written for apify/facebook-posts-scraper; omit missing values.
proxyConfigurationObject{"useApifyProxy": true}Leave at the Apify Proxy default for a typical run.
residentialFallbackBooleantrueRetry refused requests on residential proxies.

Real JSON output

Selected fields from a real public page post. The comments field is a count; full comments are collected separately when enabled.

{
"pageName": "Humans of New York",
"postId": "1693745835649732",
"url": "https://www.facebook.com/reel/1689409286147436/",
"postType": "Video",
"time": "2026-11-01T23:35:06Z",
"likes": 11206,
"comments": 197,
"shares": 174,
"isVideo": true
}

Pricing

Each post saved is charged once per run. Comments and replies are charged separately when includeComments is on and rows are saved in the Comments dataset. There is no start fee, and date filters and video captions have no separate charge.

Prices in USD per 1,000 of each billed event:

EventFreeStarterScaleBusiness and above
Post rows$1.79$1.49$1.19$0.79
Comment or reply rows$0.24$0.24$0.24$0.24

Run from code

Set APIFY_TOKEN to your Apify API token. Install the SDK for your language with pip install apify-client or npm install apify-client.

Python

This example uses apify-client 3.x.

import os
from apify_client import ApifyClient
client = ApifyClient(os.environ["APIFY_TOKEN"])
run_input = {
"startUrls": [
{
"url": "https://www.facebook.com/humansofnewyork"
}
],
"resultsLimit": 5,
"includeComments": False
}
run = client.actor("deepmine/facebook-posts-scraper").call(run_input=run_input)
if run is None or run.status != "SUCCEEDED":
raise RuntimeError("The Actor run did not succeed")
for item in client.dataset(run.default_dataset_id).iterate_items():
print(item)

Node.js

Run this script as an ES module, for example from a .mjs file.

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const input = {
"startUrls": [
{
"url": "https://www.facebook.com/humansofnewyork"
}
],
"resultsLimit": 5,
"includeComments": false
};
const run = await client.actor('deepmine/facebook-posts-scraper').call(input);
if (run?.status !== 'SUCCEEDED') throw new Error('The Actor run did not succeed');
const dataset = client.dataset(run.defaultDatasetId);
const limit = 1000;
for (let offset = 0; ; offset += limit) {
const { items } = await dataset.listItems({ limit, offset });
for (const item of items) console.log(item);
if (items.length < limit) break;
}

Integrations: Apify MCP and n8n

Apify MCP: Add this remote server to your MCP client and sign in to Apify. Choose the Actor tool and use the JSON from Quick start. See the Apify MCP setup guide.

https://mcp.apify.com?tools=deepmine/facebook-posts-scraper

n8n: Use HTTP Request nodes with your Apify token stored in a Bearer Auth credential. Send the Quick start JSON in the first request. Use a Wait node between status requests and route on data.status: read the dataset on SUCCEEDED, stop on other terminal states, and wait again while the run is active. For large datasets, page with limit and offset.

POST https://api.apify.com/v2/acts/deepmine~facebook-posts-scraper/runs
GET https://api.apify.com/v2/actor-runs/{{ $json.data.id }}
GET https://api.apify.com/v2/datasets/{{ $json.data.defaultDatasetId }}/items

To find the optional separate dataset, read GET https://api.apify.com/v2/key-value-stores/{defaultKeyValueStoreId}/records/OUTPUT and follow commentsDataset.itemsUrl if present. The run response provides data.defaultKeyValueStoreId.

Frequently asked questions

Where do I find the full comments?

Turn on includeComments and open the Comments dataset from the run output. In code, check commentsDataset in the OUTPUT record. The default dataset contains posts.

Can I collect posts tagged at a place?

Use a keyword in searchQueries and a place link or ID in searchLocation. Facebook applies that location filter to the most recent sort.

Do all videos include a transcript?

No. Turn on captionText to get plain text where Facebook already provides captions for the video.

See the full input reference or the Actor API.