Aurelia

API basics

Base URL, chains and addresses, units, base and quote, pagination, errors.

Base URL

WhereBase URL
Through the consolehttps://app.aurelia.build/apiSame origin as these docs: the console forwards /api/* to the API, WebSocket included. The examples use it.
The API, locallyhttp://localhost:7070The API's own port, published on loopback by docker compose.
The API, in productionhttps://<api-domain>The domain your deployment gives the API service.

All endpoints are GET, take no body and answer JSON; live data is one WebSocket, /live. Data routes, /plans and /health allow any origin (CORS), so a web page on another site can call them with a key or JWT; the console's own session cookie only works on its own origin.

Chains and addresses

ChainIdAddresses
BSCevm:560x and 40 hex digits. Answers use lowercase; a checksummed address is accepted.
SolanasolanaBase58, case-sensitive: send it exactly.
Baseevm:84530x and 40 hex digits. Answers use lowercase; a checksummed address is accepted.
Robinhood Chainevm:46630x and 40 hex digits. Answers use lowercase; a checksummed address is accepted.
Ethereumevm:10x and 40 hex digits. Answers use lowercase; a checksummed address is accepted.

A chain is named in the path (/tokens/:chain/:address), in a query (/trades?chain=, chains=) or in a batch item. Native BNB, ETH or SOL has the address native wherever a token object names it. Addresses are not format-checked: a malformed one reads as unknown.

Batch lists (tokens= on /tokens and /prices, wallets= on /wallets) are comma-separated <chain>:<address> items, split on the last colon: evm:56:0xbb4c…, solana:So111…. An unknown token comes back null in its place.

Units

  • Token amounts are decimal strings with decimals applied, such as "0.109729208291499538". They are exact: parse them with a decimal library if you do arithmetic.
  • USD values and prices are JSON numbers. Price changes and shares are fractions: 0.05 is 5%.
  • Times (time, …At, at) are unix milliseconds. Candles use unix seconds: from, to and each bar's t.
  • Blocks are block numbers on BSC and slots on Solana.

Base, quote and side

Every swap has a base, the token being priced, and a quote. The quote is picked by fixed priority: a stablecoin, then the wrapped native token (WBNB, WSOL), then the token that was priced first, then token0. A pool keeps the same base, so its price and candles are one series.

USD prices come from direct trades: $1 for a stablecoin; for WBNB, WSOL and other tokens, a price set by recent trades against a stablecoin or the native token. A swap with neither is priced through its quote's recent price, else its base's; without one it stays unpriced (priced: false) rather than guessed.

A trade is told from one token's side: the token asked for (token=), else the swap's base. buy means the trader received that token, sell that they paid it. Token stats count the swaps where the token was the base; traders count both sides.

Pagination

Lists take limit and cursor, and end with next: pass it back as cursor for the next page. next is an opaque string, null at the end. A filtered page can come back short, or empty, before the end: it examined a bounded part of the list, and next continues after it. Follow next until it is null.

Two pages:

curl -s 'https://app.aurelia.build/api/trades?chain=evm:56&token=0xa9fcda9bd321adeb7cbbbd30ef2dd0ed1d657777&limit=2'
# … "next": "1790618554904.1000749.0.4"
curl -s 'https://app.aurelia.build/api/trades?chain=evm:56&token=0xa9fcda9bd321adeb7cbbbd30ef2dd0ed1d657777&limit=2&cursor=1790618554904.1000749.0.4'

Wallets in lists

Every row that names a wallet carries its labels beside it: trades, traders, holders, portfolios, a token's creator, a wallet's funder, a transfer's counterparty. A wallet without a label has [].

Errors

StatusWhenBody
400A parameter is invalid, unknown, repeated, or of another mode{"error":"limit must be 1-200"}
404An unknown token or pool{"error":"unknown token"}
422An answer that could not be exact: a BSC wallet that touched more than 2,000 tokens; an address that is not a mint; candles of a token that is the base of no pool; native BNB history; history before indexing reached the balances{"error":"…"}
502The chain could not be read (a portfolio, holders, a Solana wallet's activity or history){"error":"the chain could not be read: …"}
503A chain's read budget is spent (holders, Solana activity and history), with Retry-After; /health when a service is down{"error":"…"}
401No credentials, or a bad, expired or revoked key or JWT{"error":"unauthorized"}
402Your credits left cannot pay for the request{"error":"insufficient_balance"}
429Over the burst limit{"error":"rate_limited","retryAfter":1}

Error bodies are JSON with an error message meant for people: branch on the status. An unknown route answers 404 with the plain text NOT_FOUND. On the socket, an error ends one subscription, not the socket (see the socket).

Every request needs an account: sign in and create a key on your account. Your account gets 10,000 free credits once, to spend however you like. Authentication and limits covers keys, credits, paying and the headers that report what is left.

Try it in the interactive docsCreate a free account