Facebook API

Facebook Posts API

Send a Page's username or URL and get its newest posts back as JSON, each with its text, images, reactions by type, comment and share counts, and the comments Facebook shows under it.

  • 100 free credits
  • No card needed
  • No scraper to build or maintain
curl "https://pipefetch.com/v1/facebook/posts?page=NASA" \
  -H "x-api-key: YOUR_API_KEY"
The response

What you get

  • Up to 6 of the Page's newest posts, newest first
  • The text of each post, its publish time, its kind (photo, album and so on) and a direct link
  • Reactions in total and by type, and the comment and share counts
  • Image addresses, with Facebook's own description of each image
  • The one or two comments Facebook shows under each post, with their authors
  • The Page: name, username, picture, verified badge and ids
200 OK · application/json
{
  "data": {
    "page": {
      "id": "100044561550831",
      "pageId": "54971236771",
      "name": "NASA - National Aeronautics and Space Administration",
      "username": "NASA",
      "url": "https://www.facebook.com/NASA",
      "pictureUrl": "https://scontent.fdiy5-1.fna.fbcdn.net/v/t39.30808-1/243095782_416661036495945_3843362260429099279_n.png?stp=cp0_dst-png&cstp=mx800x800&ctp=s80x80&_nc…",
      "isVerified": true
    },
    "posts": [
      {
        "id": "1690599575768745",
        "url": "https://www.facebook.com/NASA/posts/pfbid02qMqopthTdbHgkFCRbWZtHXiGBNnfziY3Z7fWypDp97m6rBvsicuB9GCbPicwsuXyl",
        "text": "Beauty in chaos 🎨\n\nThis photo from our Chandra X-ray Observatory is the clearest view we have of the remains of an exploded star located in the cente…",
        "publishedAt": "2026-11-17T22:03:34.000Z",
        "mediaType": "photo",
        "reactionCount": 2192,
        "reactions": {
          "like": 1544,
          "love": 569,
          "care": 41,
          "haha": 5,
          "wow": 30,
          "sad": 1,
          "angry": 2
        },
        "commentCount": 76,
        "shareCount": 216,
        "imageUrls": [
          "https://scontent.fdiy5-2.fna.fbcdn.net/v/t39.30808-6/916765074_1690599559102080_8008653452099091270_n.jpg?stp=dst-jpg_tt6&cstp=mx2048x2048&ctp=s1080x2…"
        ],
        "imageDescriptions": [
          "A supernova remnant looks like colorful paints swirling together set against the darkness of space. At the heart of the image is a light purple cloud …"
        ],
        "photoCount": null,
        "mentions": [
          "Chandra X-ray Observator"
        ],
        "links": [],
        "topComments": [
          {
            "id": "0000000000",
            "url": "https://example.com/item",
            "text": "Gorgeous, and also the cosmic version of opening the junk drawer: everything is in there, nothing is where you left it, and somehow it all works.",
            "createdAt": "2026-11-18T00:24:09.000Z",
            "reactionCount": 0,
            "replyCount": 0,
            "author": {
              "id": "0000000000",
              "name": "Example Person",
              "pictureUrl": "https://example.com/avatar.jpg"
            }
          }
        ]
      },
      {
        "id": "1689621505866552",
        "url": "https://www.facebook.com/NASA/posts/pfbid02YYhrmGfpDcZvaKTvKEiUgsLzsL1D5fYeXR7on6JofKnUkLCwPbMR4KenTohd22S3l",
        "text": "You could walk on the Moon someday.\n\nWe are accepting applications for our next class of astronauts until Dec. 3. Hear about the application process a…",
        "publishedAt": "2026-11-16T21:18:01.000Z",
        "mediaType": "photo",
        "reactionCount": 814,
        "reactions": {
          "like": 630,
          "love": 157,
          "care": 15,
          "haha": 5,
          "wow": 5,
          "sad": 0,
          "angry": 2
        },
        "commentCount": 71,
        "shareCount": 83,
        "imageUrls": [
          "https://scontent.fdiy5-1.fna.fbcdn.net/v/t39.99422-6/910466255_1835901000787898_7791381628991831660_n.png?stp=dst-jpg_tt6&cstp=mx1920x1080&ctp=s1920x1…"
        ],
        "imageDescriptions": [
          "An artist's concept of astronauts performing Moon Base operations on the lunar surface. Text on the image reads, \"Houston We Have a Podcast\" and \"This…"
        ],
        "photoCount": null,
        "mentions": [],
        "links": [
          "https://go.nasa.gov/4C7G3xx"
        ],
        "topComments": []
      }
    ]
  },
  "credits": {
    "used": 2,
    "remaining": 98
  }
}
Reference

