# Token price API

> Up to 100 tokens' USD prices in one request, on any mix of chains, now or at a past moment.

A price here comes from a real swap in a real pool. Every answer names the pool and the time, so you can check it yourself.

## Get prices now

[`GET /prices`](https://app.aurelia.build/docs/prices) takes up to 100 `<chain>:<address>` items, comma-separated. One request can mix chains. A request costs 1 credit per 25 items, which makes it the cheapest read the API has.

Wrapped SOL and WBNB:

```bash
curl -s -H 'Authorization: Bearer <key>' 'https://app.aurelia.build/api/prices?tokens=solana:So11111111111111111111111111111111111111112,evm:56:0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c'
```

| Field | What it is |
|---|---|
| `priceUsd` | The USD price. `null` when the token was not priced, or had no priced swap in the last 24 h |
| `time`, `pool` | When and where that swap happened: unix ms, and the token's chart pool |
| `at`, `tx` | With `at=`: the time you asked for, and the swap's transaction |

The answer holds one entry per item, in the order you asked, or `null` for a token Aurelia has never stored.

## Get a price at a past moment

Add `at`, in unix milliseconds, for the price at that moment.

Wrapped SOL at a past moment:

```bash
curl -s -H 'Authorization: Bearer <key>' 'https://app.aurelia.build/api/prices?tokens=solana:So11111111111111111111111111111111111111112&at=1793800000000'
```

## Poll from your code

Prices for a watchlist:

```javascript
const tokens = ["solana:So11111111111111111111111111111111111111112", "evm:56:0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"];
const res = await fetch(`https://app.aurelia.build/api/prices?tokens=${tokens.join(",")}`, {
  headers: { Authorization: "Bearer <key>" },
});
const { prices } = await res.json();
for (const p of prices) if (p) console.log(p.address, p.priceUsd);
```

## Follow one price live

For one token, subscribe to the [token channel](https://app.aurelia.build/docs/live-token) and read each `tick`, at most 4 a second. For many tokens, poll `GET /prices` instead of subscribing to each.

## Related

- [Prices reference](https://app.aurelia.build/docs/prices): every parameter and field.
- [OHLCV candles](https://app.aurelia.build/guides/ohlcv-candles-api): a price history.
- [Token screener](https://app.aurelia.build/guides/token-screener-api): prices with volume, fees and market cap.
