# Facebook API — UnifAPI

> Pages, posts, reels, groups, events, Marketplace, Ad Library. Read public Facebook pages, posts, reels, comments, groups, events and Marketplace listings, and search the Meta Ad Library, as unified JSON.

- Category: Social platforms
- API base URL: https://api.unifapi.com
- Auth: `Authorization: Bearer <UnifAPI API key>` (OAuth recommended for MCP clients)
- MCP server: https://mcp.unifapi.com
- Developer docs: https://docs.unifapi.com/api/facebook
- OpenAPI spec: https://unifapi.com/openapi.json
- HTML page: https://unifapi.com/apis/facebook
- Full catalog: https://unifapi.com/apis.md

## Agent workflows

- Pull a public Facebook page's posts, reels, photos, events and comment threads for brand, creator and community research.
- Search the Meta Ad Library by keyword or advertiser and list the ads a page is running for competitive ad intelligence.
- Search Facebook events and Marketplace listings by city or keyword for local demand, pricing and event discovery workflows.

## Endpoints (21)

Every endpoint returns the UnifAPI JSON envelope (`request_id`, `data`, `pagination` on lists, `billing`) and bills max(records × credits per record, minimum) in credits.

### Get a Facebook Ad Library ad

`GET /facebook/ads/{id}`

Returns one ad from the Meta Ad Library by archive id: advertiser, creative, run dates, platforms and, for EU ads, reach and targeting. Set `include_transcript` for a video transcript. Returns `not_found` when the ad does not exist.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/facebook/ads/id/get
- Docs: https://docs.unifapi.com/api/facebook/ads/id/get

### Search Facebook Ad Library ads

`GET /facebook/ads/search`

Searches the Meta Ad Library by keyword with country, status, media type, language and date filters. Paginate with `cursor`.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `query` (query)
- Details: https://unifapi.com/apis/facebook/ads/search/get
- Docs: https://docs.unifapi.com/api/facebook/ads/search/get

### List ads a Facebook Page is running

`GET /facebook/advertisers/{id}/ads`

Returns ads from the Meta Ad Library for one advertiser Page id, with country, status, media type, language and date filters. Find Page ids with /facebook/advertisers/search. Paginate with `cursor`.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/facebook/advertisers/id/ads/get
- Docs: https://docs.unifapi.com/api/facebook/advertisers/id/ads/get

### Search Facebook Ad Library advertisers

`GET /facebook/advertisers/search`

Returns Meta Ad Library advertisers whose name matches a query, with Page ids for /facebook/advertisers/{id}/ads.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `query` (query)
- Details: https://unifapi.com/apis/facebook/advertisers/search/get
- Docs: https://docs.unifapi.com/api/facebook/advertisers/search/get

### Get a Facebook event

`GET /facebook/events/{id}`

Returns one public Facebook event by id: schedule, place, hosts, attendance and tickets. Returns `not_found` when the event does not exist or is not public.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/facebook/events/id/get
- Docs: https://docs.unifapi.com/api/facebook/events/id/get

### List Facebook events for a city

`GET /facebook/events/explore`

Returns public Facebook events for a city from its Facebook Events explore URL, optionally limited to a time window. Paginate with `cursor`.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `url` (query)
- Details: https://unifapi.com/apis/facebook/events/explore/get
- Docs: https://docs.unifapi.com/api/facebook/events/explore/get

### Search Facebook events

`GET /facebook/events/search`

Returns public Facebook events whose name matches a query, with dates, place and attendance. Paginate with `cursor`.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `query` (query)
- Details: https://unifapi.com/apis/facebook/events/search/get
- Docs: https://docs.unifapi.com/api/facebook/events/search/get

### Get a public Facebook group

`GET /facebook/groups/{id}`

Returns a public Facebook group by id or vanity name: name, description, privacy, member count and activity. Returns `not_found` when the group does not exist or is not public.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/facebook/groups/id/get
- Docs: https://docs.unifapi.com/api/facebook/groups/id/get

### List posts in a public Facebook group

`GET /facebook/groups/{id}/posts`

Returns posts from a public Facebook group with text, media, author and engagement counts. Paginate with `cursor`.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/facebook/groups/id/posts/get
- Docs: https://docs.unifapi.com/api/facebook/groups/id/posts/get

### Get a Facebook Marketplace listing

`GET /facebook/marketplace/items/{id}`

Returns one Facebook Marketplace listing by item id: price, description, photos, attributes, seller and delivery options. Returns `not_found` when the listing does not exist or was removed.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `id` (path)
- Details: https://unifapi.com/apis/facebook/marketplace/items/id/get
- Docs: https://docs.unifapi.com/api/facebook/marketplace/items/id/get

### Search Facebook Marketplace locations

`GET /facebook/marketplace/locations/search`

