Skip to content

Using HTTP

Every method that answers once is plain HTTP too, on https://api.intea.rs, for clients that don’t need anything live:

Path Method
/tokens tokens.get
/tokens/search tokens.search
/trades trades.query
/transfers transfers.query
/activity activity.query
/candles candles.get
/prices/at prices.at
/balances balances.get
/holders holders.get
/positions positions.get
/schema schema

The response’s body is what the method’s result would be on the WebSocket.

A GET takes the params in its URL. A POST takes them as a JSON body, exactly as params on the WebSocket, up to 64 KiB, for what’s too long for a URL:

Terminal window
curl -X POST https://api.intea.rs/tokens \
-d '{"fields": ["symbol", "price_usd"], "ids": ["wrap.near", "usdt.tether-token.near"]}'
  • A list is comma-separated: fields=symbol,price_usd.
  • An object’s keys are dotted: min_change.price_usd=0.1%25 (% is URL-encoded), or fields.trade=amount_in,amount_out for activity.query.
  • where’s params go without where: min_reputation=NotFake, min.liquidity_usd=1000.
  • sort=volume_usd_24h sorts ascending, and sort=-volume_usd_24h descending.
  • prices.at’s queries are at=<token>:<timestamp_millis>, comma-separated.
  • A param given twice, or one the method doesn’t take, is a bad_request.

For example, the 10 tokens with the most volume in the last 24 hours:

GET https://api.intea.rs/tokens?fields=symbol,price_usd,volume_usd_24h&sort=-volume_usd_24h&limit=10&min_reputation=NotFake

An error is { "error": { "code": "...", "message": "..." } }, with the status:

Status Codes
404 not_found, and unknown_method for a path nothing is served at
500 internal
400 every other code

See Errors for what each code means.

Responses can be cached for a second (Cache-Control: public, max-age=1). Responses only about the past can be cached for a day (max-age=86400):

  • history with a cursor (newest first), with a before_millis the latest block has passed, or oldest first with a next_cursor;
  • candles up to a to_millis whose candle has closed;
  • prices.at of times the latest block has passed.

None of them are cached when a token asked about doesn’t exist, since it may yet. A cached response keeps the height and latest_id it was first answered with.

Responses allow any origin (CORS), and are compressed with gzip or zstd when the request’s Accept-Encoding allows it. The X-Credits-Used header has the credits the response would cost.