Market Data API Reference
Public methods for fetching pairs, currencies, tickers, order books, candles, and trades.
MarketMixin
Public market data endpoints — no authentication required.
This mixin is not meant to be used directly. It is mixed into
:class:~revolut_x.client.RevolutXClient.
get_candles
get_candles(symbol: str, interval: Interval | int = Interval.HOUR_1, *, since: TimeLike | None = None, until: TimeLike | None = None) -> list[Candle]
Fetch up to 1000 OHLCV candlesticks for a trading pair.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
Trading pair (e.g. |
required |
interval
|
Interval | int
|
Candle interval — use the :class: |
HOUR_1
|
since
|
TimeLike | None
|
Start time, inclusive — a Unix timestamp in
milliseconds, a :class: |
None
|
until
|
TimeLike | None
|
End time, inclusive — same accepted formats as |
None
|
Returns:
| Type | Description |
|---|---|
list[Candle]
|
A list of :class: |
list[Candle]
|
|
Note
A single request covers at most 1000 candles. The exchange
does not silently truncate a wider window — it rejects it with
HTTP 400 ('Lookup window interval exceeds the limit of 1000
candles'). So until - since must stay within
999 * interval; to download a longer range use
:meth:iter_candles, which paginates automatically.
Raises:
| Type | Description |
|---|---|
ApiError
|
If the API returns a non-2xx response — including when
|
Example::
>>> from datetime import datetime, timedelta, timezone
>>> from revolut_x import Interval
>>> # last 500 hours — comfortably inside the 1000-candle limit
>>> start = datetime.now(timezone.utc) - timedelta(hours=500)
>>> candles = client.get_candles("BTC-EUR", Interval.HOUR_1,
... since=start)
>>> for c in candles[:3]:
... print(f"{c['start']}: O={c['open']} H={c['high']}")
Source code in src/revolut_x/market.py
get_currencies
Retrieve the configuration for all supported currencies.
Returns:
| Type | Description |
|---|---|
dict[str, CurrencyConfig]
|
A dictionary mapping currency symbols (e.g. |
dict[str, CurrencyConfig]
|
to their :class: |
Raises:
| Type | Description |
|---|---|
ApiError
|
If the API returns a non-2xx response. |
Example::
>>> currencies = client.get_currencies()
>>> print(currencies["BTC"]["name"])
Bitcoin
Source code in src/revolut_x/market.py
get_order_book
Retrieve the current order book (bids and asks) for a trading pair.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
Trading pair (e.g. |
required |
depth
|
int
|
Requested number of price levels. Currently ignored by the exchange — the venue always returns 5 levels per side, regardless of this value. Kept so that the SDK picks up deeper books automatically if Revolut X starts honouring it. |
10
|
Returns:
| Name | Type | Description |
|---|---|---|
An |
OrderBook
|
class: |
OrderBook
|
lists. Each entry is an |
|
OrderBook
|
class: |
|
OrderBook
|
price from |
|
OrderBook
|
sorted best-first. |
Raises:
| Type | Description |
|---|---|
ApiError
|
If the API returns a non-2xx response. |
Example::
>>> book = client.get_order_book("BTC-EUR")
>>> best_bid = book["bids"][0]
>>> print(f"Best bid: {best_bid['p']} EUR x {best_bid['q']} BTC")
Source code in src/revolut_x/market.py
get_pair
Retrieve the configuration for a specific trading pair.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
Trading pair in any common format
(e.g. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
The |
PairConfig
|
class: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the pair is not found or not active on the exchange. |
ApiError
|
If the API returns a non-2xx response. |
Example::
>>> pair = client.get_pair("ETH-EUR")
>>> print(f"Step: {pair['base_step']}")
Source code in src/revolut_x/market.py
get_pairs
Retrieve the configuration and trading limits for all active pairs.
Returns:
| Type | Description |
|---|---|
dict[str, PairConfig]
|
A dictionary mapping pair symbols (e.g. |
dict[str, PairConfig]
|
class: |
dict[str, PairConfig]
|
minimum/maximum order sizes, price/quantity step sizes, and status. |
Raises:
| Type | Description |
|---|---|
ApiError
|
If the API returns a non-2xx response. |
NetworkError
|
On connection failure. |
Example::
>>> client = RevolutXClient()
>>> pairs = client.get_pairs()
>>> btc = pairs["BTC/EUR"]
>>> print(f"Min order: {btc['min_order_size']} BTC")
Min order: 0.00000001 BTC
Source code in src/revolut_x/market.py
get_ticker
Retrieve the current ticker for a specific trading pair.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
Trading pair (e.g. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
A |
Ticker
|
class: |
Ticker
|
and last traded price. |
Note
Most symbols are quoted in more than one region ('EEA' and
'UK') at different prices and volumes. Because
/public/tickers returns them in an order that changes between
calls, picking the first match would hand back a different region —
and so a different price — on each call. This method therefore
returns the most liquid quote: the match with the highest
volume_24h, with the region name breaking an exact tie. To
work with a specific region, filter :meth:get_tickers on
['region'] yourself.
Raises:
| Type | Description |
|---|---|
ValueError
|
If ticker data is not available for the given symbol. |
ApiError
|
If the API returns a non-2xx response. |
Example::
>>> ticker = client.get_ticker("BTC-EUR")
>>> print(f"BTC price: {ticker['last_price']} EUR")
Source code in src/revolut_x/market.py
get_tickers
Retrieve current tickers (best bid, best ask, last price) for all pairs.
Returns:
| Type | Description |
|---|---|
list[Ticker]
|
A list of :class: |
list[Ticker]
|
pair and region**, not one per pair. Most symbols trade in both |
list[Ticker]
|
|
list[Ticker]
|
prices and volumes in each; read |
list[Ticker]
|
The order of the list is not stable between calls. |
Raises:
| Type | Description |
|---|---|
ApiError
|
If the API returns a non-2xx response. |
Source code in src/revolut_x/market.py
get_trades
get_trades(symbol: str, *, start_date: TimeLike | None = None, end_date: TimeLike | None = None, cursor: str | None = None, limit: int = MAX_TRADES_PER_PAGE) -> tuple[list[Trade], str | None]
Fetch a single page of public trades (up to 100 per request).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
Trading pair (e.g. |
required |
start_date
|
TimeLike | None
|
Start time — Unix timestamp in milliseconds,
:class: |
None
|
end_date
|
TimeLike | None
|
End time — same accepted formats as |
None
|
cursor
|
str | None
|
Pagination cursor from a previous response's
|
None
|
limit
|
int
|
Maximum number of trades to return. The exchange accepts
1–100 and rejects anything larger with HTTP 400, so values
outside that range are clamped into it. To read more than one
page, follow |
MAX_TRADES_PER_PAGE
|
Returns:
| Type | Description |
|---|---|
list[Trade]
|
A tuple of |
str | None
|
class: |
tuple[list[Trade], str | None]
|
string for fetching the next page (or |
Raises:
| Type | Description |
|---|---|
ApiError
|
If the API returns a non-2xx response. |
Example::
>>> trades, cursor = client.get_trades("BTC-EUR", limit=100)
>>> print(f"Got {len(trades)} trades, next cursor: {cursor}")
Source code in src/revolut_x/market.py
iter_candles
iter_candles(symbol: str, interval: Interval | int = Interval.HOUR_1, *, since: TimeLike | None = None, until: TimeLike | None = None) -> Iterator[Candle]
Iterate over all candles in a time range, automatically paginating.
This is a generator that yields :class:~revolut_x.types.Candle
dictionaries one by one, fetching additional pages from the API as
needed. It handles the 1000-candle-per-request limit transparently.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
Trading pair (e.g. |
required |
interval
|
Interval | int
|
Candle interval (see :meth: |
HOUR_1
|
since
|
TimeLike | None
|
Start time — Unix timestamp in milliseconds,
:class: |
None
|
until
|
TimeLike | None
|
End time — same accepted formats as |
None
|
Yields:
| Type | Description |
|---|---|
Candle
|
class: |
Candle
|
order (oldest first). No candle is yielded twice, and none is |
Candle
|
yielded with a |
Example::
>>> for candle in client.iter_candles("BTC-EUR", Interval.MIN_1,
... since="2024-01-01"):
... process(candle) # each candle is a dict
Source code in src/revolut_x/market.py
iter_trades
iter_trades(symbol: str, *, start_date: TimeLike | None = None, end_date: TimeLike | None = None, limit: int = MAX_TRADES_PER_PAGE) -> Iterator[Trade]
Iterate over all public trades in a time range, automatically paginating.
This generator fetches pages of trades using cursor-based pagination
and yields :class:~revolut_x.types.Trade dicts one by one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
Trading pair (e.g. |
required |
start_date
|
TimeLike | None
|
Start time — Unix timestamp in milliseconds,
:class: |
None
|
end_date
|
TimeLike | None
|
End time — same accepted formats as |
None
|
limit
|
int
|
Page size per request (1–100, clamped into that range). |
MAX_TRADES_PER_PAGE
|
Yields:
| Type | Description |
|---|---|
Trade
|
class: |
Example::
>>> from datetime import datetime, timezone
>>> start = datetime(2024, 1, 1, tzinfo=timezone.utc)
>>> for trade in client.iter_trades("BTC-EUR", start_date=start):
... print(f"{trade['price']} EUR x {trade['quantity']} BTC")