> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Base URL: https://api.eventory.ai. Send your API key in the apikey header. Market Data and Live Availability calls cost credits, pings included; GET /usage is free, so use it to test a key. Costs per endpoint: https://eventory.ai/docs/credits-and-access.md

# API quickstart

> Verify your key, add an event to your watchlist, and pull live availability in five minutes.

Everything below runs against production. Replace `$EVENTORY_API_KEY` with your key
or export it in your shell first. The Node.js snippets use top-level `await`, so run
them as ES modules (save them as `.mjs`).

**1. Check your key and credits**

`GET /usage` is free and works for every valid key, so it is the safest first call.

```bash cURL theme={null}
curl -s https://api.eventory.ai/usage \
  -H "apikey: $EVENTORY_API_KEY"
```

```python Python theme={null}
import httpx, os

r = httpx.get(
    "https://api.eventory.ai/usage",
    headers={"apikey": os.environ["EVENTORY_API_KEY"]},
)
print(r.json()["credits"])
```

```javascript Node.js theme={null}
const r = await fetch("https://api.eventory.ai/usage", {
  headers: { apikey: process.env.EVENTORY_API_KEY },
});
console.log((await r.json()).credits);
```

A `401` here means the key was not sent or is wrong. If you used a shell variable,
check it is actually set: an empty variable sends the request with no key at all.

**2. Find the platform key and event id**

This step and the next call Live Availability, which is enabled per account on
request. Without it, they return `403 forbidden`.

Live Availability needs a `platform` key and the event's id on that platform.
`GET /events/platforms` lists every platform with the regions it accepts and an
example id. Cache the result, it costs 5 credits like every call on this API.

```bash theme={null}
curl -s https://api.eventory.ai/events/platforms \
  -H "apikey: $EVENTORY_API_KEY" | jq '.platforms.tm'
```

```json theme={null}
{
  "description": "Ticketmaster — monitors primary and resale ticket availability for events worldwide.",
  "sections_type": "SeatMapSections",
  "regions": ["us", "ca", "uk", "ie", "au", "nz", "mx", "de", "es", "nl", "at", "dk", "be", "no", "ch", "se", "fi", "pl", "ae", "cz", "fr", "it", "za"],
  "event_id_example": "0200642CF18CAA24"
}
```

The id is normally in the event URL. For Ticketmaster it is the 16-character
string at the end of `…/event/0200642CF18CAA24`; several other platforms take
the full event URL instead. See
[Supported platforms](/docs/guides/platforms.md).

**3. Pull live availability**

A scrape runs synchronously and can take up to 60 seconds. Give your client a
65-second timeout.

```bash cURL theme={null}
curl -s -X POST https://api.eventory.ai/events/scrape \
  -H "apikey: $EVENTORY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"platform": "tm", "event_id": "0200642CF18CAA24", "region": "us"}'
```

```python Python theme={null}
import httpx, os

r = httpx.post(
    "https://api.eventory.ai/events/scrape",
    headers={"apikey": os.environ["EVENTORY_API_KEY"]},
    json={"platform": "tm", "event_id": "0200642CF18CAA24", "region": "us"},
    timeout=65,
)
data = r.json()
print(data["total_stock"], data["sections_type"])
```

```javascript Node.js theme={null}
const r = await fetch("https://api.eventory.ai/events/scrape", {
  method: "POST",
  headers: {
    apikey: process.env.EVENTORY_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ platform: "tm", event_id: "0200642CF18CAA24", region: "us" }),
  signal: AbortSignal.timeout(65_000),
});
const data = await r.json();
console.log(data.total_stock, data.sections_type);
```

`sections_type` tells you how to read `sections`; check it on every response.
Ticketmaster, AXS, SeatGeek, StubHub, viagogo and VividSeats usually return a seat
map, the other platforms flat ticket tiers.
See [Section types](/docs/guides/section-types.md).

**4. Watch the event instead of polling**

If you want to be told when something changes rather than asking, add the event to
your watchlist. Watchlist calls are free.

```bash theme={null}
curl -s -X POST https://api.eventory.ai/watchlist \
  -H "apikey: $EVENTORY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"website": "ticketmaster", "event": "0200642CF18CAA24", "region": "US", "seat_quantity": 2}'
```

The response carries the created item under `item`. Keep its `id` to update or
delete it later. If your key is granted the [Notifications API](/docs/stream/overview.md),
open the socket; it picks up watchlist changes within 60 seconds. Access to the
Notifications API is not part of any API plan and is granted separately to a
limited number of partners. See [Connecting](/docs/stream/connecting.md).

`website` accepts far more platforms than Live Availability does, and an unknown
value is rejected with `400`. Check it against
[Watchlist platforms](/docs/guides/watchlist-platforms.md).

**5. Look at the history**

Market Data answers "how has this been selling?" rather than "what is on sale now?".
One credit per call.

```bash theme={null}
curl -s "https://api.eventory.ai/eventory/data/search" \
  -H "apikey: $EVENTORY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "drake", "sortBy": "tickets_sold.desc", "filterExpression": "venue_country_code:US"}'
```

Each hit carries the identifiers you need for the detail endpoints:
`viagogo_event_id` for `GET /eventory/data/viagogo/E-{viagogo_event_id}` (daily
statistics and a price histogram) and `ticketmaster_event_id` for
`GET /eventory/data/ticketmaster/{tm_event_id}`.

## Next

> [card] [Credits & access](/docs/credits-and-access.md)
>
> What each call costs and how to tell which APIs your key can use.

> [card] [Errors](/docs/errors.md)
>
> Every error code, what it actually means, and what to do about it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.