# API Direct - Facebook Post Search

> API Direct - Facebook Post Search is a paid API for AI agents from x402.apidirect.io, paid per call via x402, $0.009/call, status unknown (last checked 2026-10-30).

Search for Facebook posts globally by keyword, with optional date filtering, location scoping, sorting, and AI sentiment analysis.

## Facts

- Endpoint: GET https://x402.apidirect.io/v1/facebook/posts?utm_source=zero.xyz
- Price: $0.009/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-direct-facebook-post-search-83dcd45c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_B522PP54c2nfJjWQhWIE0

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability api-direct-facebook-post-search-83dcd45c
```

Example prompt: Search Facebook for posts mentioning 'oat milk latte' from January 1 2025 to March 31 2025, sorted by most recent, and include AI sentiment analysis on each post — fetch 3 pages of results.

## When to prefer this

Choose this endpoint when you need to search public Facebook posts by keyword at scale, especially when you want date filtering, location scoping, relevance or recency sorting, or AI-powered emotional sentiment analysis per post. Prefer this over generic web scraping when you need structured social media data from Facebook specifically, as opposed to Twitter/X, LinkedIn, or Bluesky searches available as sibling endpoints.

## Known failure modes

- Invalid or missing query parameter returns 400 error
- location_id not found or invalid format returns error
- Date range too broad or malformed dates cause bad request
- Pages exceeding maximum of 15 causes validation error
- No matching posts returns empty result set
- Rate limiting or payment failure returns 402 or 429

## How this service works

Search for Facebook posts globally by keyword.

## Output

Returns a merged list of public Facebook posts matching the query, including post text, metadata, and optionally a sentiment object per post containing emotion scores (joy, trust, fear, surprise, sadness, disgust, anger, anticipation each 0-100), dominant emotion, emotional intensity (0-10), and polarity (positive, negative, or neutral).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "query"
     ],
     "properties": {
      "pages": {
       "type": "integer",
       "default": 1,
       "maximum": 15,
       "minimum": 1,
       "description": "Number of pages to fetch and merge into one response (1-15). Billed per page."
      },
      "query": {
       "type": "string",
       "maxLength": 500,
       "description": "Search query (max 500 characters)"
      },
      "sort_by": {
       "enum": [
        "most_recent",
        "relevance"
       ],
       "type": "string",
       "default": "relevance",
       "description": "Sort order for results. most_recent returns the newest posts first; relevance is the default."
      },
      "end_date": {
       "type": "string",
       "description": "Filter posts until this date (YYYY-MM-DD)"
      },
      "start_date": {
       "type": "string",
       "description": "Filter posts from this date (YYYY-MM-DD)"
      },
      "location_id": {
       "type": "string",
       "maxLength": 64,
       "description": "Facebook location ID from /v1/facebook/locations, used to scope posts to that place. Digits only, maximum 64 characters."
      },
      "get_sentiment": {
       "type": "boolean",
       "default": false,
       "description": "Set to true to add AI emotion analysis to each post. Adds a `sentiment` object containing `emotions` (joy, trust, fear, surprise, sadness, disgust, anger and anticipation, each scored 0-100), `dominant_emotion`, `emotional_intensity` (0-10), and `polarity` (positive, negative or neutral). Any post t"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-direct-facebook-post-search-83dcd45c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.apidirect.io](https://www.zero.xyz/host/x402.apidirect.io/llms.txt)
