Facebook API

Also known as脸书脸谱

4 endpoints read Facebook: posts, pages. From $0.0020 a call. No Facebook login and no cookie; a failed call is free.

Endpoints4 endpointsin 2 groups, one response shape
PriceFrom $0.0020per call. Failed calls are free
30-day availability100% Live · the share of time the endpoints were serving calls
DataFetched liveat the moment of the call

The 4 endpoints for Facebook, and what each returns

  • Facebook page profile: Get a public Facebook page by handle, ID or link: name, intro, follower count, likes, category, website, creation date. It also gives the page's ID in Meta's ad library, what getting its ads takes.
  • Facebook page posts: Get a page of the posts a Facebook page published, by page ID, handle or link: text, time, reaction count, comment count, images; shares and views come from the post capability. Three posts a page, with older pages behind a cursor.
  • Facebook post comments: Get a page of the comments on a Facebook post or reel by the post's ID: text, commenter, reactions, reply count, time posted.
  • Facebook post detail: Get one Facebook post or reel by its link: text, author, time, reaction count, comment count, shares, views, images.

One call, as it came back

A recorded call, fields already tidied up: ready for an AI or a spreadsheet.
Recorded
GET/v1/facebook/pages/posts/list$0.0020
FieldValue
typeimage
published_at2026-10-11 16:30 UTC
metrics.likes12,519
metrics.comments412

The first 4 rows of a response recorded 2026-10-12 18:51 UTC.

Run it in the Playground · $0.0020
Recorded response
{
  "code": "ok",
  "request_id": "ac1f2af0-97f5-4f1d-a786-61c31607a687",
  "data": {
    "items": [
      {
        "id": "1247885736888053",
        "url": "https://www.facebook.com/100066515401650/posts/1247885736888053",
        "type": "image",
        "text": "Three things nobody tells you about weekend hiking.",
        "published_at": "2026-10-11T16:30:00.000Z",
        "author": { "id": "100090461909425", "name": "Field Notes Studio" },
        "metrics": { "likes": 12519, "comments": 412 },
        "images": [
          "https://scontent.xx.fbcdn.net/v/t39.35426-6/424612975_129776235836400_n.jpg"
        ]
      },
      // … 2 more
    ]
  },
  "page": {
    "next_cursor": "c1.WDXTNKrTAwY7BPIZmqNpisGwMr6qmsmATN0m9RZk",
    "cursor_expires_at": "2026-10-12T19:51:03.000Z",
    "has_more": true,
    "returned": 3
  },
  "warnings": [],
  "meta": {
    "capability": "facebook.pages.posts.list",
    "result_status": "complete",
    "fetched_at": "2026-10-12T18:51:03.000Z",
    "cached": false,
    "replayed": false,
    "unavailable": {
      "title": "platform",
      "lang": "capability",
      "author.username": "capability",
      "author.avatar_url": "capability",
      "author.verified": "capability",
      "author.followers": "capability",
      "metrics.shares": "capability",
      "metrics.views": "capability",
      "metrics.favorites": "platform",
      "metrics.reposts": "platform",
      "hashtags": "capability",
      "mentions": "capability",
      "is_pinned": "capability",
      "post_id": "platform",
      "parent_id": "platform",
      "root_id": "platform"
    },
    "billing": {
      "amount": "0.002",
      "currency": "USD",
      "balance_after": "9.998"
    }
  }
}

