DEV Community

Mena489
Mena489

Posted on

How to Scrape All Posts From a Facebook Page (No Cookies)

Pulling every post from a Facebook page — with reactions, comments, shares and video views on each — is the fastest way to see what a competitor is actually doing rather than what they say they are doing. This guide shows how to do it without a Facebook account.

Short answer: give the Facebook Profile/Page Scraper a page URL and a post limit, and it walks the page's timeline and returns each post as structured JSON.

What you can and cannot get

Be clear on the boundary before you start:

You can scrape any public page or public profile — business pages, creator pages, public figures, and personal profiles set to public. This is the same content any logged-out visitor sees.

You cannot scrape private profiles, friends-only posts, private groups, or anything behind a login. Nor should you try; that is unauthorised access, not scraping.

For competitor research, brand monitoring and creator analytics, the public surface is where the useful data lives anyway.

Step 1 — Point it at a page

{
    "url": "https://www.facebook.com/OrangeEgyptOfficial",
    "limit": 50,
    "startDate": "2026-01-01",
    "endDate": "2026-06-30"
}
Enter fullscreen mode Exit fullscreen mode

limit caps how many posts come back — start small while you check the output shape, then raise it. startDate and endDate are optional; supply them to restrict the run to a window rather than paying to walk a page's entire history.

Step 2 — Read the results

Each post arrives as one record:

{
    "post_id": "122150535824513880",
    "type": "video",
    "permalink_url": "https://www.facebook.com/reel/625885050263599/",
    "owner_name": "El fútbol",
    "thumbnail": "https://scontent.fdxb3-4.fna.fbcdn.net/...",
    "statistics": {
        "reaction_count": { "count": 1204, "is_empty": false },
        "comment_count": 87,
        "shares_count": 33,
        "video_view_count": 41208
    }
}
Enter fullscreen mode Exit fullscreen mode

The type field (video, photo, text, reel) is what makes this data useful. Grouping engagement by post type tells you which format a page's audience actually responds to — usually a very different answer from what the page publishes most of.

One detail that trips people up: reaction_count is an object, not a number, and is_empty distinguishes a genuine zero from a count Facebook declined to disclose. Averaging count without checking is_empty silently drags your engagement numbers down.

Turning posts into a content strategy

Three queries answer most competitive-research questions:

Which format wins?

from collections import defaultdict

by_type = defaultdict(list)
for post in posts:
    stats = post.get("statistics", {})
    reactions = stats.get("reaction_count", {})
    if not reactions.get("is_empty"):
        by_type[post["type"]].append(reactions.get("count", 0))

for post_type, counts in by_type.items():
    print(post_type, "avg reactions:", sum(counts) // max(len(counts), 1))
Enter fullscreen mode Exit fullscreen mode

What are their top 10 posts? Sort by reactions and read the captions. That is your content brief.

How often do they post? Count posts per week from the date window. Posting cadence is the cheapest competitive metric there is, and most brands guess it wrong.

Calling it from your own code

Python

from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("mina_safwat/facebook-profile-scraper").call(
    run_input={"url": "https://www.facebook.com/OrangeEgyptOfficial", "limit": 50}
)

posts = list(client.dataset(run["defaultDatasetId"]).iterate_items())
top = sorted(posts, key=lambda p: p["statistics"]["reaction_count"].get("count", 0), reverse=True)
for post in top[:10]:
    print(post["statistics"]["reaction_count"]["count"], post["permalink_url"])
Enter fullscreen mode Exit fullscreen mode

cURL

curl -X POST "https://api.apify.com/v2/acts/mina_safwat~facebook-profile-scraper/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.facebook.com/OrangeEgyptOfficial","limit":25}'
Enter fullscreen mode Exit fullscreen mode

What it costs

$0.0095 per post returned. Pulling a competitor's last 500 posts costs under $5 — roughly the price of a coffee for a complete picture of a year of their content strategy.

Common use cases

  • Competitive content audits. Pull three rivals' last 200 posts and compare format mix, cadence and engagement side by side.
  • Influencer vetting. Check whether a creator's engagement is consistent or spiked by a single viral post.
  • Campaign tracking. Monitor a brand's posts through a launch window and measure lift.
  • Historical archives. Preserve a page's public output before it changes or disappears.

FAQ

Can I scrape a personal profile?
Only if it is set to public. Private profiles return no post data.

How far back can it go?
As far as the page's public timeline extends. Use startDate to bound the run rather than paying to walk years of history you will not use.

Do I get comment text?
No — you get comment counts. For the comments themselves, run the Facebook Comments Scraper on the post URLs this returns.

What if I only need one specific post?
Use the Facebook Post Scraper instead — it takes post URLs directly and is cheaper per record.

Is this legal?
Scraping publicly accessible pages is generally permitted in many jurisdictions, but Facebook's Terms of Service prohibit automated collection, and post data tied to identifiable people is personal data under GDPR. This is not legal advice — confirm your basis before collecting at scale, and do not scrape private content.


Try it: Facebook Profile/Page Scraper on Apify Store — no cookies, $0.0095 per post.

Top comments (0)