One GET request

Everything the endpoint accepts. The full reference, with the complete example response, is in the docs.

GET/v1/facebook/posts

Costs 2 credits per request. Only requests that return data are charged.

Parameters

NameTypeDescription
pagerequired string The Page's username (NASA), its numeric id, or its URL (https://www.facebook.com/NASA).
limitoptional integer How many of the newest posts to return. Default: 6. From 1 to 6.

Good to know

  • The newest posts of the Page, newest first, at most 6 per request. There is no paging to older ones.
  • A request costs 2 credits, because Facebook only answers it from residential internet connections, which cost us more than an ordinary request.
  • topComments holds the one or two comments Facebook shows under a post on the Page, not the full list. The comments endpoint returns more.
  • mediaType says what a post is, such as photo, album, video or link. Image addresses are included and stop working after a while; video file addresses, view counts and link previews are not included.
  • A Page that does not exist answers 404 page_not_found, and one that shows no posts to visitors who are not logged in answers 404 no_posts. Neither costs anything.

Open the reference

Use cases

What people build with it

  • Watch what competitors post

    Read the newest posts of the Pages in your market, with how each one was received.

  • Track engagement

    Call the endpoint on a schedule and store reactions, comments and shares to see how each post performs.

  • Content feeds

    Show a Page's latest posts in your own app, report or newsletter.

  • Posts for an AI model

    Hand a model the latest posts of a Page as JSON, to summarize them or to sort them by topic.

Pricing

Buy credits once. Use them whenever.

This endpoint costs 2 credits per request, and a request that returns no data costs nothing. Move the slider to see what your volume costs.

5,000credits a month
5005,00050,000250,000
5,000requests at 1 credit
2,500requests at 2 credits

Each endpoint says what a request costs. Requests that return nothing are free.

Best fit
Builder pack
12,000 credits, one-time payment
$29once
  • $2.42 per 1,000 credits
  • About $12.08 a month at this pace
  • Lasts about 2.4 months at this pace
  • Credits never expire
Start with 100 free credits

See all packs and what a credit buys

FAQ

Questions and answers

Is this the official Facebook API?

No. Pipefetch is an independent service and is not affiliated with Facebook or Meta. It returns the posts a Page shows to a visitor who is not logged in. You need one Pipefetch API key. There is no Facebook login, no cookie, no access token and no Meta app.

How many posts do I get?

Up to 6 of the newest per request. Older posts and date ranges are not available.

Do I get the comments?

You get the one or two comments Facebook shows under each post on the Page. For more, pass the url of a post to the comments endpoint.

Are videos included?

A video post comes back with its text and its counts, and mediaType says that it is a video. The address of the video file, view counts and link previews are not included.

What if a Page has no posts?

A Page that shows no posts to visitors who are not logged in answers 404 no_posts, and a Page that does not exist answers 404 page_not_found. Neither is charged.

Why does a request cost 2 credits?

Facebook only answers this request from residential internet connections, which cost us more than an ordinary request, so it costs 2 credits. Credit packs start at $9 for 3,000 credits, never expire, and a request that returns no data is not charged. New accounts get 100 free credits without a card.

Do the posts contain personal data?

Yes. The comments under a post carry the public names and pictures of the people who wrote them, and a Page can belong to a person. That is personal data. If you store or process it, data-protection law such as the GDPR applies to you as it would to any other source, and our terms forbid using the API to harass people or to build profiles of private individuals.

Guides

Step-by-step guides

Free tools

Free tools for the same data

More

More Facebook APIs

Also on the same key

Other sources

Make your first request in a minute

Sign in, copy your key and call an endpoint. Your account starts with 100 free credits.