# Mastodon Hashtag API Documentation

Read the public timeline for a hashtag on any Mastodon instance. Returns an array of status objects tagged with the given hashtag. Use max_id or min_id from the Link header for pagination. Supports filtering by media, local/remote, and tag combinations.

- **Documentation:** [https://scrappa.co/docs/mastodon-api/mastodon_hashtag](https://scrappa.co/docs/mastodon-api/mastodon_hashtag)
- **API group:** Mastodon API
- **Endpoint:** `GET https://scrappa.co/api/mastodon/hashtag`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `instance` | string | No | Public Mastodon hostname. Defaults to mastodon.social. |
| `tag` | string | Yes | Hashtag without the # prefix. Example: mastodon. |
| `limit` | integer | No | Statuses per page, 1 to 40. Defaults to 20. |
| `max_id` | string | No | Cursor: return statuses older than this ID. |
| `min_id` | string | No | Cursor: return statuses newer than this ID. |
| `only_media` | boolean | No | Only statuses with media attachments. |
| `local` | boolean | No | Only statuses from the local instance. |
| `remote` | boolean | No | Only statuses from remote instances. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/mastodon/hashtag?instance=mastodon.social&tag=mastodon&limit=5"
```

## Example response

```json
{
    "success": true,
    "data": [
        {
            "id": "117430370454007257",
            "content": "Soy nueva en #mastodon",
            "content_text": "Soy nueva en #mastodon",
            "url": "https://mastodon.social/@Analia_Belen45/117430370454007257",
            "tags": [
                {
                    "name": "mastodon",
                    "url": "https://mastodon.social/tags/mastodon"
                }
            ]
        }
    ]
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A public parameter or range is invalid. This response is not billable. |
| 502 | Invalid Source Response | Mastodon returned an unexpected response. This response is not billable. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
