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

# Quickstart

> Find a market, read its prices and stream a week of them, with curl or the Python SDK.

You need an API key. Create one in the [console](https://app.qelso.io/keys?create=1), keep it out of your code, and pass it from an environment variable.

```bash theme={null}
export QELSO_API_KEY="pk_live_..."
```

Every request below works on every plan. The free plan reads the last 30 days, at `10m` and coarser: if a request answers `plan_history_limit`, move its dates closer to today.

## 1. Check your access

`GET /v2/usage` shows your plan, your rate limit, and which venues and data your key can read.

```bash curl theme={null}
curl -s https://api.qelso.io/v2/usage -H "X-API-Key: $QELSO_API_KEY"
```

```python Python theme={null}
from qelso import Qelso

client = Qelso()  # reads QELSO_API_KEY
for grant in client.get_usage().data.entitlements:
    print(grant.venue, grant.entitlement, grant.enabled, grant.reason)
```

## 2. Find a market

Search open Polymarket markets about a US recession.

```bash curl theme={null}
curl -s "https://api.qelso.io/v2/markets?venue=polymarket&status=open&search=us%20recession&limit=5" \
  -H "X-API-Key: $QELSO_API_KEY"
```

```python Python theme={null}
for market in client.iter_markets(venue="polymarket", status="open", search="us recession", limit=5):
    print(market.id, market.title)
```

Each market's `id` names its venue and the venue's own ID, such as `polymarket:3407418`: "US recession by end of 2027?" Use it on every endpoint below.

## 3. Read its prices

Hourly prices for one day. Each row covers one hour and gives the prices as of the end of that hour. On Polymarket, prices at `1m` and coarser are the mid and the last trade; bid and ask come at `1s` and `100ms`.

```bash curl theme={null}
curl -s "https://api.qelso.io/v2/markets/polymarket:3407418/prices?start=2026-11-26&end=2026-11-27&resolution=1h" \
  -H "X-API-Key: $QELSO_API_KEY"
```

```python Python theme={null}
from datetime import date, timedelta

end = date.today()
start = end - timedelta(days=1)
page = client.get_market_prices("polymarket:3407418", start=start, end=end, resolution="1h")
for p in page.data:
    print(p.t, p.mid, p.last)
```

The page starts with the market it is about, so you always know which outcome is YES. The curl request returns 24 rows; here are the first two:

```json theme={null}
{
  "market": {
    "id": "polymarket:3407418",
    "venue": "polymarket",
    "native_id": "3407418",
    "title": "US recession by end of 2027?",
    "status": "open",
    "outcomes": {
      "yes": {"label": "Yes", "token_id": "39053642040328665826826916845082848880800185180362801758788039691810400872901"},
      "no": {"label": "No", "token_id": "43592136667213140930259773463306587489357493048595432852155453687150485948108"}
    },
    "open_time": "2026-08-07T19:45:31.000Z",
    "close_time": "2027-12-31T23:59:00.000Z"
  },
  "outcome": "yes",
  "resolution": "1h",
  "data": [
    {"t": "2026-11-26T00:00:00.000Z", "bid": null, "ask": null, "mid": 0.35, "last": 0.33, "carried": false},
    {"t": "2026-11-26T01:00:00.000Z", "bid": null, "ask": null, "mid": 0.35, "last": 0.37, "carried": false}
  ],
  "next_cursor": null
}
```

## 4. Stream a week

A stream returns a whole window in one request. The SDK resumes it by itself if the connection breaks.

```bash curl theme={null}
curl -s "https://api.qelso.io/v2/markets/polymarket:3407418/prices?start=2026-11-23&end=2026-11-30&resolution=10m" \
  -H "X-API-Key: $QELSO_API_KEY" -H "Accept: text/csv" -H "Accept-Encoding: gzip" --compressed -o prices.csv
```

```python Python theme={null}
from datetime import date, timedelta

prices = client.stream_market_prices(
    "polymarket:3407418", start=date.today() - timedelta(days=7), end=date.today(), resolution="10m", format="csv"
).to_pandas()
```

On plans that include them, the same market also has its trades (`/trades`) and its order book at any millisecond (`/books?at=`). With Ultra, it also has every change to its book (`/book-updates`) and to its best bid and ask (`/bbo`). See [Sub-minute data](https://docs.qelso.io/guides/sub-minute-data.md).

## Next

> [card] [Time and intervals](https://docs.qelso.io/concepts/time-and-intervals.md)
>
> How windows, grids and event rows line up.

> [card] [Pages and streams](https://docs.qelso.io/concepts/pages-and-streams.md)
>
> When to page, when to stream, and how to resume.


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