# Mastodon User Posts (`mastodon.user_posts`)

Latest public posts of a Mastodon account, with reply, boost and favourite counts.

- **Route:** `POST /v1/run/mastodon.user_posts`
- **Price:** $0.0011 per request ($1.10 per 1,000) · `cost_usd` on every response
- **Source:** Mastodon instance API (`mastodon`) · failover: no
- **Measured latency:** p50 2018 ms · p95 2018 ms · p99 2018 ms (1 calls, 30d)
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `handle` | string | yes |  | user, user@instance or profile URL |
| `instance` | string | no | "mastodon.social" | Mastodon server host name |
| `limit` | integer | no | 20 | Posts to return |
| `include_replies` | boolean | no | false | Include replies |
| `include_boosts` | boolean | no | false | Include boosts |
| `max_id` | string | no |  | Return posts older than this id |

## Output (`output` in the run envelope)

| Field | Meaning |
|---|---|
| `posts` | id, created_at, text, replies, boosts, favourites, tags, media, url. |
| `count` | Posts returned. |
| `next_max_id` | Pass as max_id for older posts. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/mastodon.user_posts \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"handle":"Gargron@mastodon.social","limit":5}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('mastodon.user_posts', {'handle': 'Gargron@mastodon.social', 'limit': 5})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run mastodon.user_posts '{"handle":"Gargron@mastodon.social","limit":5}'
```

Quote first (free, validates input): `POST /v1/quote/mastodon.user_posts` with the same body.
