All endpoints
Facebook Search Posts

Facebook Search Posts API

Search Facebook posts by keyword across all of Facebook. Returns post content, engagement metrics (reactions, comments, shares), author data, and media. Supports pagination and date filtering.

Price: $0.008 per page
Free tier: 50 requests/month
Endpoint
GET /v1/facebook/posts

Parameters

query *
Search keyword (max 500 characters)
pages
Number of pages to fetch (1-10, default 1). Billed per page.
start_date
Filter posts from this date (YYYY-MM-DD)
end_date
Filter posts until this date (YYYY-MM-DD)
sort_by
Sort order: most_recent or relevance (default: relevance)

Response fields

posts
Array of matching posts
post_id
Post ID
url
Direct link to the post
message
Post text content
date
Publication date and time
timestamp
Unix timestamp
author_name
Author display name
author_id
Author Facebook ID
author_url
Author profile URL
author_profile_picture
Author profile image URL
comments_count
Number of comments
reactions_count
Total number of reactions
reshare_count
Number of shares
reactions
Breakdown of reaction types
image_url
Attached image URL
video
Attached video data
external_url
External link in the post
count
Number of posts returned
pages
Number of pages fetched

Example Request

curl "https://apidirect.io/v1/facebook/posts?query=artificial%20intelligence&start_date=2026-01-01" \
  -H "X-API-Key: YOUR_API_KEY"

Example Response

{
  "posts": [
    {
      "post_id": "100087654321_998877665544",
      "url": "https://www.facebook.com/permalink.php?id=100087654321&story_fbid=998877665544",
      "message": "The latest breakthroughs in artificial intelligence are truly remarkable. Here is what caught my attention this week...",
      "date": "2026-03-01 11:00:00",
      "timestamp": 1772445600,
      "author_name": "Tech Daily",
      "author_id": "100087654321",
      "author_url": "https://www.facebook.com/TechDaily",
      "author_profile_picture": "https://scontent.xx.fbcdn.net/v/t39.30808-1/...",
      "comments_count": 89,
      "reactions_count": 1540,
      "reshare_count": 320,
      "reactions": {"like": 900, "love": 350, "wow": 180, "haha": 10, "sad": 50, "angry": 50},
      "image_url": "https://scontent.xx.fbcdn.net/v/t39.30808-6/...",
      "video": null,
      "external_url": null
    }
  ],
  "count": 1,
  "pages": 1
}

Frequently asked questions

What Facebook content can I search?

You can search all public Facebook posts including posts from pages, public groups, and public user profiles. Private content is not accessible.

How does date filtering work?

Use start_date and end_date in YYYY-MM-DD format to narrow results to a specific time range. You can use one or both parameters.

How does pagination work?

Use the pages parameter to fetch multiple pages of results in a single request (1-10). Each page is billed separately. Default is 1 page.

How does pricing work?

You only pay for successful requests. The Facebook Search Posts API costs $0.008 per page. There are no monthly fees or commitments. You get 50 free requests per endpoint every month.

Do I need a credit card to start?

No. You can sign up and use the free tier (50 requests/endpoint/month) without adding a payment method. You only need to add a card when you want to exceed the free tier.

Are there rate limits?

Yes, there's a concurrency limit of 3 simultaneous requests per endpoint per user. If you need more, just get in touch.

Start using the Facebook Search Posts API

Get your API key and start making requests in minutes. 50 requests/month free every month.

Get API Key