Apify example task · whoareyouanas/facebook-group-scraper

Export posts from a public Facebook Page

Collect a small sample of posts from a public Facebook Page, including available text, dates and engagement fields. Replace the NASA Page URL with your own public Page or supported group URL. Private content may require your own authorized session.

Actor
Facebook Group & Page Scraper - Posts, Comments & Reactions
Result limit
3 (maxPosts)
Estimated cost
Up to $0.03005
Run options
1 GB memory · 180 s timeout

Example updated 2026-11-20 · actor build 0.1.18 · runs in your own Apify account

From public source to spreadsheet

Export a small batch from a public Facebook Page, then import that dataset into Google Sheets. This prefilled example collects up to three posts with available engagement counts.

  1. Start with one authorized public source. Keep the post cap small and inspect the original post URLs in the dataset.
  2. Export CSV. In Google Sheets, import with automatic conversion disabled so long numeric post IDs stay as text.
  3. Keep one row per post ID in your working sheet. Save a dated copy before updating it so you can distinguish new posts from engagement changes.

Keep postId, postUrl, timestamp, totalReactions, commentsCount, and sharesCount. This example leaves comment bodies off. A source comment count can be present without any captured comment text.

01 / About the actor

Facebook Group & Page Scraper - Posts, Comments & Reactions

Export posts from Facebook groups and Pages with text, reactions, supported comments, media references, author information, and optional entity metadata. A run can mix several group and Page sources.

Groups and Pages

Use one startUrls list for public groups, brand Pages, creator Pages, and other supported feeds.

More post context

Include comments, media, and group or Page details when the source exposes them.

Repeatable collection

Control run size, date cutoff, concurrency, and request timeouts for saved tasks or API calls.

02 / Input

The exact input this example runs.

startUrls is required. Set maxPosts deliberately and choose whether comments, media, and entity information are needed. Private-group workflows require valid user-supplied cookies and existing access.

input.json · public-facebook-page-posts
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/NASA"
    }
  ],
  "maxPosts": 3,
  "includeComments": false,
  "includeMedia": false,
  "maxConcurrency": 1
}
Input fields used by this example, their values and what they control
FieldValue in this exampleWhat it controls
startUrlsChange thishttps://www.facebook.com/NASAURLs of Facebook groups OR Pages to scrape. Group example: https://www.facebook.com/groups/123456789 — Page example: https://www.facebook.com/ohpollyfashion. You can mix groups and Pages in the same run.
maxPostsChange this3Maximum number of posts to scrape per group or Page. The scraper will stop scrolling once this limit is reached. Set to a lower value for faster runs.
includeCommentsChange thisfalseWhether to scrape top-level comments for each post. Disabled by default to keep runs faster and cheaper; enable it when you need richer data.
includeMediaChange thisfalseWhether to include image/video URLs in output and allow browser media downloads while scraping. Disable this to reduce residential proxy bandwidth usage; text, post metadata, reactions, and counts will still be scraped where available.
maxConcurrency1Number of browser tabs to run in parallel. Keep at 1 for stability. Increase to 2-3 only if you need faster scraping and have sufficient memory. Higher values increase memory usage.
Other inputs you can add (8)
Deployed actor input fields, types, defaults, and descriptions
FieldType / requiredDefaultPurpose
viewOptionstring"RECENT_ACTIVITY"How posts should be sorted when scraping the feed.

Options: RECENT_ACTIVITY, TOP_POSTS, CHRONOLOGICAL

onlyPostsNewerThanstringNot specifiedOnly scrape posts published after this date. Use ISO 8601 format (e.g. 2024-01-01 or 2024-06-15T00:00:00Z). Leave empty to scrape all posts up to maxPosts limit.
includeGroupInfobooleantrueWhether to scrape entity metadata. For groups: name, description, member count, privacy status, admins, rules. For Pages: name, description, follower count, like count, page category, verified status, cover photo.
cookiesarrayNot specifiedPaste your Facebook cookies as a JSON array to access private/closed groups or login-walled Pages. Export the full facebook.com cookie set from your logged-in browser for best reliability. At minimum, include 'c_user' and 'xs'; companion cookies such as 'fr', 'datr', 'sb', and 'wd' are recommended.
requestHandlerTimeoutSecsinteger600Maximum time in seconds to spend scraping a single group or Page. Targets with many posts need longer timeouts. Default of 600 seconds (10 minutes) handles most cases.

Minimum: 60 · Maximum: 1200

minResultsPerMinuteinteger20Stops slow targets after the grace period when result velocity is below this value. This protects pay-per-result margins on blocked or low-yield pages. Set to 0 to disable.

Minimum: 0 · Maximum: 1000

costGuardGracePeriodSecsinteger120How long each target can run before the minimum-results-per-minute guard is enforced.

Minimum: 30 · Maximum: 1200