Returns Facebook Marketplace locations that match a place name, with the coordinates /facebook/marketplace/search needs.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `query` (query)
- Details: https://unifapi.com/apis/facebook/marketplace/locations/search/get
- Docs: https://docs.unifapi.com/api/facebook/marketplace/locations/search/get

### Search Facebook Marketplace listings

`GET /facebook/marketplace/search`

Returns Facebook Marketplace listings for a keyword near a latitude and longitude, with price, condition and delivery filters. Paginate with `cursor`.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `query` (query), `lat` (query), `lng` (query)
- Details: https://unifapi.com/apis/facebook/marketplace/search/get
- Docs: https://docs.unifapi.com/api/facebook/marketplace/search/get

### Get a Facebook post or Reel by URL

`GET /facebook/posts`

Returns one public Facebook post or Reel by its URL: author, text, media, music and reaction, comment and share counts. Set `include_comments` or `include_transcript` for a comment sample or a video transcript. Returns `not_found` when the post does not exist or is not public.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `url` (query)
- Details: https://unifapi.com/apis/facebook/posts/get
- Docs: https://docs.unifapi.com/api/facebook/posts/get

### List comments on a Facebook post or Reel

`GET /facebook/posts/comments`

Returns top-level comments on a public Facebook post or Reel by URL. A comment's `replies_cursor` lists its replies through /facebook/posts/comments/replies. Paginate with `cursor`.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `url` (query)
- Details: https://unifapi.com/apis/facebook/posts/comments/get
- Docs: https://docs.unifapi.com/api/facebook/posts/comments/get

### List replies to a Facebook comment

`GET /facebook/posts/comments/replies`

Returns replies to one Facebook comment. Pass the comment's `replies_cursor` as `cursor`, then each response's `pagination.next_cursor` for the next page.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `cursor` (query)
- Details: https://unifapi.com/apis/facebook/posts/comments/replies/get
- Docs: https://docs.unifapi.com/api/facebook/posts/comments/replies/get

### Get the transcript of a Facebook video post

`GET /facebook/posts/transcript`

Returns the spoken-word transcript of a public Facebook video post or Reel by URL, for videos up to a few minutes long. Returns `not_found` when the post does not exist.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `url` (query)
- Details: https://unifapi.com/apis/facebook/posts/transcript/get
- Docs: https://docs.unifapi.com/api/facebook/posts/transcript/get

### Get a Facebook profile or Page

`GET /facebook/profiles/{username}`

Returns a public Facebook profile or Page by username: name, category, intro, follower and like counts, contact details and business information. Returns `not_found` when it does not exist or is not public.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `username` (path)
- Details: https://unifapi.com/apis/facebook/profiles/username/get
- Docs: https://docs.unifapi.com/api/facebook/profiles/username/get

### List events hosted by a Facebook profile or Page

`GET /facebook/profiles/{username}/events`

Returns public events hosted by a Facebook profile or Page with dates, place and attendance. Paginate with `cursor`.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `username` (path)
- Details: https://unifapi.com/apis/facebook/profiles/username/events/get
- Docs: https://docs.unifapi.com/api/facebook/profiles/username/events/get

### List photos from a Facebook profile or Page

`GET /facebook/profiles/{username}/photos`

Returns public photos from a Facebook profile or Page with image URLs and captions. Paginate with `cursor`.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `username` (path)
- Details: https://unifapi.com/apis/facebook/profiles/username/photos/get
- Docs: https://docs.unifapi.com/api/facebook/profiles/username/photos/get

### List posts from a Facebook profile or Page

`GET /facebook/profiles/{username}/posts`

Returns recent public posts from a Facebook profile or Page with text, media and reaction, comment and share counts. Paginate with `cursor`.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `username` (path)
- Details: https://unifapi.com/apis/facebook/profiles/username/posts/get
- Docs: https://docs.unifapi.com/api/facebook/profiles/username/posts/get

### List Reels from a Facebook profile or Page

`GET /facebook/profiles/{username}/reels`

Returns public Reels from a Facebook profile or Page with captions, play counts and video URLs. Paginate with `cursor`.

- Price: 1 credit per record, minimum 3 credits ($0.003) per call
- Required: `username` (path)
- Details: https://unifapi.com/apis/facebook/profiles/username/reels/get
- Docs: https://docs.unifapi.com/api/facebook/profiles/username/reels/get

## Related APIs

- [Bluesky API](https://unifapi.com/apis/bluesky/index.md) — Profiles, posts, replies
- [Reddit API](https://unifapi.com/apis/reddit/index.md) — Subreddits, posts, comments, feeds, search
- [Pinterest API](https://unifapi.com/apis/pinterest/index.md) — Pins, boards, search
- [Threads API](https://unifapi.com/apis/threads/index.md) — Posts, replies, reposts, search
- [Snapchat API](https://unifapi.com/apis/snapchat/index.md) — Public profiles, Spotlight videos, comments
- [Twitter / X API](https://unifapi.com/apis/twitter/index.md) — Users, posts, search, trends, lists, communities
