Back to Blog
Facebook

Scrape Public Facebook Group Posts for Market Research & Leads

December 31, 2025
5 min read
S
By SociaVault Team
Facebook GroupsMarket ResearchLead GenerationSocial Listening

Scrape Public Facebook Group Posts for Market Research & Leads

If you want to know what people genuinely think about a topic — not the polished version, the real version — a niche Facebook Group is hard to beat. "SaaS Founders" arguing about churn, "Local Moms of [City]" comparing pediatricians, a 400k-member fitness group debating gear. Marketers call this "dark social": high-value conversation that never shows up in the public feed.

The crucial line first, because it's both an ethics and a legality boundary: public groups only. Private and closed groups require membership and are off-limits — don't try to get around that. Public groups, on the other hand, are visible to anyone and full of searchable, useful signal. This guide shows how to scrape public group posts with SociaVault and turn them into market research, leads, and content ideas. Code in JavaScript.

What it's good for

  • Pain-point research: search a niche group for "struggling with" or "hate that" and you'll find problems worth solving.
  • Lead generation: posts asking "can anyone recommend a [your service]?" are warm intent.
  • Content ideas: the questions that get the most comments are the posts you should write.

Step 1: Pull the group's posts

The endpoint takes a group_id (or the group url) and a sort_by.

const API_KEY = process.env.SOCIAVAULT_API_KEY;
const BASE = "https://api.sociavault.com/v1/scrape/facebook";

async function getGroupPosts(groupId) {
  const res = await fetch(
    `${BASE}/group/posts?group_id=${groupId}&sort_by=RECENT_ACTIVITY`,
    { headers: { "x-api-key": API_KEY } },
  );
  const json = await res.json();
  if (!json.success) {
    console.error(json.error);
    return [];
  }
  // Log json.data once to confirm the posts container + field names.
  return json.data.posts || json.data.items || [];
}

You can find the group_id in the group URL (facebook.com/groups/123456789); for a vanity URL (/groups/saasfounders) you can pass the full url instead.

Step 2: Filter for intent (the listening engine)

You don't want every post — you want the ones that signal a problem or a buying decision.

const INTENT = [
  "recommend",
  "looking for",
  "suggestion",
  "anyone use",
  "help with",
  "alternative to",
];

function findLeads(posts) {
  return posts
    .filter((p) => {
      const text = (p.text || p.message || "").toLowerCase();
      return INTENT.some((kw) => text.includes(kw));
    })
    .map((p) => ({
      text: p.text || p.message,
      comments: p.comment_count ?? p.comments,
      url: p.url || p.permalink,
    }));
}

A match like "looking for a new CRM for my real estate business, any recommendations?" is about as warm as a lead gets — someone publicly asking for exactly what you sell.

Step 3: Read the room via comments

When someone asks "has anyone tried [Tool X]?", the answer you want isn't the post — it's the 40 replies. Pull a post's comments (via the post-comments endpoint) and you get an instant, unfiltered review panel for that product or topic. That's market research no survey can match, because nobody's performing for a researcher.

The ethics that keep this clean

This is powerful, so use it responsibly:

  • Public groups only — never attempt private or closed groups.
  • Focus on the content, not the people. For market research you care about what is being said and how often, not building dossiers on named individuals. Avoid storing personal names unless you have a genuine, lawful B2B reason and handle them per privacy rules.
  • Don't hammer the API. Facebook is sensitive about group access; reasonable, spaced requests keep things stable.

Frequently Asked Questions

Can you scrape Facebook group posts?

You can scrape posts from public Facebook groups — content visible to anyone without joining. Pass the group's ID or URL to a group-posts endpoint and you get the posts back as structured data. Private and closed groups require membership and should never be scraped.

How do I find a Facebook group's ID?

It's usually in the group URL (facebook.com/groups/123456789). If the group uses a vanity name instead of a numeric ID, you can pass the full group URL to the endpoint rather than hunting for the ID.

Reading content in public groups — visible to anyone — is standard research, but ethics matter: stay on public groups only, focus on the conversation rather than profiling individuals, and handle any personal data in line with privacy regulations. Don't touch private or closed groups.

What can group data tell me that surveys can't?

Candor and context. People in niche groups speak honestly to peers, not to a researcher, so you see real pain points, objections, and the exact language they use — invaluable for product decisions and ad copy. Surveys get performed answers; group threads get real ones.

How do I find leads in a group?

Filter posts for intent phrases like "looking for," "can anyone recommend," or "alternative to." Those are people publicly stating a need. The code above does this automatically, surfacing the warm posts from a feed of general chatter.

How often should I scan a group?

Daily or a few times a week for active groups, so you catch intent posts while they're fresh and can respond before competitors. Sort by recent activity and filter for intent to keep each scan focused and cheap.

The bottom line

Public Facebook groups are the internet's town halls — candid, niche, and full of intent. Scrape them ethically (public only, content over individuals) and you'll understand your market and find leads better than any survey could deliver.

Want to start listening? Start free with SociaVault with 50 credits.

Found this helpful?

Share it with others who might benefit

Ready to Try SociaVault?

Start extracting social media data with our powerful API. No credit card required.