Facebook Comments API: Read Public Comments on Any Post
Comments are where customers say what they think in their own words. On Facebook, the official comments edge works well for your own Page and gets restrictive fast for anyone else's. This post covers the official rules, the gaps, and a method to turn a pile of comments into something you can act on.
The official comments edge
The Graph API exposes /{object-id}/comments. The rules from Meta's reference comments reference:
- You need the same permissions as for the parent object. For another Page's posts, that means Page Public Content Access, which requires App Review and business verification PPCA docs.
- For apps using Page Public Content Access, comment ids are no longer returned on Page posts. You need the
MODERATEtask on the Page to get them. - Other users' profile information is not returned unless they authorize your app.
filter=toplevel(the default) returns top-level comments;filter=streamreturns every comment, replies included, in time order.- On objects with tens of thousands of comments, you may hit limits while paging, and
total_countcan be higher than what you can actually read.
For moderation of your own Page, this is the right tool. For research on other Pages, it gives you comment text without stable ids or authors, which makes deduplication and reply threads hard.
When comments are worth reading
Comments are most useful on three kinds of posts: product launches (first reactions and objections), price or policy changes (what people are upset about), and how-to content (the questions that the post did not answer). On brand posts with heavy ad spend, comments skew toward people who saw the ad, not loyal followers, so weigh them separately.
What to collect
| Field | Use |
|---|---|
| Comment text | The content you analyze |
| Created time | Spot bursts after a news event |
| Likes on the comment | Weight: a liked complaint speaks for many people |
| Reply count | Where the debate is |
| Comment id | Deduplicate between runs |
Leave out names and avatars unless you have a reason to keep them. For theme analysis you don't need to know who said it.
Method: from comments to a list of customer questions
- Pull comments from 10 to 20 recent posts on a competitor's Page, or on your own.
- Keep comments with a question mark or that start with how, what, why, when, where, does, can or is.
- Normalize: lowercase, strip emoji and links, collapse spaces.
- Group near-duplicates by their first five words. Count each group and add up likes.
- Sort by likes plus count. The top 20 are your FAQ, your next posts and your sales objections.
import os, re, collections, requests
KEY = os.environ["SCRAPEIO_API_KEY"]
Q = re.compile(r"\?|^(how|what|why|when|where|does|do|can|is|are)\b", re.I)
def comments(post_url, pages=3):
cursor = None
for _ in range(pages):
params = {"url": post_url}
if cursor:
params["cursor"] = cursor
d = requests.get("https://scrapeio.com/v1/facebook/post/comments", params=params,
headers={"x-api-key": KEY}, timeout=60).json()["data"]
yield from d["items"]
if not d["has_more"]:
return
cursor = d["cursor"]
groups = collections.Counter()
for url in open("posts.txt").read().split():
for c in comments(url):
text = re.sub(r"https?://\S+", "", (c.get("text") or "").lower()).strip()
if Q.search(text):
key = " ".join(text.split()[:5])
groups[key] += 1 + (c.get("likes") or 0)
for key, score in groups.most_common(20):
print(score, key)
Comments on Facebook are often short, so the five-word key groups well. For longer comments, swap in an embedding model or ask an LLM to label themes.
Pitfalls
- Spam and giveaways. Posts with contests attract thousands of "done" and tag-a-friend comments. Drop comments under three words and comments that are only mentions.
- Sampling bias. Top-level comments come back in Facebook's own order, which favors popular comments. That is fine for themes but not for measuring how many people are unhappy.
- Old posts. Comments keep arriving for days. Collect a post's comments at least 48 hours after it goes up, or collect twice.
- Language. Global Pages get comments in many languages. Detect language first and analyze each group separately.
Replies
Top-level comments miss the back-and-forth. When a comment has many replies, fetch them separately. That is often where a brand answers, which shows you their support playbook.
How to do it with ScrapeIO
The Facebook comments API returns top-level comments on a public post or video with text, likes, replies and created_at. Each comment also carries a feedback_id and expansion_token; pass both to the Facebook comment replies API to read the thread. Get post URLs from the Facebook profile posts API. Each page of results costs 1 credit.
Sources
Checked on 8 November 2026 from each vendor's own pages. Prices and limits change; follow the links before you decide.
- https://developers.facebook.com/docs/graph-api/reference/object/comments/
- https://developers.facebook.com/docs/features-reference/page-public-content-access
100 free credits, no card. Credits never expire.
Get API key