curl --request GET \
--url https://api.anchorage-staging.com/v2/trading/trades \
--header 'Api-Access-Key: <api-key>'import requests
url = "https://api.anchorage-staging.com/v2/trading/trades"
headers = {"Api-Access-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'Api-Access-Key': '<api-key>'}};
fetch('https://api.anchorage-staging.com/v2/trading/trades', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
{
"quantitySold": "1",
"currencySold": "USD",
"currencyBought": "BTC",
"price": "11681.67",
"quantityBought": "0.00008561",
"side": "BUY",
"timestamp": "2020-08-31T22:15:31.99999Z",
"tradeID": "e0538774-ebd9-11ea-adc1-0242ac120002",
"quoteID": "06f71d1e-e7e8-11ea-adc1-0242ac120011",
"vault": {
"vaultID": "1c920f4241b78a1d483a29f3c24b6c4c"
},
"tradeStatus": "EXECUTED",
"tradingPair": "BTC-USD",
"fee": "0.01",
"feeCurrency": "USD"
},
{
"quantitySold": "1",
"currencySold": "USD",
"currencyBought": "ETH",
"price": "435.16",
"quantityBought": "0.00230049",
"side": "BUY",
"timestamp": "2020-08-31T22:14:07.99999Z",
"tradeID": "d1ae1416-ebd7-11ea-adc1-0242ac120002",
"quoteID": "06f71d1e-e7e8-11ea-adc1-0242ac120002",
"vault": {
"vaultID": "1c920f4241b78a1d483a29f3c24b6c4c"
},
"tradeStatus": "EXECUTED",
"tradingPair": "ETH-USD",
"fee": "0.01",
"feeCurrency": "USD"
}
],
"page": {
"next": "/v2/trading/trades?endDate=2020-08-31T22:14:07Z&limit=2"
}
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}List trades
Permissions required: Execute trades or Read trade activity
List all trades. With the permission Read trade activity all trades of the organization may be read. With the permission Execute trades only the trades created by this API key may be read.
Trades are sorted in a descending order by their timestamp, i.e. the most recent trade or the trade with a timestamp closest to endDate is listed first.
Filters
You may optionally supply the following filters:
- Specify a
tradingPairto filter by the trading pair of the trade, for exampleBTC-USD. - Specify one or multiple
statusto filter trades. Multiple statuses should be separated by commas. - Specify a
sideto filter by the side of the trade.
curl --request GET \
--url https://api.anchorage-staging.com/v2/trading/trades \
--header 'Api-Access-Key: <api-key>'import requests
url = "https://api.anchorage-staging.com/v2/trading/trades"
headers = {"Api-Access-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'Api-Access-Key': '<api-key>'}};
fetch('https://api.anchorage-staging.com/v2/trading/trades', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
{
"quantitySold": "1",
"currencySold": "USD",
"currencyBought": "BTC",
"price": "11681.67",
"quantityBought": "0.00008561",
"side": "BUY",
"timestamp": "2020-08-31T22:15:31.99999Z",
"tradeID": "e0538774-ebd9-11ea-adc1-0242ac120002",
"quoteID": "06f71d1e-e7e8-11ea-adc1-0242ac120011",
"vault": {
"vaultID": "1c920f4241b78a1d483a29f3c24b6c4c"
},
"tradeStatus": "EXECUTED",
"tradingPair": "BTC-USD",
"fee": "0.01",
"feeCurrency": "USD"
},
{
"quantitySold": "1",
"currencySold": "USD",
"currencyBought": "ETH",
"price": "435.16",
"quantityBought": "0.00230049",
"side": "BUY",
"timestamp": "2020-08-31T22:14:07.99999Z",
"tradeID": "d1ae1416-ebd7-11ea-adc1-0242ac120002",
"quoteID": "06f71d1e-e7e8-11ea-adc1-0242ac120002",
"vault": {
"vaultID": "1c920f4241b78a1d483a29f3c24b6c4c"
},
"tradeStatus": "EXECUTED",
"tradingPair": "ETH-USD",
"fee": "0.01",
"feeCurrency": "USD"
}
],
"page": {
"next": "/v2/trading/trades?endDate=2020-08-31T22:14:07Z&limit=2"
}
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}Query Parameters
The start date of the trades (inclusive) in YYYY-MM-DD format. The earliest valid start date is 2017-01-01. The last valid start date is the current date. A startDate of '2021-01-10' is equivalent to a startDateTime of '2021-01-10.00:00:00.000000000'. Dates are always in UTC RFC 3339 'full-date'.
The end date of the trades (exclusive) in YYYY-MM-DD format. The latest valid end date is the current date. If not provided, defaults to the most recently closed day. An endDate of '2021-01-10' is equivalent to an endDateTime of '2021-01-10.00:00:00.000000000'. Dates are always in UTC RFC 3339 'full-date'.
The start date-time of the trades (exclusive) in YYYY-MM-DDTHH:MM:SS.nnnnnnnnn format. The earliest valid start date-time is '2017-01-01T00:00:00.000000000'. The last valid start date-time is the current date-time. startDateTime will be used if both startDate and startDateTime are specified. Date-times are always in UTC RFC 3339 'date-time'.
The end date-time of the trades (exclusive) in YYYY-MM-DDTHH:MM:SS.nnnnnnnnn format. The latest valid end date-time is the current date-time. The earliest valid end date-time is '2017-01-01T00:00:00.000000000'. endDateTime will be used if both endDate and endDateTime are specified. Date-times are always in UTC RFC 3339 'date-time'.
Was this page helpful?