Get Trades
API URL: POST https://userapi-demo.s2f.projectx.com/DataExport/trades
API Reference: /DataExport/trades
Description
Retrieves a list of all trades. Maximum request data range of 30 days.
Parameters
Name | Type | Description | Required | Nullable |
---|---|---|---|---|
from | datetime | Retrieves list of positions that have been created or updated after this time. | true | false |
to | datetime | Retrieves list of positions that have been created or updated before this time. | true | false |
Example Usage
Example Request
- Request
- cURL
{
"from": "2024-07-05T17:38:23.621Z",
"to": "2024-07-05T17:38:23.621Z"
}
curl -X 'POST' \
'https://userapi-demo.s2f.projectx.com/trades' \
-H 'accept: text/plain' \
-H 'Content-Type: application/json' \
-d '{
"from": "2024-07-05T17:38:23.621Z",
"to": "2024-07-05T17:38:23.621Z"
}'
Example Response
- Success
{
"data": [
{
"id": 8508,
"contractGroupId": "F.US.MES",
"contractGroupName": "/MES",
"contractId": "CON.F.US.MES.H25",
"contractName": "MESH5",
"tradeDay": "2025-01-15T06:00:00+00:00",
"createdAt": "2025-01-15T17:35:58.566225+00:00",
"tradeDuration": null,
"price": 5975.500000000,
"fees": 0.3700,
"action": 1,
"lots": 1,
"status": 1,
"pairedTradeId": null,
"pnl": 0.000000000,
"tradingAccountId": 213,
"orderId": 14117,
"enteredAt": "2025-01-15T17:35:58.566225+00:00",
"exitedAt": null,
"entryPrice": 5975.500000000,
"exitPrice": null,
"voided": false,
"orderCreationDisposition": 0
}
],
"success": true,
"errorMessage": "string"
}