logo

Peatio User API v2

API for Peatio application.

#Version: 2.4.23

Contact information:
openware.com
https://www.openware.com
[email protected]

License: https://github.com/rubykube/peatio/blob/master/LICENSE.md

Security

Bearer

apiKeyAPI Key
NameJWT
Inheader

/public/webhooks/{event }

POST

Description

Bitgo Transfer Webhook

Parameters
NameLocated inDescriptionRequiredSchema
eventpathName of event can be deposit or withdrawYesstring
typeformDataType of event.Yesstring
hashformDataTransfer txid.Yesstring
transferformDataTransfer id.Yesstring
coinformDataCurrency code.Yesstring
walletformDataWallet id.Yesstring
Responses
CodeDescription
201Bitgo Transfer Webhook

/public/trading_fees

GET

Description

Returns trading_fees table as paginated collection

Parameters
NameLocated inDescriptionRequiredSchema
groupqueryMember group for define maker/taker fee.Nostring
market_idqueryMarket id for define maker/taker fee.Nostring
limitqueryLimit the number of returned paginations. Defaults to 100.Nointeger
pagequerySpecify the page of paginated results.Nointeger
orderingqueryIf set, returned values will be sorted in specific order, defaults to 'asc'.Nostring
order_byqueryName of the field, which result will be ordered by.Nostring
Responses
CodeDescriptionSchema
200Returns trading_fees table as paginated collection[ TradingFee ]

/public/health/ready

GET

Description

Get application readiness status

Responses
CodeDescription
200Get application readiness status

/public/health/alive

GET

Description

Get application liveness status

Responses
CodeDescription
200Get application liveness status

/public/version

GET

Description

Get running Peatio version and build details.

Responses
CodeDescription
200Get running Peatio version and build details.

/public/timestamp

GET

Description

Get server current time, in seconds since Unix epoch.

Responses
CodeDescription
200Get server current time, in seconds since Unix epoch.

/public/member-levels

GET

Description

Returns hash of minimum levels and the privileges they provide.

Responses
CodeDescription
200Returns hash of minimum levels and the privileges they provide.

/public/markets/{market }/tickers

GET

Description

Get ticker of specific market.

Parameters
NameLocated inDescriptionRequiredSchema
marketpathYesstring
Responses
CodeDescriptionSchema
200Get ticker of specific market.Ticker

/public/markets/tickers

GET

Description

Get ticker of all markets (For response doc see /:market/tickers/ response).

Responses
CodeDescriptionSchema
200Get ticker of all markets (For response doc see /:market/tickers/ response).Ticker

/public/markets/{market }/k-line

GET

Description

Get OHLC(k line) of specific market.

Parameters
NameLocated inDescriptionRequiredSchema
marketpathYesstring
periodqueryTime period of K line, default to 1. You can choose between 1, 5, 15, 30, 60, 120, 240, 360, 720, 1440, 4320, 10080Nointeger
time_fromqueryAn integer represents the seconds elapsed since Unix epoch. If set, only k-line data after that time will be returned.Nointeger
time_toqueryAn integer represents the seconds elapsed since Unix epoch. If set, only k-line data till that time will be returned.Nointeger
limitqueryLimit the number of returned data points default to 30. Ignored if time_from and time_to are given.Nointeger
Responses
CodeDescription
200Get OHLC(k line) of specific market.

/public/markets/{market }/depth

GET

Description

Get depth or specified market. Both asks and bids are sorted from highest price to lowest.

Parameters
NameLocated inDescriptionRequiredSchema
marketpathYesstring
limitqueryLimit the number of returned price levels. Default to 300.Nointeger
Responses
CodeDescription
200Get depth or specified market. Both asks and bids are sorted from highest price to lowest.

/public/markets/{market }/trades

GET

Description

Get recent trades on market, each trade is included only once. Trades are sorted in reverse creation order.

Parameters
NameLocated inDescriptionRequiredSchema
marketpathYesstring
limitqueryLimit the number of returned trades. Default to 100.Nointeger
timestampqueryAn integer represents the seconds elapsed since Unix epoch.If set, only trades executed before the time will be returned.Nointeger
order_byqueryIf set, returned trades will be sorted in specific order, default to 'desc'.Nostring
Responses
CodeDescriptionSchema
200Get recent trades on market, each trade is included only once. Trades are sorted in reverse creation order.[ Trade ]

/public/markets/{market }/order-book

GET

Description

Get the order book of specified market.

Parameters
NameLocated inDescriptionRequiredSchema
marketpathYesstring
asks_limitqueryLimit the number of returned sell orders. Default to 20.Nointeger
bids_limitqueryLimit the number of returned buy orders. Default to 20.Nointeger
Responses
CodeDescriptionSchema
200Get the order book of specified market.[ OrderBook ]

