> ## Documentation Index
> Fetch the complete documentation index at: https://getanyapi.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Facebook Profile Posts

> Sell facebook.profile_posts on AnyAPI: the request your endpoint receives, the response it must return, and what the live trial grades.

List a Facebook page's recent posts by URL or page id with cursor pagination (text, author, publication time, permalink).

This page is the seller-facing summary of one catalog API, `facebook.profile_posts`. The transport rules that apply to every API a seller serves - signed requests, the response envelope, timeouts, and body limits - are on [the operator endpoint contract](https://getanyapi.com/docs/sell/operator-endpoint-contract.md).

## The price you compete with

AnyAPI publishes this API from **\$1.20 per 1,000 requests**. That is the price a buyer sees today, so it is the price your endpoint has to come in under to win traffic.

## The request your endpoint receives

This API takes no input fields.

> **Full input JSON Schema**
>
> ```json theme={"dark"}
> {
>   "$schema": "https://json-schema.org/draft/2020-12/schema",
>   "$id": "https://getanyapi.com/schemas/facebook.profile_posts.input.json",
>   "example": {
>     "url": "https://www.facebook.com/nike"
>   },
>   "title": "Facebook profile posts input",
>   "type": "object",
>   "additionalProperties": false,
>   "properties": {
>     "url": {
>       "type": "string",
>       "pattern": "^(?:[Hh][Tt][Tt][Pp][Ss]?://)?(?:(?:[Ww][Ww][Ww]|[Mm]|[Mm][Bb][Aa][Ss][Ii][Cc]|[Ww][Ee][Bb]|[Bb][Uu][Ss][Ii][Nn][Ee][Ss][Ss]|[A-Za-z]{2}-[A-Za-z]{2})\\.)?(?:[Ff][Aa][Cc][Ee][Bb][Oo][Oo][Kk]|[Ff][Bb])\\.[Cc][Oo][Mm]/+[^/?#]",
>       "not": {
>         "pattern": "^(?:[A-Za-z]+://)?[^/?#]*/+(?:(?:events|groups|reels?|videos|watch|stories|hashtag|search|sharer|photo|plugins|legal|login|help|privacy)(?:[/?#]|$)|share/?(?:[?#]|$)|share/[A-Za-oq-z](?:[/?#]|$)|(?:[^/?#]{0,6}|[^/?#]{8,}|[^p/?#][^/?#]{6}|p[^r/?#][^/?#]{5}|pr[^o/?#][^/?#]{4}|pro[^f/?#][^/?#]{3}|prof[^i/?#][^/?#]{2}|profi[^l/?#][^/?#]|profil[^e/?#])\\.php(?:[/?#]|$))"
>       },
>       "description": "Facebook page or profile link, e.g. https://www.facebook.com/nike. Accepted: facebook.com/<name>, /p/<name>-<id>, /pages/<name>/<id>, /pg/<name>, /people/<name>/<id>, profile.php?id=<id>, and share links to a page (/share/<id> or /share/p/<id>), on facebook.com or fb.com with or without www, m, mbasic, web, business or a language subdomain. Anything after the page, such as a tab, is fine. Any other Facebook link, such as a single event, group, reel, video, video or reel share link (/share/v/ or /share/r/), hashtag, search or login page, is refused as invalid input, with no charge; facebook.event_details reads one event and facebook.post reads one post."
>     },
>     "pageId": {
>       "type": "string",
>       "description": "Facebook page id."
>     },
>     "cursor": {
>       "type": "string",
>       "description": "Pagination cursor from a previous response."
>     },
>     "requireFields": {
>       "type": "array",
>       "uniqueItems": true,
>       "items": {
>         "type": "string",
>         "enum": [
>           "shares"
>         ]
>       },
>       "description": "Optional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `shares`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. This can raise your price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on a post that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge."
>     }
>   },
>   "anyOf": [
>     {
>       "required": [
>         "url"
>       ]
>     },
>     {
>       "required": [
>         "pageId"
>       ]
>     }
>   ]
> }
> ```

## The response your endpoint must return

| Field | Type | Always present | What it means |
| - | - | - | - |
| `data` | null or object | yes | |
| `data.nextCursor` | string or null | yes | Opaque cursor for the next page of posts, or null when this lane has no more. Pass it back as cursor to continue. |
| `data.posts` | array | yes | |
| `data.posts[].author` | string | yes | |
| `data.posts[].authorId` | string | no | Numeric Facebook id of the page or profile that posted, as a string. |
| `data.posts[].comments` | integer | no | Comment count on the post. |
| `data.posts[].createdUtc` | number | yes | UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds. |
| `data.posts[].id` | string | yes | |
| `data.posts[].image` | string | no | Preview image or video thumbnail URL for the post. |
| `data.posts[].likes` | integer | no | Total reaction count on the post. |
| `data.posts[].media` | array | no | Photo, video, and GIF attachments on the post. Empty when the post has none. |
| `data.posts[].media[].height` | integer | no | Pixel height of the media item, when the lane reports it. |
| `data.posts[].media[].type` | string | yes | One of photo, video, or gif. |
| `data.posts[].media[].url` | string | yes | Image URL. For a video or GIF this is the poster/thumbnail frame. |
| `data.posts[].media[].videoUrl` | string | no | Playable video file URL. Present only for video and gif items. |
| `data.posts[].media[].width` | integer | no | Pixel width of the media item, when the lane reports it. |
| `data.posts[].reactions` | object | yes | Reaction counts on the post, broken down by reaction type. |
| `data.posts[].reactions.angry` | integer | no | Angry reactions. |
| `data.posts[].reactions.care` | integer | no | Care reactions. |
| `data.posts[].reactions.haha` | integer | no | Haha reactions. |
| `data.posts[].reactions.like` | integer | no | Like reactions. |
| `data.posts[].reactions.love` | integer | no | Love reactions. |
| `data.posts[].reactions.sad` | integer | no | Sad reactions. |
| `data.posts[].reactions.wow` | integer | no | Wow reactions. |
| `data.posts[].shares` | integer or null | no | Number of times the post was shared. Null when this source does not report it. |
| `data.posts[].text` | string | yes | |
| `data.posts[].url` | string | yes | |
| `found` | boolean | yes | |

Extra fields are kept, missing declared fields fail.

> **Full output JSON Schema**
>
> ```json theme={"dark"}
> {
>   "$schema": "https://json-schema.org/draft/2020-12/schema",
>   "$id": "https://getanyapi.com/schemas/facebook.profile_posts.output.json",
>   "title": "Facebook profile posts output",
>   "type": "object",
>   "additionalProperties": false,
>   "required": [
>     "found",
>     "data"
>   ],
>   "properties": {
>     "found": {
>       "type": "boolean"
>     },
>     "data": {
>       "oneOf": [
>         {
>           "type": "null"
>         },
>         {
>           "type": "object",
>           "additionalProperties": false,
>           "required": [
>             "posts",
>             "nextCursor"
>           ],
>           "properties": {
>             "nextCursor": {
>               "type": [
>                 "string",
>                 "null"
>               ],
>               "description": "Opaque cursor for the next page of posts, or null when this lane has no more. Pass it back as cursor to continue."
>             },
>             "posts": {
>               "x-anyapi-must-populate": true,
>               "type": "array",
>               "items": {
>                 "type": "object",
>                 "required": [
>                   "id",
>                   "text",
>                   "url",
>                   "author",
>                   "createdUtc",
>                   "reactions"
>                 ],
>                 "properties": {
>                   "id": {
>                     "x-anyapi-must-populate": true,
>                     "type": "string"
>                   },
>                   "text": {
>                     "x-anyapi-must-populate": true,
>                     "type": "string"
>                   },
>                   "url": {
>                     "x-anyapi-must-populate": true,
>                     "type": "string"
>                   },
>                   "author": {
>                     "x-anyapi-must-populate": true,
>                     "type": "string"
>                   },
>                   "createdUtc": {
>                     "x-anyapi-must-populate": true,
>                     "type": "number",
>                     "description": "UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds."
>                   },
>                   "media": {
>                     "type": "array",
>                     "description": "Photo, video, and GIF attachments on the post. Empty when the post has none.",
>                     "items": {
>                       "type": "object",
>                       "required": [
>                         "type",
>                         "url"
>                       ],
>                       "properties": {
>                         "type": {
>                           "type": "string",
>                           "description": "One of photo, video, or gif."
>                         },
>                         "url": {
>                           "type": "string",
>                           "format": "uri",
>                           "description": "Image URL. For a video or GIF this is the poster/thumbnail frame."
>                         },
>                         "videoUrl": {
>                           "type": "string",
>                           "format": "uri",
>                           "description": "Playable video file URL. Present only for video and gif items."
>                         },
>                         "width": {
>                           "type": "integer",
>                           "description": "Pixel width of the media item, when the lane reports it."
>                         },
>                         "height": {
>                           "type": "integer",
>                           "description": "Pixel height of the media item, when the lane reports it."
>                         }
>                       }
>                     }
>                   },
>                   "authorId": {
>                     "type": "string",
>                     "description": "Numeric Facebook id of the page or profile that posted, as a string."
>                   },
>                   "likes": {
>                     "type": "integer",
>                     "description": "Total reaction count on the post."
>                   },
>                   "comments": {
>                     "type": "integer",
>                     "description": "Comment count on the post."
>                   },
>                   "image": {
>                     "type": "string",
>                     "description": "Preview image or video thumbnail URL for the post."
>                   },
>                   "reactions": {
>                     "type": "object",
>                     "description": "Reaction counts on the post, broken down by reaction type.",
>                     "properties": {
>                       "like": {
>                         "type": "integer",
>                         "description": "Like reactions."
>                       },
>                       "love": {
>                         "type": "integer",
>                         "description": "Love reactions."
>                       },
>                       "care": {
>                         "type": "integer",
>                         "description": "Care reactions."
>                       },
>                       "haha": {
>                         "type": "integer",
>                         "description": "Haha reactions."
>                       },
>                       "wow": {
>                         "type": "integer",
>                         "description": "Wow reactions."
>                       },
>                       "sad": {
>                         "type": "integer",
>                         "description": "Sad reactions."
>                       },
>                       "angry": {
>                         "type": "integer",
>                         "description": "Angry reactions."
>                       }
>                     }
>                   },
>                   "shares": {
>                     "type": [
>                       "integer",
>                       "null"
>                     ],
>                     "description": "Number of times the post was shared. Null when this source does not report it."
>                   }
>                 }
>               }
>             }
>           }
>         }
>       ]
>     }
>   }
> }
> ```

## Fields that must never come back empty

* `author`
* `createdUtc`
* `id`
* `posts`
* `text`
* `url`

The repository marks these fields as ones every source must be able to fill. An empty value is only correct when the entity itself genuinely has nothing there.

## Not found, and how it differs from empty

When the entity does not exist, answer 2xx with the not-found shape:

```json theme={"dark"}
{
  "found": false,
  "data": null
}
```

An empty list is not a not-found: when the entity exists and has nothing to return, answer 2xx with `found: true` and an empty `posts` array.

This output schema declares no `reason` field, so `found: false` is the whole not-found answer.

## Example request

```json theme={"dark"}
{
  "url": "https://www.facebook.com/nike"
}
```

The compatibility checks fire the schema's example at your endpoint. After that, your answers are graded against what the currently serving source returned for the same real customer inputs.

## Next

* [The operator endpoint contract](https://getanyapi.com/docs/sell/operator-endpoint-contract.md) for signing, budgets, and the live trial.
* [Every API open to sellers](https://getanyapi.com/docs/sell/apis/index.md).
* Want to sell an API that is not on that list? Email [support@getanyapi.com](mailto:support@getanyapi.com).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.