100 free credits. No credit card required. Get a key

How to get Facebook data

Checked Code run live

Reading Facebook Pages you don’t manage through the Graph API needs Meta’s Page Public Content Access feature, which means app review and business verification. A data API reads public Facebook for you: one GET returns a Page with its follower count, category and contact links, 2 credits.

The official Facebook API

Meta’s Graph API reads the Pages your app’s users manage. Everything else is gated:

  • Page Public Content Access lets an app read public posts and comments on other Pages, only after App Review and business verification, and possibly extra contracts.
  • CrowdTangle shut down on 14 August 2024. Its successor, Meta Content Library, is for researchers at academic and non-profit institutions.
  • The Ad Library API returns political and issue ads everywhere, and other ads only if they reached the EU.

Sources: Page Public Content Access, Meta Content Library, Ad Library API.

Quick start

  1. Get a keySign up with an email code: 100 free credits, no card. An agent can sign itself up with POST https://api.groundsocial.dev/v1/agent/signup.
  2. Set it in your shellexport GROUNDSOCIAL_API_KEY=gs_live_…
  3. Make the callA Page with followers and links: GET /v1/facebook/pages/nasa, 2 credits.
curl "https://api.groundsocial.dev/v1/facebook/pages/nasa" \
  -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY"

Sample response

Trimmed from the real response on 27 November 2026: lists cut to their first items and long strings shortened. Every field is described in the tutorial.

json
{
  "id": "54971236771",
  "name": "NASA - National Aeronautics and Space Administration",
  "url": "https://www.facebook.com/NASA/",
  "category_name": "Government organization",
  "is_verified": true,
  "follower_count": 28000000,
  "following_count": 53,
  "intro": [
    "Page · Government organisation",
    "NATIONAL AERONAUTICS AND SPACE ADMINISTRATION is responsible for this Page",
    "public-inquiries@hq.nasa.gov",
    "nasa.gov/nasa-app",
    "nasa.gov"
  ]
}

Get every page

/v1/facebook/ads/search returns ads a page at a time, and each page costs 2 credits. Pass the response’s page_info.end_cursor back as after until it runs out.

// Collect up to 3 pages of ads.
const first = 'https://api.groundsocial.dev/v1/facebook/ads/search?q=running%20shoes&country=US'
const items: unknown[] = []
let cursor: string | undefined
for (let page = 0; page < 3; page++) {
  const url = new URL(first)
  if (cursor) url.searchParams.set('after', cursor)
  const res = await fetch(url, {
    headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` },
  })
  if (!res.ok) throw new Error((await res.json()).error.hint)
  const data = await res.json()
  items.push(...(data.ads ?? []))
  cursor = data.page_info?.has_next_page ? data.page_info?.end_cursor : undefined
  if (!cursor) break
}
console.log(items.length, 'ads')

What else you can get from Facebook

What you getEndpointCredits
A Page with followers and linksGET /v1/facebook/pages/nasa2
One post with reactionsGET /v1/facebook/posts2
Comments on a postGET /v1/facebook/posts/comments2
Ad Library search, any ad typeGET /v1/facebook/ads/search2
One advertiser’s adsGET /v1/facebook/ads/company2
Public eventsGET /v1/facebook/events/search1
Marketplace listingsGET /v1/facebook/marketplace/search1

Each row links to its tutorial. Every Facebook endpoint and price: Facebook API.

Tips

  • Pages take a username (nasa), a numeric id or a facebook.com URL.
  • Ad Library search covers commercial ads in every country, as the Ad Library website shows them; sort_by=total_impressions puts the most-shown ads first.
  • collation_count on an ad is how many copies of a creative an advertiser runs: a sign it works.

Use it from Claude or Cursor (MCP)

Every endpoint is also an MCP tool on the remote server https://api.groundsocial.dev/mcp. The ?platforms=facebook below loads only the Facebook tools. The client signs in with OAuth, or send your key as a Bearer token. Tools used in this guide: facebook_page_get, facebook_ads_search, facebook_post_get, facebook_post_comments, facebook_ads_company, facebook_event_search, facebook_marketplace_search.

claude mcp add --transport http groundsocial "https://api.groundsocial.dev/mcp?platforms=facebook"

Setup for ChatGPT, VS Code, Windsurf, n8n and others: MCP client setup.

Pricing

Pay per call from prepaid credits; no subscription. 100 free credits cover the examples on this page. Costs below are at the credit packs’ highest and lowest rates.

JobCreditsCost
1,000 Pages2,000$2.00 → $0.80
300 ads for one keyword (10 pages)20$0.02 → $0.01
Weekly check of 50 competitors’ ads, 4 weeks400$0.40 → $0.16

FAQ

Do I get ad spend and impressions?

Only where Meta publishes them: political and issue ads, and EU reach figures. Commercial ads outside the EU show creatives and dates but not spend.

Can I read private groups or profiles?

No. Only what Facebook shows a logged-out visitor.

Are failed calls charged?

No. A target that does not exist answers 404 target_not_found, an upstream failure answers 503, and neither costs anything. Credits never expire.

Is Groundsocial official?

No. Groundsocial is an independent API that reads what the platform shows a logged-out visitor. Facebook is a trademark of Meta Platforms, Inc. We are not affiliated with or endorsed by Meta.

Go deeper

Facebook is a trademark of Meta Platforms, Inc. We are not affiliated with or endorsed by Meta.

Try it on your own data

One key for Facebook and every other platform, over REST or MCP. Free credits on signup, no card.