/public/markets

GET

Description

Get all available markets.

Parameters
NameLocated inDescriptionRequiredSchema
limitqueryLimit the number of returned paginations. Defaults to 100.Nointeger
pagequerySpecify the page of paginated results.Nointeger
orderingqueryIf set, returned values will be sorted in specific order, defaults to 'asc'.Nostring
order_byqueryName of the field, which result will be ordered by.Nostring
base_unitqueryStrict filter for base unitNostring
quote_unitqueryStrict filter for quote unitNostring
searchqueryNojson
search[base_code]querySearch base currency code using LIKENostring
search[quote_code]querySearch qoute currency code using LIKENostring
search[base_name]querySearch base currency name using LIKENostring
search[quote_name]querySearch quote currency name using LIKENostring
Responses
CodeDescriptionSchema
200Get all available markets.[ Market ]

/public/currencies

GET

Description

Get list of currencies

Parameters
NameLocated inDescriptionRequiredSchema
limitqueryLimit the number of returned paginations. Defaults to 100.Nointeger
pagequerySpecify the page of paginated results.Nointeger
typequeryCurrency typeNostring
searchqueryNojson
search[code]querySearch by currency code using SQL LIKENostring
search[name]querySearch by currency name using SQL LIKENostring
Responses
CodeDescriptionSchema
200Get list of currencies[ Currency ]

/public/currencies/{id }

GET

Description

Get a currency

Parameters
NameLocated inDescriptionRequiredSchema
idpathCurrency code.Yesstring
Responses
CodeDescriptionSchema
200Get a currencyCurrency

/account/transactions

GET

Description

Get your transactions history.

Parameters
NameLocated inDescriptionRequiredSchema
currencyqueryCurrency codeNostring
order_byquerySorting orderNostring
time_fromqueryAn integer represents the seconds elapsed since Unix epoch.Nointeger
time_toqueryAn integer represents the seconds elapsed since Unix epoch.Nointeger
deposit_statequeryFilter deposits by states.Nostring
withdraw_statequeryFilter withdraws by states.Nostring
txidqueryTransaction id.Nostring
limitqueryLimit the number of returned transactions. Default to 100.Nointeger
pagequerySpecify the page of paginated results.Nointeger
Responses
CodeDescription
200Get your transactions history.

/account/withdraws

POST

Description

Creates new withdrawal to active beneficiary.

Parameters
NameLocated inDescriptionRequiredSchema
otpformDataOTP to perform actionYesinteger
beneficiary_idformDataID of Active Beneficiary belonging to user.Yesinteger
currencyformDataThe currency code.Yesstring
amountformDataThe amount to withdraw.Yesdouble
noteformDataOptional metadata to be applied to the transaction. Used to tag transactions with memorable comments.Nostring
Responses
CodeDescription
201Creates new withdrawal to active beneficiary.

GET

Description

List your withdraws as paginated collection.

Parameters
NameLocated inDescriptionRequiredSchema
currencyqueryCurrency code.Nostring
limitqueryNumber of withdraws per page (defaults to 100, maximum is 100).Nointeger
statequeryFilter withdrawals by states.Nostring
ridqueryWallet address on the Blockchain.Nostring
pagequeryPage number (defaults to 1).Nointeger
Responses
CodeDescriptionSchema
200List your withdraws as paginated collection.[ Withdraw ]

/account/beneficiaries/{id }

DELETE

Description

Delete beneficiary

Parameters
NameLocated inDescriptionRequiredSchema
idpathBeneficiary Identifier in DatabaseYesinteger
Responses
CodeDescription
204Delete beneficiary

GET

Description

Get beneficiary by ID

Parameters
NameLocated inDescriptionRequiredSchema
idpathBeneficiary Identifier in DatabaseYesinteger
Responses
CodeDescriptionSchema
200Get beneficiary by IDBeneficiary

/account/beneficiaries/{id }/activate

PATCH

Description

Activates beneficiary with pin

Parameters
NameLocated inDescriptionRequiredSchema
idpathBeneficiary Identifier in DatabaseYesinteger
pinformDataPin code for beneficiary activationYesinteger
Responses
CodeDescriptionSchema
200Activates beneficiary with pinBeneficiary

/account/beneficiaries/{id }/resend_pin

PATCH

Description

Resend beneficiary pin

Parameters
NameLocated inDescriptionRequiredSchema
idpathBeneficiary Identifier in DatabaseYesinteger
Responses
CodeDescription
200Resend beneficiary pin

