Trades
Note: Post Aug 1st, 2022, orderId has the format of uniform 17 digits whereas in the legacy system, orderId followed a natural growth pattern. TradeId starts at 60000000 and increments whereas in the legacy system, tradeId incremented with a smaller starting number.Trade History
- GET
https://api.poloniex.com/trades
Get a list of all trades for an account. Interval between startTime and endTime cannot exceed 180 days. If only endTime is populated then startTime will default to 7 days before endTime. If only startTime is populated then endTime will be defaulted to 7 days after startTime. Rest of the trades will be archived before 180 days from current time.
Request Parameter | Data Type | Required | Description |
---|---|---|---|
limit | Integer | false | Max number of records that is returned. Default is 500. Max value is 1000. |
endTime | Long | false | (milliseconds since UNIX epoch) trades filled after endTime will not be retrieved. |
startTime | Long | false | (milliseconds since UNIX epoch) trades filled before startTime will not be retrieved. |
from | Long | false | Globally unique tradeid (use pageId value from response). |
direction | String | false | PRE, NEXT The direction before or after ‘from'. |
symbols | String | false | one or multiple symbols separated by comma e.g. BTC_USDT,ETH_USDT |
Response Field | Data Type | Description |
---|---|---|
id | String | trade id |
symbol | String | The trading symbol, like BTC_USDT |
accountType | String | SPOT |
orderId | String | the associated order's id |
side | String | order's side: BUY, SELL |
type | String | order's type: LIMIT, MARKET, LIMIT_MAKER |
matchRole | String | MAKER, TAKER |
createTime | Long | trade create time |
price | String | price for the trade |
quantity | String | base units for the trade |
amount | String | quote units for the trade |
feeCurrency | String | fee currency name |
feeAmount | String | fee amount |
pageId | String | A globally unique trade Id that can be used as query param in 'from' field |
clientOrderId | String | Order's clientOrderId |
Example output:
[
{
"id": "62561238",
"symbol": "LINK_USDT",
"accountType": "SPOT",
"orderId": "32164923987566592",
"side": "SELL",
"type": "MARKET",
"matchRole": "TAKER",
"createTime": 1648635115525,
"price": "11",
"quantity": "0.5",
"amount": "5.5",
"feeCurrency": "USDT",
"feeAmount": "0.007975",
"pageId": "32164924331503616",
"clientOrderId": "myOwnId-321"
}
]
Trades by Order Id
- GET
https://api.poloniex.com/orders/{id}/trades
Get a list of all trades for an order specified by its orderId.
Request Parameter | Data Type | Required | Description |
---|---|---|---|
id | String | true | the associated order's id (order's clientOrderId is not supported) |
Response Field | Data Type | Description |
---|---|---|
id | String | trade id |
symbol | String | The trading symbol to trade,like 'BTC_USDT'… |
accountType | String | SPOT |
orderId | String | the associated order's id |
side | String | order's side: BUY、SELL |
type | String | order's type: LIMIT, MARKET,LIMIT_MAKER |
matchRole | String | MAKER, TAKER |
createTime | Long | trade create time |
price | String | price for the trade |
quantity | String | base units for the trade |
amount | String | quote units for the trade |
feeCurrency | String | fee currency name |
feeAmount | String | fee amount |
pageId | String | A globally unique trade Id |
clientOrderId | String | Order's clientOrderId |
Example output:
[
{
"id": "68561226",
"symbol": "LINK_USDT",
"accountType": "SPOT",
"orderId": "30249408733945856",
"side": "BUY",
"type": "LIMIT",
"matchRole": "MAKER",
"createTime": 1648200366864,
"price": "3.1",
"quantity": "1",
"amount": "3.1",
"feeCurrency": "LINK",
"feeAmount": "0.00145",
"pageId": "30341456333942784",
"clientOrderId": ""
}
]