From a response recorded 2026-10-12 18:51 UTC. Names, text and IDs are examples, and so are the links: none is the recorded one (the page shows no one's personal data); the figures are as recorded. Long lists are cut. The request ID, cursor and balance are made up.

What you can get

Each row is an endpoint: what it returns and what one call costs.

EndpointPathReturnsPrice
Posts2
Facebook post detailGET/v1/facebook/posts/getPost$0.0020
Facebook post commentsGET/v1/facebook/posts/comments/listComment list$0.0020
Pages2
Facebook page profileGET/v1/facebook/pages/getAccount$0.0020
Facebook page postsGET/v1/facebook/pages/posts/listPost list$0.0020
Prices are the prices in force. A call that fails, or whose result is uncertain, costs nothing.Facebook API pricing →Facebook data in your AI →See live status →

What people build with it

Ready-made tasks your AI can run on Facebook data. Each is a few calls under a spending cap.

Ask about Facebook right inside Claude or Cursor

Add the OneFeedAPI MCP server and the AI finds the Facebook endpoint it needs and calls it; answers link back to the source. You pay for the calls it makes.

Facebook MCP setup →
https://onefeedapi.com/mcp

Start in three steps

The call shown here is Facebook page posts. Every other Facebook endpoint is called the same way and answers in the same envelope.

Get a key

Sign in with an emailed code or Google. Free trial, no card needed.

Call it, or let your AI call it

One GET from your code. Or paste this prompt into your agent with your key in it: it sets itself up, then finds and calls these endpoints by itself.

Read https://onefeedapi.com/agents.md and set up OneFeedAPI in this agent. My API key is dx_live_…; use it for every OneFeedAPI call.

Sign in to copy it with your key

Read the same shape every time

Items are in data.items (one object in data.item), the next page in page.next_cursor, the charge in meta.billing.amount. A failed call is not charged.

Read the quickstart →
curl -G "https://onefeedapi.com/v1/facebook/pages/posts/list" \
  --data-urlencode "id=100044561550831" \
  -H "Authorization: Bearer $ONEFEED_API_KEY"
# pip install onefeedapi
from onefeedapi import OneFeedAPI

dx = OneFeedAPI()  # reads ONEFEED_API_KEY
result = dx.facebook.pages.posts.list(id="100044561550831")
print(result["data"]["items"])
// npm i @onefeedapi/sdk
import { OneFeedAPI } from "@onefeedapi/sdk";

const dx = new OneFeedAPI(); // reads ONEFEED_API_KEY
const result = await dx.facebook.pages.posts.list({ id: "100044561550831" });
console.log(result.data.items);
onefeedapi call facebook.pages.posts.list id=100044561550831
{
  "mcpServers": {
    "onefeedapi": {
      "type": "http",
      "url": "https://onefeedapi.com/mcp",
      "headers": {
        "Authorization": "Bearer ${ONEFEED_API_KEY}"
      }
    }
  }
}

Add this to your MCP client, then ask your agent to call facebook.pages.posts.list.

Edge cases

What the Facebook endpoints do at their edges, and what to check when a call does not return what you expected.

Page sizes
A list returns 3 to 10 items a page, depending on the endpoint. Every list goes on to a next page: page.next_cursor, passed back as cursor, each page a call of its own.
Fields it cannot give
4 of the 4 endpoints cannot fill every field of the object they return. Each endpoint's page lists which, and every answer repeats them in meta.unavailable: a missing field is never a silent zero.
Three posts a page
A Page's posts come three to a page, the platform's own limit for someone not signed in; older ones are behind the cursor. The Page ID is faster than the handle.
Posts by link, comments by ID
Post detail takes the link (facebook.com/<page>/posts/… or /reel/…); a link from the Page's post list can be passed as it is. Comments take the post's numeric ID from that list or from the post.
Shares and views are on the post
A Page's post list has no shares or views; post detail has them, views on videos only.
Reactions and rounded followers
metrics.likes is all reactions together. A Page's followers are a rounded figure from a thousand up.

Questions about the Facebook API

Short answers. The details are on each endpoint's page.

What Facebook data can I get through the API?

4 endpoints: posts, pages. Each endpoint's page gives its parameters and fields, with a recorded response.

How do I call the Facebook API?

Sign up for a key, send it as Authorization: Bearer <key> and call the endpoint's address, for example GET https://onefeedapi.com/v1/facebook/pages/get. Or connect OneFeedAPI to Claude, Cursor or ChatGPT (MCP) and ask in a sentence. The free trial needs no card.

How many tokens does a Facebook API response take in an AI?

Across 4 Facebook endpoints, one recorded real response each, the platform's own JSON comes to 16k tokens and what an AI reads through OneFeedAPI's MCP server to 2,716, 83% fewer; the JSON of a direct API call is 58% fewer (counted 2026-11-06). Every platform uses the same field names, and fields returns only the ones you name.

How is the Facebook API priced?

Per call, no subscription. All 4 endpoints cost $0.0020 a call. You are charged when data comes back; a failed call costs nothing.

Do I need a Facebook account or a cookie?

No. One OneFeedAPI key is all you hold: no Facebook login, no cookie, no device to keep alive. The endpoints return publicly visible data only.

Is the data live?

A call fetches from Facebook at that moment, and meta.fetched_at says when. A result is kept for 24 hours, so a retry with the same Idempotency-Key is not charged again.

What happens when Facebook changes something?

A call that fails is not charged, whatever the reason. An endpoint that is paused answers capability_paused, also free, and GET /v1/catalog/status says what is up right now.

Related

Call Facebook with one key.

Free trial on sign-up: up to 50 calls at $0.0020. No card. No Facebook login, no cookie, no subscription. A failed call is free.

Start free