/account/beneficiaries

POST

Description

Create new beneficiary

Parameters
NameLocated inDescriptionRequiredSchema
currencyformDataBeneficiary currency code.Yesstring
nameformDataHuman rememberable name which refer beneficiary.Yesstring
descriptionformDataHuman rememberable name which refer beneficiary.Nostring
dataformDataBeneficiary data in JSON formatYesjson
Responses
CodeDescriptionSchema
201Create new beneficiaryBeneficiary

GET

Description

Get list of user beneficiaries

Parameters
NameLocated inDescriptionRequiredSchema
currencyqueryBeneficiary currency code.Nostring
statequeryDefines either beneficiary active - user can use it to withdraw moneyor pending - requires beneficiary activation with pin.Nostring
Responses
CodeDescriptionSchema
200Get list of user beneficiaries[ Beneficiary ]

/account/deposit_address/{currency }

GET

Description

Returns deposit address for account you want to deposit to by currency. The address may be blank because address generation process is still in progress. If this case you should try again later.

Parameters
NameLocated inDescriptionRequiredSchema
currencypathThe account you want to deposit to.Yesstring
address_formatqueryAddress format legacy/cashNostring
Responses
CodeDescriptionSchema
200Returns deposit address for account you want to deposit to by currency. The address may be blank because address generation process is still in progress. If this case you should try again later.Deposit

/account/deposits/{txid }

GET

Description

Get details of specific deposit.

Parameters
NameLocated inDescriptionRequiredSchema
txidpathDeposit transaction idYesstring
Responses
CodeDescriptionSchema
200Get details of specific deposit.Deposit

/account/deposits

GET

Description

Get your deposits history.

Parameters
NameLocated inDescriptionRequiredSchema
currencyqueryCurrency codeNostring
statequeryFilter deposits by states.Nostring
txidqueryDeposit transaction id.Nostring
limitqueryNumber of deposits per page (defaults to 100, maximum is 100).Nointeger
pagequeryPage number (defaults to 1).Nointeger
Responses
CodeDescriptionSchema
200Get your deposits history.[ Deposit ]

/account/balances/{currency }

GET

Description

Get user account by currency

Parameters
NameLocated inDescriptionRequiredSchema
currencypathThe currency code.Yesstring
Responses
CodeDescriptionSchema
200Get user account by currencyAccount

/account/balances

GET

Description

Get list of user accounts

Parameters
NameLocated inDescriptionRequiredSchema
limitqueryLimit the number of returned paginations. Defaults to 100.Nointeger
pagequerySpecify the page of paginated results.Nointeger
nonzeroqueryFilter non zero balances.NoBoolean
searchqueryNojson
search[currency_code]queryNostring
search[currency_name]queryNostring
Responses
CodeDescriptionSchema
200Get list of user accounts[ Account ]

/market/trades

GET

Description

Get your executed trades. Trades are sorted in reverse creation order.

Parameters
NameLocated inDescriptionRequiredSchema
marketqueryNostring
limitqueryLimit the number of returned trades. Default to 100.Nointeger
pagequerySpecify the page of paginated results.Nointeger
time_fromqueryAn integer represents the seconds elapsed since Unix epoch.If set, only trades executed after the time will be returned.Nointeger
time_toqueryAn integer represents the seconds elapsed since Unix epoch.If set, only trades executed before the time will be returned.Nointeger
order_byqueryIf set, returned trades will be sorted in specific order, default to 'desc'.Nostring
Responses
CodeDescriptionSchema
200Get your executed trades. Trades are sorted in reverse creation order.[ Trade ]

/market/orders/cancel

POST

Description

Cancel all my orders.

Parameters
NameLocated inDescriptionRequiredSchema
marketformDataNostring
sideformDataIf present, only sell orders (asks) or buy orders (bids) will be canncelled.Nostring
Responses
CodeDescriptionSchema
201Cancel all my orders.Order

/market/orders/{id }/cancel

POST

Description

Cancel an order.

Parameters
NameLocated inDescriptionRequiredSchema
idpathYesstring
Responses
CodeDescription
201Cancel an order.

/market/orders

POST

Description

Create a Sell/Buy order.

Parameters
NameLocated inDescriptionRequiredSchema
marketformDataYesstring
sideformDataYesstring
volumeformDataYesdouble
ord_typeformDataNostring
priceformDataYesdouble
Responses
CodeDescriptionSchema
201Create a Sell/Buy order.Order

GET

Description

Get your orders, result is paginated.

