# Mastodon Trending (`mastodon.trending`)

Posts or hashtags trending right now on a Mastodon instance.

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

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `instance` | string | no | "mastodon.social" | Mastodon server host name |
| `type` | string | no | "posts" | What to list |
| `limit` | integer | no | 10 | Entries to return |

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

| Field | Meaning |
|---|---|
| `posts` | Trending posts (type=posts). |
| `tags` | Trending hashtags with today's uses (type=tags). |
| `count` | Entries returned. |

## Example

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

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

```bash
getallapis run mastodon.trending '{"type":"tags","limit":5}'
```

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