Public market data needs no API key. Market ids are lowercase base + quote codes such as btcusdt; all markets are currently quoted in USDT.
For live prices, prefer the WebSocket streams: global.tickers pushes every market about every 5 seconds, and <market>.ob-inc keeps an order book up to date without polling.
List markets
GET/api/v2/peatio/public/marketsPublic
Returns the active spot markets with their price/amount limits and precision. Paginated (Total, Page and Per-Page response headers). Results are cached server-side for up to 10 minutes.
Parameters
Name
In
Type
Description
base_unit
query
string
Only markets with this base currency, e.g. btc.
quote_unit
query
string
Only markets with this quote currency, e.g. usdt.
order_by
query
string
Sort field (default position). One of: position, id.
ordering
query
string
Sort direction (default asc). One of: asc, desc.
limit
query
integer
Page size, 1-1000 (default 100).
page
query
integer
Page number, starting at 1 (default 1).
Responses
Status
Description
200
Array of markets.
422
Validation error, e.g. {"errors":["public.market.doesnt_exist"]}.
import requests
r = requests.get("https://exchange.ex5.com/api/v2/peatio/public/markets", timeout=10)
r.raise_for_status()
print(r.json())
const res = await fetch("https://exchange.ex5.com/api/v2/peatio/public/markets");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
24h tickers for all markets
GET/api/v2/peatio/public/markets/tickersPublic
Returns the 24-hour ticker of every active spot market, as an object keyed by market id. The server refreshes it about every 5 seconds. All numeric values are strings; at is a Unix time in seconds (also a string). volume is quote-currency volume, amount base-currency volume, avg_price the volume-weighted average price. Unlike the single-market endpoint, entries carry ticker.at and no vol alias.
import requests
r = requests.get("https://exchange.ex5.com/api/v2/peatio/public/markets/tickers", timeout=10)
r.raise_for_status()
print(r.json())
const res = await fetch("https://exchange.ex5.com/api/v2/peatio/public/markets/tickers");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
Returns the 24-hour ticker of one market. volume = quote-currency volume, amount = base-currency volume (vol is an alias of volume), avg_price = volume-weighted average price, price_change_percent = (last - open) / open formatted like "+0.41%". Values are strings; the top-level at is a Unix time in seconds (string); ticker.at is always null on this endpoint.
Parameters
Name
In
Type
Description
marketrequired
path
string
Market id, e.g. btcusdt. Valid ids: GET /api/v2/peatio/public/markets.
Responses
Status
Description
200
Ticker.
422
Validation error, e.g. {"errors":["public.market.doesnt_exist"]}.
Response fields
Field
Type
Description
at
string (unix seconds)
Computation time (documented as integer; served as a string).
import requests
r = requests.get("https://exchange.ex5.com/api/v2/peatio/public/markets/btcusdt/tickers", timeout=10)
r.raise_for_status()
print(r.json())
const res = await fetch("https://exchange.ex5.com/api/v2/peatio/public/markets/btcusdt/tickers");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
Returns resting orders on each side of the book as full order objects, best price first (asks ascending, bids descending). For aggregated price levels use /depth.
Parameters
Name
In
Type
Description
marketrequired
path
string
Market id, e.g. btcusdt. Valid ids: GET /api/v2/peatio/public/markets.
asks_limit
query
integer
Number of sell orders, 1-200 (default 20).
bids_limit
query
integer
Number of buy orders, 1-200 (default 20).
Responses
Status
Description
200
Asks and bids.
422
Validation error, e.g. {"errors":["public.market.doesnt_exist"]}.
const res = await fetch("https://exchange.ex5.com/api/v2/peatio/public/markets/btcusdt/order-book?asks_limit=10&bids_limit=10");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
Returns aggregated price levels as [price, amount] string pairs, best price first: asks from the lowest price up, bids from the highest price down. timestamp is the server time in Unix seconds.
Asks are sorted by ascending price, bids by descending price.
Parameters
Name
In
Type
Description
marketrequired
path
string
Market id, e.g. btcusdt. Valid ids: GET /api/v2/peatio/public/markets.
limit
query
integer
Maximum price levels per side, 1-1000 (default 300).
Responses
Status
Description
200
Depth snapshot.
422
Validation error, e.g. {"errors":["public.market.doesnt_exist"]}.
import requests
r = requests.get("https://exchange.ex5.com/api/v2/peatio/public/markets/btcusdt/depth", params={"limit": "50"}, timeout=10)
r.raise_for_status()
print(r.json())
const res = await fetch("https://exchange.ex5.com/api/v2/peatio/public/markets/btcusdt/depth?limit=50");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
Returns the most recent public trades of a market, newest first. In this endpoint price, amount and total are JSON numbers (not strings) and may be written in exponent notation (e.g. 7.97e-07); created_at is a Unix time in seconds; taker_type is the side of the taker order.
Only limit is applied; other query parameters are ignored.
Parameters
Name
In
Type
Description
marketrequired
path
string
Market id, e.g. btcusdt. Valid ids: GET /api/v2/peatio/public/markets.
limit
query
integer
Number of trades, 1-1000 (default 100).
Responses
Status
Description
200
Array of public trades.
422
Validation error, e.g. {"errors":["public.market.doesnt_exist"]}.
Response fields
Field
Type
Description
id
integer
Trade id (unique; do not assume it is sequential).
import requests
r = requests.get("https://exchange.ex5.com/api/v2/peatio/public/markets/btcusdt/trades", params={"limit": "50"}, timeout=10)
r.raise_for_status()
print(r.json())
const res = await fetch("https://exchange.ex5.com/api/v2/peatio/public/markets/btcusdt/trades?limit=50");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
Returns candles as arrays [time, open, high, low, close, volume], oldest first. time is the candle open time in Unix seconds; prices and volume are JSON numbers (volume in base currency). Without time_from/time_to the latest limit candles are returned.
Parameters
Name
In
Type
Description
marketrequired
path
string
Market id, e.g. btcusdt. Valid ids: GET /api/v2/peatio/public/markets.
period
query
integer
Candle size in minutes (default 1). One of: 1, 5, 15, 30, 60, 120, 240, 360, 720, 1440, 4320, 10080.
time_from
query
integer
Unix time in seconds; only candles at or after this time.
time_to
query
integer
Unix time in seconds; only candles up to this time.
limit
query
integer
Number of candles, 1-10000 (default 30). Ignored when both time_from and time_to are given.
Responses
Status
Description
200
Array of candles.
422
Validation error, e.g. {"errors":["public.market.doesnt_exist"]}.
const res = await fetch("https://exchange.ex5.com/api/v2/peatio/public/markets/btcusdt/k-line?period=60&limit=24");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
List currencies
GET/api/v2/peatio/public/currenciesPublic
Returns visible currencies with deposit/withdrawal status, fees, minimum amounts, precision and required confirmations. Assets available on several networks list them in networks; the network-specific currency id (e.g. usdt.trc20) is what you use for deposits and withdrawals on that network. Paginated; cached server-side for up to 10 minutes.
Parameters
Name
In
Type
Description
type
query
string
Filter by type. One of: coin, fiat.
limit
query
integer
Page size, 1-1000 (default 100).
page
query
integer
Page number, starting at 1 (default 1).
Responses
Status
Description
200
Array of currencies.
422
Validation error, e.g. {"errors":["public.market.doesnt_exist"]}.
Response fields
Field
Type
Description
id
string
Currency code, e.g. "btc", "usdt", "usdt.trc20".
name
string
Display name.
description
string | null
Description.
homepage
string | null
Homepage URL.
parent_id
string | null
Native coin of the chain for tokens (e.g. "eth", "trx").
networks
array<CurrencyNetwork>
List endpoint only: networks on which the asset can be deposited/withdrawn.
price
string (decimal)
Current reference price (used for limits/valuation).
explorer_transaction
string
Single-currency endpoint only: explorer URL template with #{txid}.
explorer_address
string
Single-currency endpoint only: explorer URL template with #{address}.
type
string
"coin" or "fiat".
deposit_enabled
boolean
Deposits currently possible.
withdrawal_enabled
boolean
Withdrawals currently possible.
deposit_fee
string (decimal)
Deposit fee.
min_deposit_amount
string (decimal)
Minimum deposit amount.
withdraw_fee
string (decimal)
Withdrawal fee (in this currency).
min_withdraw_amount
string (decimal)
Minimum withdrawal amount.
withdraw_limit_24h
string (decimal)
Legacy 24 h withdrawal limit field ("0.0").
withdraw_limit_72h
string (decimal)
Legacy 72 h withdrawal limit field ("0.0").
base_factor
integer
Smallest-unit factor (10^decimals on chain).
precision
integer
Display/amount precision.
position
integer
Sort position.
icon_url
string
Icon URL.
min_confirmations
integer
Confirmations required before a deposit is credited.
import requests
r = requests.get("https://exchange.ex5.com/api/v2/peatio/public/currencies", timeout=10)
r.raise_for_status()
print(r.json())
const res = await fetch("https://exchange.ex5.com/api/v2/peatio/public/currencies");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
Get a currency
GET/api/v2/peatio/public/currencies/{id}Public
Returns one currency, including block-explorer URL templates (#{txid} / #{address} placeholders). Network currencies such as usdt.trc20 can be requested directly. This endpoint does not include the networks array.
Parameters
Name
In
Type
Description
idrequired
path
string
Currency code, e.g. btc, usdt or a network currency such as usdt.trc20 (see GET /api/v2/peatio/public/currencies).
Responses
Status
Description
200
Currency.
422
Validation error, e.g. {"errors":["public.market.doesnt_exist"]}.
Response fields
Field
Type
Description
id
string
Currency code, e.g. "btc", "usdt", "usdt.trc20".
name
string
Display name.
description
string | null
Description.
homepage
string | null
Homepage URL.
parent_id
string | null
Native coin of the chain for tokens (e.g. "eth", "trx").
networks
array<CurrencyNetwork>
List endpoint only: networks on which the asset can be deposited/withdrawn.
price
string (decimal)
Current reference price (used for limits/valuation).
explorer_transaction
string
Single-currency endpoint only: explorer URL template with #{txid}.
explorer_address
string
Single-currency endpoint only: explorer URL template with #{address}.
type
string
"coin" or "fiat".
deposit_enabled
boolean
Deposits currently possible.
withdrawal_enabled
boolean
Withdrawals currently possible.
deposit_fee
string (decimal)
Deposit fee.
min_deposit_amount
string (decimal)
Minimum deposit amount.
withdraw_fee
string (decimal)
Withdrawal fee (in this currency).
min_withdraw_amount
string (decimal)
Minimum withdrawal amount.
withdraw_limit_24h
string (decimal)
Legacy 24 h withdrawal limit field ("0.0").
withdraw_limit_72h
string (decimal)
Legacy 72 h withdrawal limit field ("0.0").
base_factor
integer
Smallest-unit factor (10^decimals on chain).
precision
integer
Display/amount precision.
position
integer
Sort position.
icon_url
string
Icon URL.
min_confirmations
integer
Confirmations required before a deposit is credited.
import requests
r = requests.get("https://exchange.ex5.com/api/v2/peatio/public/currencies/btc", timeout=10)
r.raise_for_status()
print(r.json())
const res = await fetch("https://exchange.ex5.com/api/v2/peatio/public/currencies/btc");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
Server time (ISO 8601)
GET/api/v2/peatio/public/timestampPublic
Returns the current server time as an ISO 8601 string in UTC. For API-key nonces prefer GET /api/v2/barong/public/time, which returns Unix seconds.
import requests
r = requests.get("https://exchange.ex5.com/api/v2/peatio/public/timestamp", timeout=10)
r.raise_for_status()
print(r.json())
const res = await fetch("https://exchange.ex5.com/api/v2/peatio/public/timestamp");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
Server time (Unix seconds)
GET/api/v2/barong/public/timePublic
Returns the authentication server time in Unix seconds. Use it to detect clock skew: API-key nonces must be within 5 seconds of server time (in milliseconds).
import requests
r = requests.get("https://exchange.ex5.com/api/v2/barong/public/time", timeout=10)
r.raise_for_status()
print(r.json())
const res = await fetch("https://exchange.ex5.com/api/v2/barong/public/time");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());