# List ended events

Source: https://langbot.ai/docs/api/live-events/list-ended-events

`GET /v1/events/ended`

Events that ended in the last days, newest first, with the same rows as the live calendar.

**Auth.** None. Without a token the call is served as Free (the Free delay and request budget, shared per IP); send `Authorization: Bearer lb_…` for your plan's.

**Limits.** Counts against your plan's API requests (60, 600 or 3,000 a minute on Free, Builder and Standard).

## Parameters

### Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `days` | integer | no | How many days back. 1 to 365. Default `30`. |
| `limit` | integer | no | Page size. 1 to 1000. Default `200`. |
| `cursor` | string | no | `next_cursor` from the previous page. |
| `fields` | string | no | `lite` (default) or `full`. |

## Request

**curl**

```bash
curl "https://api.langbot.ai/v1/events/ended?days=7&limit=1"
```

**Python**

```python
import httpx

r = httpx.get("https://api.langbot.ai/v1/events/ended?days=7&limit=1")
print(r.json())
```

**TypeScript**

```ts
const res = await fetch("https://api.langbot.ai/v1/events/ended?days=7&limit=1");
console.log(await res.json());
```

## Response

`200 OK`

```json
{
  "ts": 1793685870750,
  "days": 7,
  "fields": "lite",
  "limit": 1,
  "next_cursor": "bzox",
  "events": [
    {
      "id": "ev_kxnhllindsay_27",
      "title": "NHL Ted Lindsay Award",
      "kind": "sports",
      "starts_at": 1791424800000,
      "ends_at": 1814968800000,
      "status": "ended",
      "speaker_keys": [],
      "meta": {
        "time_known": false,
        "window": false,
        "category": "Sports",
        "venue": "kalshi",
        "speaker_key": "nhllind"
      },
      "rights": "unknown",
      "phrases": ["no", "yes"],
      "markets": [
        {
          "ticker": "KXNHLLINDSAY-27-CHELLEBUYCK37",
          "venue": "kalshi",
          "event_id": "ev_kxnhllindsay_27",
          "title": "Ted Lindsay Award: Connor Hellebuyck wins",
          "phrases": ["yes", "no"],
          "status": "open",
          "close_ts": 1814968800000,
          "meta": {}
        },
        {
          "ticker": "KXNHLLINDSAY-27-ISHESTERKIN31",
          "venue": "kalshi",
          "event_id": "ev_kxnhllindsay_27",
          "title": "Ted Lindsay Award: Igor Shesterkin wins",
          "phrases": ["yes", "no"],
          "status": "open",
          "close_ts": 1814968800000,
          "meta": {}
        }
      ],
      "sources": []
    }
  ]
}
```

A real response from the API; long lists are cut to their first items.

## Errors

| Status | `code` | When |
|---|---|---|
| 401 | `token_invalid` | A token was sent and not recognised. Send a valid one, or none to call anonymously. |
| 422 | `validation_error` | A parameter failed validation; `detail[].loc` names it. |
| 429 | `rate_limited` | Over your request budget; wait `Retry-After` seconds. |

Every error body is `{"detail": …, "code": "…"}`; branch on `code`. All codes: [Errors](https://langbot.ai/docs/api#errors).
