# Mastodon Hashtag Posts (`mastodon.hashtag_posts`)

Latest public posts with a hashtag as seen by a Mastodon instance.

- **Route:** `POST /v1/run/mastodon.hashtag_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 175 ms · p95 175 ms · p99 175 ms (1 calls, 30d)
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `hashtag` | string | yes |  | Hashtag without # |
| `instance` | string | no | "mastodon.social" | Mastodon server host name |
| `limit` | integer | no | 20 | Posts to return |
| `max_id` | string | no |  | Return posts older than this id |

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

| Field | Meaning |
|---|---|
| `posts` | id, created_at, text, author, replies, boosts, favourites, 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.hashtag_posts \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"hashtag":"opensource","limit":5}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('mastodon.hashtag_posts', {'hashtag': 'opensource', 'limit': 5})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run mastodon.hashtag_posts '{"hashtag":"opensource","limit":5}'
```

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