Parameters
NameLocated inDescriptionRequiredSchema
marketqueryNostring
base_unitqueryNostring
quote_unitqueryNostring
statequeryFilter order by state.Nostring
limitqueryLimit the number of returned orders, default to 100.Nointeger
pagequerySpecify the page of paginated results.Nointeger
order_byqueryIf set, returned orders will be sorted in specific order, default to "desc".Nostring
ord_typequeryFilter order by ord_type.Nostring
typequeryFilter order by type.Nostring
time_fromqueryAn integer represents the seconds elapsed since Unix epoch.If set, only orders created after the time will be returned.Nointeger
time_toqueryAn integer represents the seconds elapsed since Unix epoch.If set, only orders created before the time will be returned.Nointeger
Responses
CodeDescriptionSchema
200Get your orders, result is paginated.[ Order ]

/market/orders/{id }

GET

Description

Get information of specified order.

Parameters
NameLocated inDescriptionRequiredSchema
idpathYesstring
Responses
CodeDescriptionSchema
200Get information of specified order.Order

Models

TradingFee

Returns trading_fees table as paginated collection

NameTypeDescriptionRequired
idintegerUnique trading fee table identifier in database.No
groupstringMember group for define maker/taker fee.No
market_idstringMarket id for define maker/taker fee.No
makerdoubleMarket maker fee.No
takerdoubleMarket taker fee.No
created_atstringTrading fee table created time in iso8601 format.No
updated_atstringTrading fee table updated time in iso8601 format.No

Ticker

Get ticker of all markets (For response doc see /:market/tickers/ response).

NameTypeDescriptionRequired
atintegerTimestamp of tickerNo
tickerTickerEntryTicker entry for specified timeNo

TickerEntry

NameTypeDescriptionRequired
lowdoubleThe lowest trade price during last 24 hours (0.0 if no trades executed during last 24 hours)No
highdoubleThe highest trade price during last 24 hours (0.0 if no trades executed during last 24 hours)No
opendoublePrice of the first trade executed 24 hours ago or lessNo
lastdoubleThe last executed trade priceNo
volumedoubleTotal volume of trades executed during last 24 hoursNo
amountdoubleTotal amount of trades executed during last 24 hoursNo
voldoubleAlias to volumeNo
avg_pricedoubleAverage price more precisely VWAP is calculated by adding up the total traded for every transaction(price multiplied by the number of shares traded) and then dividing by the total shares tradedNo
price_change_percentstringPrice change in the next format +3.19%.Price change is calculated using next formula (last - open) / open * 100%No
atintegerTimestamp of tickerNo

Trade

Get your executed trades. Trades are sorted in reverse creation order.

NameTypeDescriptionRequired
idstringTrade ID.No
pricedoubleTrade price.No
amountdoubleTrade amount.No
totaldoubleTrade total (Amount * Price).No
fee_currencydoubleCurrency user's fees were charged in.No
feedoublePercentage of fee user was charged for performed trade.No
fee_amountdoubleAmount of fee user was charged for performed trade.No
marketstringTrade market id.No
created_atstringTrade create time in iso8601 format.No
taker_typestringTrade taker order type (sell or buy).No
sidestringTrade side.No
order_idintegerOrder id.No

OrderBook

Get the order book of specified market.

NameTypeDescriptionRequired
asks[ Order ]Asks in orderbookNo
bids[ Order ]Bids in orderbookNo

Order

Get your orders, result is paginated.

NameTypeDescriptionRequired
idintegerUnique order id.No
uuidstringUnique order UUID.No
sidestringEither 'sell' or 'buy'.No
ord_typestringType of order, either 'limit' or 'market'.No
pricedoublePrice for each unit. e.g.If you want to sell/buy 1 btc at 3000 usd, the price is '3000.0'No
avg_pricedoubleAverage execution price, average of price in trades.No
statestringOne of 'wait', 'done', or 'cancel'.An order in 'wait' is an active order, waiting fulfillment;a 'done' order is an order fulfilled;'cancel' means the order has been canceled.No
marketstringThe market in which the order is placed, e.g. 'btcusd'.All available markets can be found at /api/v2/markets.No
created_atstringOrder create time in iso8601 format.No
updated_atstringOrder updated time in iso8601 format.No
origin_volumedoubleThe amount user want to sell/buy.An order could be partially executed,e.g. an order sell 5 btc can be matched with a buy 3 btc order,left 2 btc to be sold; in this case the order's volume would be '5.0',its remaining_volume would be '2.0', its executed volume is '3.0'.No
remaining_volumedoubleThe remaining volume, see 'volume'.No
executed_volumedoubleThe executed volume, see 'volume'.No
trades_countintegerCount of trades.No
trades[ Trade ]Trades wiht this order.No

Market

Get all available markets.