proxyUrlstringNot specifiedAdd your Apify Proxy URL for reliable scraping. Format: http://groups-RESIDENTIAL:[email protected]:8000. Get your token from Apify Console. External proxies (BrightData, Oxylabs) also work.

03 / Make it yours

Change these fields for your own research.

  1. 01 · startUrls

    Facebook Group or Page URLs

    URLs of Facebook groups OR Pages to scrape. Group example: https://www.facebook.com/groups/123456789 — Page example: https://www.facebook.com/ohpollyfashion. You can mix groups and Pages in the same run.

    Example: https://www.facebook.com/NASA

  2. 02 · maxPosts

    Max Posts

    Maximum number of posts to scrape per group or Page. The scraper will stop scrolling once this limit is reached. Set to a lower value for faster runs.

    Example: 3

  3. 03 · includeComments

    Include Comments

    Whether to scrape top-level comments for each post. Disabled by default to keep runs faster and cheaper; enable it when you need richer data.

    Example: false

  4. 04 · includeMedia

    Include Media URLs

    Whether to include image/video URLs in output and allow browser media downloads while scraping. Disable this to reduce residential proxy bandwidth usage; text, post metadata, reactions, and counts will still be scraped where available.

    Example: false

Run it in three steps

  1. Open the example on Apify and select Try for free to copy it into your Apify account.
  2. Replace the sample values above with your own target and keep the limit small.
  3. Start the run, then export the dataset as JSON, CSV or Excel.

04 / Output

What the results table shows.

Columns in the “Overview” view

postId

Post ID

postUrl

Post URL

groupName

Group / Page Name

groupUrl

Group / Page URL

authorName

Author Name

authorProfileUrl

Author Profile URL

authorId

Author ID

text

Text

postType

Post Type

timestamp

Timestamp

formattedDate

Formatted Date

likesCount

Likes

lovesCount

Loves

hahaCount

Haha

wowCount

Wow

sadCount

Sad

angryCount

Angry

totalReactions

Total Reactions

commentsCount

Comments

sharesCount

Shares

images

Images

videos

Videos

topComments

Top Comments

source

Source

scrapeDate

Scrape Date

A view selects columns for the table. The full JSON export keeps every field, including nested arrays and objects.

05 / Cost

What this example costs to run.

At most about $0.03005: up to 3 results at $0.01 each (Post Scraped) plus $0.00005 for the start event at 1 GB of memory. Fewer results cost less. The live Pricing tab on Apify is authoritative.

Prices checked 2026-11-22. Set a run spending limit in Apify when you widen the input.

06 / API

Run the same input from your code.

This call starts a billable run of Facebook Group & Page Scraper - Posts, Comments & Reactions with this example's input and returns the dataset items when it finishes. Synchronous calls wait up to five minutes; for longer runs, POST to /runs instead and read the run's default dataset when it succeeds. Keep the token in an environment variable.

cURL · run and return the results
curl --request POST \
  'https://api.apify.com/v2/acts/whoareyouanas~facebook-group-scraper/run-sync-get-dataset-items?format=json' \
  --header "Authorization: Bearer $APIFY_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{"startUrls":[{"url":"https://www.facebook.com/NASA"}],"maxPosts":3,"includeComments":false,"includeMedia":false,"maxConcurrency":1}'

Coverage & interpretation

Check the result before relying on it.

Questions

About this example.

What does the "Export posts from a public Facebook Page" example collect?

Collect a small sample of posts from a public Facebook Page, including available text, dates and engagement fields. Replace the NASA Page URL with your own public Page or supported group URL. Private content may require your own authorized session. It runs Facebook Group & Page Scraper - Posts, Comments & Reactions, published by whoareyouanas on Apify.

Which input does this example use?

Facebook Group or Page URLs (startUrls) set to https://www.facebook.com/NASA; Max Posts (maxPosts) set to 3; Include Comments (includeComments) set to false; Include Media URLs (includeMedia) set to false. The full JSON input is shown on this page.

How much does it cost to run this example?

At most about $0.03005: up to 3 results at $0.01 each (Post Scraped) plus $0.00005 for the start event at 1 GB of memory. Fewer results cost less. The live Pricing tab on Apify is authoritative.

How do I change it for my own research?

Open the example on Apify and select Try for free to copy it into your account, then edit Facebook Group or Page URLs, Max Posts, Include Comments, Include Media URLs. Keep the result limit small for the first run and check the output before scaling up.

Can I run it from the API or on a schedule?

Yes. Send the same JSON input to the Facebook Group & Page Scraper - Posts, Comments & Reactions run endpoint with your Apify API token, or save the copied task in your Apify account and add a schedule. Results land in the run's default dataset as JSON, CSV or Excel.

More examples

Related tasks you can copy.

Guides

Read more about this workflow.