# Facebook API

> Public posts by keyword, a page's posts, and the comments and replies under a post.

Canonical page: https://okdata.online/apis/facebook/

5 endpoints, $0.043 per call. Region: Global. No Facebook login or cookies needed.

| Endpoint | ID | Returns | Price |
|---|---|---|---|
| [Facebook post search](https://okdata.online/apis/facebook/posts/search/) | `facebook.posts.search` | Post[] | $0.043 per call · about 10 posts per page |
| [Facebook page ID lookup](https://okdata.online/apis/facebook/pages/get/) | `facebook.pages.get` | Account | $0.043 per call |
| [Facebook page posts](https://okdata.online/apis/facebook/pages/posts/list/) | `facebook.pages.posts.list` | Post[] | $0.043 per call · about 3 posts per page |
| [Facebook post comments](https://okdata.online/apis/facebook/posts/comments/list/) | `facebook.posts.comments.list` | Comment[] | $0.043 per call · about 10 comments per page |
| [Facebook comment replies](https://okdata.online/apis/facebook/comments/replies/list/) | `facebook.comments.replies.list` | Comment[] | $0.043 per call · about 10 comments per page |

## Good for

- Content research: `facebook.posts.search`, `facebook.pages.posts.list`
- Word of mouth: `facebook.posts.search`, `facebook.posts.comments.list`, `facebook.comments.replies.list`
- Competitor monitoring: `facebook.pages.get`, `facebook.pages.posts.list`

## At a glance

5 Facebook endpoints covering posts, Pages and comments, from $0.043 a call. No Facebook account or cookie needed.

Categories: [Social media](https://okdata.online/categories/social/)

- **Endpoints**: 5 endpoints. In 3 groups, one response format · 2 coming soon.
- **Lowest price**: From $0.043. A call, paid from a prepaid balance.
- **Freshness**: Live. Read from the platform when you call.
- **Monthly fee**: $0. No subscription or minimum spend.

- [Start free](https://okdata.online/console/)
- Try one: [Facebook post search](https://okdata.online/apis/facebook/posts/search/)
- Facebook in Claude, Cursor and other agents: [Facebook MCP](https://okdata.online/mcp/facebook/)

## Endpoints by group

### Posts (2)

| Endpoint | Request | Returns | Price |
|---|---|---|---|
| [Post search](https://okdata.online/apis/facebook/posts/search/) | `GET /v1/facebook/posts/search` | Post[] | $0.043 per call |
| [Post comments](https://okdata.online/apis/facebook/posts/comments/list/) (coming soon) | `GET /v1/facebook/posts/comments/list` | Comment[] | $0.043 per call |

### Pages (2)

| Endpoint | Request | Returns | Price |
|---|---|---|---|
| [Page ID lookup](https://okdata.online/apis/facebook/pages/get/) | `GET /v1/facebook/pages/get` | Account | $0.043 per call |
| [Page posts](https://okdata.online/apis/facebook/pages/posts/list/) | `GET /v1/facebook/pages/posts/list` | Post[] | $0.043 per call |

### Comments (1)

| Endpoint | Request | Returns | Price |
|---|---|---|---|
| [Comment replies](https://okdata.online/apis/facebook/comments/replies/list/) (coming soon) | `GET /v1/facebook/comments/replies/list` | Comment[] | $0.043 per call |

- [Facebook API pricing](https://okdata.online/pricing/facebook/)
- [Facebook in your AI (MCP)](https://okdata.online/mcp/facebook/)
- [Live status](https://okdata.online/status/)

## What people do with Facebook data

- [Content research](https://okdata.online/solutions/content-research/): “What do the top posts on this topic have in common?” [Post search](https://okdata.online/apis/facebook/posts/search/) $0.043, [Page posts](https://okdata.online/apis/facebook/pages/posts/list/) $0.043
- [Competitor monitoring](https://okdata.online/solutions/competitor-monitoring/): “What did our competitors post this week, and what took off?” [Page ID lookup](https://okdata.online/apis/facebook/pages/get/) $0.043, [Page posts](https://okdata.online/apis/facebook/pages/posts/list/) $0.043
- [Word of mouth](https://okdata.online/solutions/word-of-mouth/): “What do buyers complain about most?” [Post search](https://okdata.online/apis/facebook/posts/search/) $0.043

## Start in three steps

1. Get a key: [open the console](https://okdata.online/console/). A new key comes with $0.10 to try, no card.
2. Connect your AI with this sentence (swap in your key), or call the API yourself:

   > Set up okdata for me by following https://okdata.online/agents.md. Here is my okdata API key: okd_…. Keep it safe and use it for all okdata calls.

3. Make the first call (Facebook post search). Items arrive in data.items, the next page in page.next_cursor, the charge in meta.billing.amount.

```bash
curl -G "https://api.okdata.online/v1/facebook/posts/search" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'query=espresso machine'
```

## Questions about the Facebook API

### What does the Facebook API cost?

Each of the 5 endpoints has its own price, $0.043 a call; the cheapest is Facebook page ID lookup at $0.043. You pay per call from a prepaid balance, with no subscription. A call that reaches the data source is charged even when it comes back empty, not found or failed; one stopped before that, such as for bad parameters, is free.

### Do I need a Facebook account or cookie?

No. You call https://api.okdata.online with one okdata key and get public Facebook data back; you never use your own Facebook account, cookie or QR login.

### How fresh is the data?

A request reads Facebook when you call, unless the same request was answered a short while ago: then the answer can come from the result cache, with meta.cached: true and meta.fetched_at saying when it was read (lists and searches up to 30 minutes old, one post or product up to 1 hour, profiles up to 6 hours).

### Can my AI agent use the Facebook API?

Yes. Connect the MCP server at https://api.okdata.online/mcp: its find tool lists these 5 endpoints with their prices, and its call tool runs them on your key.

### Can I try it for free?

New accounts get $0.10 of trial credit with no card: enough for 2 calls to Facebook page ID lookup.

## More about Facebook

- [Comments API](https://okdata.online/roles/posts-comments-list/)
- [Comment replies API](https://okdata.online/roles/comments-replies-list/)
- [Post search API](https://okdata.online/roles/posts-search/)

## Other platforms

[Xiaohongshu (RedNote) API](https://okdata.online/apis/xiaohongshu/) · [Douyin API](https://okdata.online/apis/douyin/) · [WeChat Official Accounts API](https://okdata.online/apis/wechat_mp/) · [WeChat Channels API](https://okdata.online/apis/wechat_channels/) · [WeChat Search API](https://okdata.online/apis/wechat/) · [Weibo API](https://okdata.online/apis/weibo/) · [Bilibili API](https://okdata.online/apis/bilibili/) · [Kuaishou API](https://okdata.online/apis/kuaishou/) · [Zhihu API](https://okdata.online/apis/zhihu/) · [Douyin Shop API](https://okdata.online/apis/douyin_shop/) · [Taobao & Tmall API](https://okdata.online/apis/taobao/) · [1688 API](https://okdata.online/apis/alibaba_1688/) · [Xianyu (Goofish) API](https://okdata.online/apis/xianyu/) · [JD.com API](https://okdata.online/apis/jd/) · [Douban Movie API](https://okdata.online/apis/douban/) · [Youku API](https://okdata.online/apis/youku/) · [Toutiao API](https://okdata.online/apis/toutiao/) · [Xigua Video API](https://okdata.online/apis/xigua/) · [Baidu API](https://okdata.online/apis/baidu/) · [All platforms API](https://okdata.online/apis/all/) · [TikTok API](https://okdata.online/apis/tiktok/) · [YouTube API](https://okdata.online/apis/youtube/) · [Instagram API](https://okdata.online/apis/instagram/) · [X (Twitter) API](https://okdata.online/apis/x/) · [Reddit API](https://okdata.online/apis/reddit/) · [Amazon API](https://okdata.online/apis/amazon/) · [AliExpress API](https://okdata.online/apis/aliexpress/) · [Meta Ad Library API](https://okdata.online/apis/meta/) · [Google API](https://okdata.online/apis/google/) · [Telegram API](https://okdata.online/apis/telegram/) · [LinkedIn API](https://okdata.online/apis/linkedin/) · [Bluesky API](https://okdata.online/apis/bluesky/) · [App Store API](https://okdata.online/apis/app_store/) · [Twitch API](https://okdata.online/apis/twitch/) · [IMDb API](https://okdata.online/apis/imdb/)
