Overview
The HTTP API allows read access to public market data through the public endpoints and read / write access to your private account via the private endpoints.
- HTTP API:
https://api.poloniex.com/
Authentication (API Signature) is not required for any public requests.
Private HTTP endpoints e.g. https://api.poloniex.com/orders
are authenticated using HMAC-SHA256 signed request. See details here Authentication.
Symbol convention is <base_currency>_<quote_currency>
e.g. BTC_USDT, which is opposite from legacy system, which follows <quote_currency>_<base_currency>
format e.g. USDT_BTC.
Authentication
Authentication (API Signature) is not required for any public requests.
All private HTTP endpoints require authentication using HMAC-SHA256 signed request with the following headers:
- “key” - entry whose value is api caller’s apiKey. e.g. “A…-99…”
- “signatureMethod” - optional entry whose value is signature method. e.g. “hmacSHA256”
- “signatureVersion” - optional entry whose value is signature version. e.g. “1“
- “signTimestamp” - entry whose value is a timestamp. e.g. “1649371360000“
- “signature” - entry whose value is the signature generated by API caller for the request. e.g. “4F…%3D”.
- "recvWindow" - optional entry whose value is duration in milliseconds. e.g. "1500". This field provides an additional layer of control, where if specified, the request will be rejected if the (poloniex system time - signTimestamp) is in excesss of recvWindow. Below are the error code responses:
- 400: signTimestamp is more than 1 second from poloniex system time
- 408: request timeout as recWindow threshold has been breached
Note: POST\DELETE requests should contain application/json type content and be in valid JSON format.
Signature Example Code
We provide signature codes in three languages, Java/Python/NodeJS, and examples of request codes, Here.
API Signature Generation
Steps:
- Compose a “Request String” to be used for the generation of the digital signature which would include:
- Method type (GET/POST/DELETE/etc) followed
"\n"
e.g.GET\n
- Access path, followed
"\n"
e.g./orders\n
- Add the timestamp parameter and List of parameters sorted by ASCII order delimited by
&
e.g.:limit=5&signTimestamp=1659259836247&symbol=ETH_USDT
- NOTE: all parameters must be URL/UTF-8 encoded. i.e. space is encoded as
"%20"
- The final string for the signature generation, based on the example values above will be:
GET\n
/orders\n
limit=5&symbol=ETH_USDT
- DELETE or POST Method with http body, for example: To cancel orders by IDs:
/orders/cancelByIds\n
- Add requestBody and timestamp:
requestBody={"orderIds":["1234567890"],"clientOrderIds": ["myId-1"]}
signTimestamp=1631018760000
- Timestamp needs to be added. Timestamps are valid for 1 minute. Connect the parameters in the above order with the character "&":
requestBody={"orderIds":["1234567890"],"clientOrderIds":["myId-1"]}&signTimestamp=1631018760000}
- The final string to be used for signature calculation is composed as follows:
DELETE\n
/orders/cancelByIds/\n
- Add requestBody and timestamp:
- DELETE or POST Method with no http body, for example : To Cancel Order by Id:
/orders/1
- Timestamp needs to be added. Timestamps are valid for 1 minute.
signTimestamp=1631018760000
- The final string to be used for signature calculation is composed as follows:
DELETE\n
/orders/1\n
signTimestamp=1631018760000
- Timestamp needs to be added. Timestamps are valid for 1 minute.
- Method type (GET/POST/DELETE/etc) followed
- Generate a digital signature using the "Request String" generated in the previous step and your key (Secret Key):
- Call the HmacSHA256 hash function to get the hash value with the request string and API private key obtained in the previous step as two parameters.
- Encode this hash with base-64 and the resulting value is used as the digital signature for this interface call.
- Example:
5g4Rx5A2bLyMWFgR3Aqp+B4w+iJkL7n5OD3SuYtCJK8=
- Request example using the above generated signature:
Note: POST\DELETE requests should contain application/json type content and be in valid JSON format.
Sample GET command:
curl -X GET \
--header 'key: A3xxxxxx-99xxxxxx-84xxxxxx-72xxxxxx' \
--header 'signatureMethod: HmacSHA256' \
--header 'signatureVersion: 2' \
--header 'signTimestamp: 1631018760000' \
--header 'signature: 5g4Rx5A2bLyMWFgR3Aqp+B4w+iJkL7n5OD3SuYtCJK8=' \
'https://api.poloniex.com/orders?symbol=ETH_USDT&limit=5'
Rate Limits
You can use the following table and refer to the frequency limit rules to rationally use your trading strategy.
Email client services (api-support@poloniex.com) with any questions.
Note: Interfaces related to transactions and accounts are frequency limited based on the UID dimension. The market-related interfaces are frequency limited based on IP latitude. VIP level refers to the fee level.
Type | Interface Name | Method | Url | VIP0 | VIP1-2 | VIP3-4 | VIP5-6 | VIP7-9 |
---|---|---|---|---|---|---|---|---|
Order | Create Order | POST | /orders | 50 | 75 | 100 | 150 | 200 |
Create Multiple Orders | POST | /orders/batch | 10 | 15 | 20 | 30 | 40 | |
Cancel Replace Order | PUT | /orders/{id} | 50 | 75 | 100 | 150 | 200 | |
Open Orders | GET | /orders | 50 | 75 | 100 | 150 | 200 | |
Order Details | GET | /orders/{id} | 50 | 75 | 100 | 150 | 200 | |
Cancel Order by Id | DELETE | /orders/{id} | 50 | 75 | 100 | 150 | 200 | |
Cancel Multiple Orders by Ids | DELETE | /orders/cancelByIds | 10 | 15 | 20 | 30 | 40 | |
Cancel All Orders | DELETE | /orders | 10 | 15 | 20 | 30 | 40 | |
Kill Switch | POST | /orders/killSwitch | 50 | 75 | 100 | 150 | 200 | |
Kill Switch Status | GET | /orders/killSwitchStatus | 50 | 75 | 100 | 150 | 200 | |
Account | Account Information | GET | /accounts | 50 | 75 | 100 | 150 | 200 |
All Account Balances | GET | /accounts/balances | 50 | 75 | 100 | 150 | 200 | |
Account Activity | GET | /accounts/activity | 10 | 15 | 20 | 30 | 40 | |
Accounts Transfer | POST | /accounts/transfer | 50 | 75 | 100 | 150 | 200 | |
Accounts Transfer Records | GET | /accounts/transfer | 10 | 15 | 20 | 30 | 40 | |
Fee Info | GET | /feeinfo | 50 | 75 | 100 | 150 | 200 | |
Interest History | GET | /accounts/interest/history | 50 | 75 | 100 | 150 | 200 | |
Subaccounts | Subaccount Information | GET | /subaccounts | 10 | 15 | 20 | 30 | 40 |
Subaccount Balances | GET | /subaccounts/balances | 50 | 75 | 100 | 150 | 200 | |
Subaccount Transfer | POST | /subaccounts/transfer | 50 | 75 | 100 | 150 | 200 | |
Subaccount Transfer Records | GET | /subaccounts/transfer | 10 | 15 | 20 | 30 | 40 | |
Wallets | Deposit Addresses | GET | /wallets/addresses | 50 | 75 | 100 | 150 | 200 |
Wallets Activity Records | GET | /wallets/activity | 10 | 15 | 20 | 30 | 40 | |
New Currency Address | POST | /wallets/address | 50 | 75 | 100 | 150 | 200 | |
Withdraw Currency | POST | /wallets/withdraw | 10 | 15 | 20 | 30 | 40 | |
Withdraw Currency V2 | POST | /v2/wallets/withdraw | 10 | 15 | 20 | 30 | 40 | |
Margin | Account Margin | GET | /margin/accountMargin | 50 | 75 | 100 | 150 | 200 |
Borrow Status | GET | /margin/borrowStatus | 50 | 75 | 100 | 150 | 200 | |
Maximum Buy/Sell Amount | GET | /margin/maxSize | 50 | 75 | 100 | 150 | 200 | |
Smart Orders | Create Order | POST | /smartorders | 50 | 75 | 100 | 150 | 200 |
Cancel Replace Order | PUT | /smartorders/{id} | 50 | 75 | 100 | 150 | 200 | |
Open Orders | GET | /smartorders | 10 | 15 | 20 | 30 | 40 | |
Order Details | GET | /smartorders/{id} | 50 | 75 | 100 | 150 | 200 | |
Cancel Order by Id | DELETE | /smartorders/{id} | 50 | 75 | 100 | 150 | 200 | |
Cancel Multiple Orders by Id | DELETE | /smartorders/cancelByIds | 10 | 15 | 20 | 30 | 40 | |
Cancel All Orders | DELETE | /smartorders | 10 | 15 | 20 | 30 | 40 | |
Order History | Orders History | GET | /orders/history | 10 | 15 | 20 | 30 | 40 |
Smart Orders History | GET | /smartorders/history | 10 | 15 | 20 | 30 | 40 | |
Trades | Trade History | GET | /trades | 10 | 15 | 20 | 30 | 40 |
Trades by Order Id | GET | /orders/{id}/trades | 50 | 75 | 100 | 150 | 200 |
Type | Interface Name | Url | Rate Limit (per second) |
---|---|---|---|
Public Data | Symbol Information | /markets/{symbol} | 200 |
Currency Information | /currencies/{currency} | ||
CurrencyV2 Information | /v2/currencies/{currency} | ||
System Timestamp | /timestamp | ||
Prices | /markets/{symbol}/price | ||
Mark Price | /markets/{symbol}/markPrice | ||
Mark Price Components | /markets/{symbol}/markPriceComponents | ||
Order Book | /markets/{symbol}/orderBook | ||
Candles | /markets/{symbol}/candles | ||
Trades | /markets/{symbol}/trades | ||
Ticker | /markets/{symbol}/ticker24h | ||
Collateral Info | /markets/{currency}/collateralInfo | ||
Borrow Rates Info | /markets/borrowRatesInfo | ||
Symbol Information | /markets | 30 | |
Currency Information | /currencies | ||
CurrencyV2 Information | /v2/currencies/{currency} | ||
Prices | /markets/price | ||
Mark Price | /markets/markPrice | ||
Ticker | /markets/ticker24h | ||
Collateral Info | /markets/collateralInfo |