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

# Facebook Posts Search API

> Get Facebook posts with post url, query, content type, posted at, text, reactions, by search keywords.

`POST /v1/data/facebook/posts-search/run`

**Pricing:** $0.005 per post ($5.00 per 1,000).

## Request

Send the inputs under `params`. Only the keys below are accepted; any other key returns `422 invalid_params`.

**queries** `string[]` *required*

One or more search keywords. One request reads them all.

**maxResults** `integer` (default: 100)

How many posts to return in total. Defaults to 100; use 0 for all.

Max `1000`.

**sortBy** `string` (default: top)

Sort By to use. Top (popular, any age) by default.

Allowed values: `top` (Top (popular, any age)), `recent` (Most recent first).

**startDate** `string`

Start Date.

**endDate** `string`

End Date.

## Example

```bash cURL theme={null}
curl -X POST "https://api.mindcase.co/v1/data/facebook/posts-search/run?wait=true" \
  -H "Authorization: Bearer $MINDCASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "params": {
    "queries": [
      "Tesla Cybertruck",
      "NASA Artemis",
      "Oktoberfest München"
    ],
    "maxResults": 10
  }
}'
```

```python Python theme={null}
import os, requests

r = requests.post(
    "https://api.mindcase.co/v1/data/facebook/posts-search/run",
    params={"wait": "true"},
    headers={"Authorization": f"Bearer {os.environ['MINDCASE_API_KEY']}"},
    json={"params": {
    "queries": [
        "Tesla Cybertruck",
        "NASA Artemis",
        "Oktoberfest München"
    ],
    "maxResults": 10
}},
)
job = r.json()
rows = job.get("data", [])  # if job["status"] == "running", poll /v1/jobs/{job_id}/results
```

```javascript Node.js theme={null}
const r = await fetch("https://api.mindcase.co/v1/data/facebook/posts-search/run?wait=true", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MINDCASE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ params: {
  "queries": [
    "Tesla Cybertruck",
    "NASA Artemis",
    "Oktoberfest München"
  ],
  "maxResults": 10
} }),
});
const job = await r.json();
const rows = job.data ?? []; // if job.status === "running", poll /v1/jobs/{job_id}/results
```

## Response fields

Each row in `data` is one post, keyed by these fields.

| Field | Name | Type |
| - | - | - |
| `postId` | Post ID | text |
| `postUrl` | Post URL | url |
| `query` | Query | text |
| `contentType` | Content Type | text |
| `postedAt` | Posted At | datetime |
| `text` | Text | text |
| `reactions` | Reactions | number |
| `comments` | Comments | number |
| `shares` | Shares | number |
| `videoDuration` | Video Duration | number |
| `reactionBreakdown` | Reaction Breakdown | object |
| `author` | Author | object |
| `source` | Source | object |
| `media` | Media | object |
| `hashtags` | Hashtags | array |

## Example response

Abridged: long text and lists are shortened.

```json theme={null}
{
  "job_id": "7f3a1c2e-0b9d-4c55-9a51-3f2e8d1b6a40",
  "agent": "facebook/posts-search",
  "status": "completed",
  "row_count": 1,
  "truncated": false,
  "data": [
    {
      "author": {
        "name": "KTVU Fox 2",
        "url": "https://www.facebook.com/ktvu",
        "id": "100064799227930",
        "avatar": "https://scontent-man2-1.xx.fbcdn.net/v/t39.30808-1/631003691_1345194824317146_3382256477190074275_n.jpg?stp=cp0_dst-jpg_s80x80_tt6&_nc_cat=1&ccb=1-7&_nc_sid=...",
        "type": null,
        "isBusinessPage": null
      },
      "reactionBreakdown": {
        "angry": 2,
        "care": 22,
        "haha": 6372,
        "like": 3249,
        "love": 381,
        "sad": 35,
        "wow": 63
      },
      "source": null,
      "postedAt": "2026-11-06T16:00:28.000Z",
      "videoDuration": null,
      "contentType": "PHOTO",
      "media": {
        "type": "PHOTO",
        "url": "https://scontent-man2-1.xx.fbcdn.net/v/t39.30808-6/861364499_1594789716024321_7498237534395215634_n.jpg?_nc_cat=103&ccb=1-7&_nc_sid=127cfc&_nc_ohc=WM00qEFE5t...",
        "videoUrl": null,
        "thumbnailUrl": null,
        "imageCount": 1,
        "imageAlt": null
      },
      "shares": 1102,
      "postUrl": "https://www.facebook.com/ktvu/posts/pfbid0VPmje2WmMn6DNnnJ2TmiEfWo2wSauqkpLEq4ep6ARoxB6nSuAxGaBrfjV577f63bl",
      "text": "Tesla’s futuristic, polarizing Cybertruck is “winding down” production starting next year.",
      "comments": 2105,
      "query": "Tesla Cybertruck",
      "reactions": 10124,
      "postId": "1594789749357651",
      "hashtags": null
    }
  ]
}
```

## Related APIs

For all posts from a known page use [`facebook/posts`](https://docs.mindcase.co/apis/facebook/posts); for comments use [`facebook/comments`](https://docs.mindcase.co/apis/facebook/comments).


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