NameTypeDescriptionRequired
idstringUnique market id. It's always in the form of xxxyyy,where xxx is the base currency code, yyy is the quotecurrency code, e.g. 'btcusd'. All available markets canbe found at /api/v2/markets.No
namestringMarket name.No
base_unitstringMarket Base unit.No
quote_unitstringMarket Quote unit.No
min_pricedoubleMinimum order price.No
max_pricedoubleMaximum order price.No
min_amountdoubleMinimum order amount.No
amount_precisiondoublePrecision for order amount.No
price_precisiondoublePrecision for order price.No
statestringMarket state defines if user can see/trade on current market.No

Currency

Get a currency

NameTypeDescriptionRequired
idstringCurrency code.
Example: "btc"
No
namestringCurrency name
Example: "Bitcoin"
No
symbolstringCurrency symbol
Example: "฿"
No
explorer_transactionstringCurrency transaction exprorer url template
Example: "https://testnet.blockchain.info/tx/"
No
explorer_addressstringCurrency address exprorer url template
Example: "https://testnet.blockchain.info/address/"
No
typestringCurrency type
Example: "coin"
No
deposit_enabledstringCurrency deposit possibility status (true/false).No
withdrawal_enabledstringCurrency withdrawal possibility status (true/false).No
deposit_feestringCurrency deposit fee
Example: "0.0"
No
min_deposit_amountstringMinimal deposit amount
Example: "0.0000356"
No
withdraw_feestringCurrency withdraw fee
Example: "0.0"
No
min_withdraw_amountstringMinimal withdraw amount
Example: "0.0"
No
withdraw_limit_24hstringCurrency 24h withdraw limit
Example: "0.1"
No
withdraw_limit_72hstringCurrency 72h withdraw limit
Example: "0.2"
No
base_factorstringCurrency base factor
Example: 100000000
No
precisionstringCurrency precision
Example: 8
No
positionstringPosition used for defining currencies order
Example: 8
No
icon_urlstringCurrency icon
Example: "https://upload.wikimedia.org/wikipedia/commons/0/05/Ethereum_logo_2014.svg"
No
min_confirmationsstringNumber of confirmations required for confirming deposit or withdrawalNo

Withdraw

List your withdraws as paginated collection.

NameTypeDescriptionRequired
idintegerThe withdrawal id.No
currencystringThe currency code.No
typestringThe withdrawal typeNo
amountstringThe withdrawal amountNo
feedoubleThe exchange fee.No
blockchain_txidstringThe withdrawal transaction id.No
ridstringThe beneficiary ID or wallet address on the Blockchain.No
statestringThe withdrawal state.No
confirmationsintegerNumber of confirmations.No
notestringWithdraw note.No
created_atstringThe datetimes for the withdrawal.No
updated_atstringThe datetimes for the withdrawal.No
done_atstringThe datetime when withdraw was completedNo

Beneficiary

Get list of user beneficiaries

NameTypeDescriptionRequired
idintegerBeneficiary Identifier in DatabaseNo
currencystringBeneficiary currency code.No
namestringHuman rememberable name which refer beneficiary.No
descriptionstringHuman rememberable description of beneficiary.No
datajsonBank Account details for fiat Beneficiary in JSON format.For crypto it's blockchain address.No
statestringDefines either beneficiary active - user can use it to withdraw moneyor pending - requires beneficiary activation with pin.No
sent_atstringTime when last pin was sentNo

Deposit

Get your deposits history.

NameTypeDescriptionRequired
idintegerUnique deposit id.No
currencystringDeposit currency id.No
amountdoubleDeposit amount.No
feedoubleDeposit fee.No
txidstringDeposit transaction id.No
confirmationsintegerNumber of deposit confirmations.No
statestringDeposit state.No
created_atstringThe datetime when deposit was created.No
completed_atstringThe datetime when deposit was completed..No
tidstringThe shared transaction IDNo

Account

Get list of user accounts

NameTypeDescriptionRequired
currencystringCurrency code.No
balancedoubleAccount balance.No
lockeddoubleAccount locked funds.No

Transactions

NameTypeDescriptionRequired
addressstringRecipient address of transaction.No
currencystringTransaction currency id.No
amountdoubleTransaction amount.No
feedoubleTransaction fee.No
txidstringTransaction id.No
statestringTransaction state.No
notestringWithdraw note.No
confirmationsintegerNumber of confirmations.No
created_atstringTransaction created time in iso8601 format.No
updated_atstringTransaction updated time in iso8601 format.No
typestringType of transactionNo

Member

NameTypeDescriptionRequired
uidstringMember UID.No
emailstringMember email.No
accounts[ Account ]Member accounts.No