A badge is a small SVG image showing a monitor's name, its status and its uptime over the last 30 days, for a README or a web page. It reads like `Storefront | UP 99.9%`.

Only monitors shown on a public status page have a badge, because the badge makes the same information public. Add the monitor to a public status page first; any other monitor's badge is a 404.

## Embed it
Markdown:

```markdown
[![Storefront status](https://monitor.agilepixel.io/badge/48213)](https://monitor.agilepixel.io/status/northwind)
```

HTML:

```html
<a href="https://monitor.agilepixel.io/status/northwind"><img src="https://monitor.agilepixel.io/badge/48213" alt="Storefront status" width="200" height="20"></a>
```

## Get a monitor's status badge
`GET /badge/{monitor}`

Returns an SVG badge with the monitor's name, status and 30-day uptime, for a README or a web page. Only monitors shown on a public status page have a badge; any other is a 404. Responses are cached for 60 seconds.

| | |
|---|---|
| Authentication | None (public) |
| Rate limit | None |

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `monitor` | path | integer | Yes | The monitor's ID. |

### Example request

```bash
curl https://monitor.agilepixel.io/badge/48213
```

### Responses

| Status | When | Body |
|---|---|---|
| `200` | The badge. | An SVG image |
| `404` | The monitor doesn't exist or isn't shown on a public status page. | [Problem](https://monitor.agilepixel.io/docs/api/errors) |
| `500` | Something went wrong on our side. Try again; if it persists, contact support. | [Problem](https://monitor.agilepixel.io/docs/api/errors) |

#### 200

An SVG image, 200 by 20 pixels.

#### 404

```json
{"type": "about:blank", "title": "Not Found", "status": 404}
```

#### 500

```json
{"type": "about:blank", "title": "Internal Server Error", "status": 500}
```
