# Facebook Groups

Extract posts from public Facebook groups — post text, author, reactions, comments, shares, attached media, @-mentions, and a sample of top comments — by group URL

**Pricing:** $2 / 1k posts

**Endpoint:** `POST /api/v1/agents/facebook/groups/run`

**Auth:** `Authorization: Bearer mk_live_...`

## Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `groupUrls` | array | Yes | Public Facebook group URLs, one per line (e.g. https://www.facebook.com/groups/<group>). |
| `maxResults` | integer | No | Number of posts to scrape per group. |

## Example

```bash
curl -X POST https://api.mindcase.co/api/v1/agents/facebook/groups/run \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"params":{"groupUrls":["..."]}}'
```

```python
import requests

resp = requests.post(
    "https://api.mindcase.co/api/v1/agents/facebook/groups/run",
    headers={"Authorization": "Bearer mk_live_YOUR_API_KEY"},
    json={"params": {
    "groupUrls": [
        "..."
    ]
}},
)
data = resp.json()
```

## Get the results

`run` is async and returns a `job_id`. Poll until `status` is `completed`, then read the rows:

```bash
# 1) check status
curl https://api.mindcase.co/api/v1/jobs/JOB_ID \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY"

# 2) when status == completed, fetch the rows
curl https://api.mindcase.co/api/v1/jobs/JOB_ID/results \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY"
```

Full API reference (auth, jobs, balance, SDKs, MCP): https://mindcase.co/skills.md

## Response columns

| Field | Display name | Type |
|-------|--------------|------|
| `postUrl` | Post URL | url |
| `group` | Group | text |
| `groupUrl` | Group URL | url |
| `postedAt` | Posted At | datetime |
| `text` | Text | text |
| `author` | Author | object |
| `reactions` | Reactions | number |
| `comments` | Comments | number |
| `shares` | Shares | number |
| `linkTitle` | Link Title | text |
| `linkUrl` | Link URL | url |
| `media` | Media | object_array |
| `mentions` | Mentions | object_array |
| `topComments` | Top Comments | object_array |
