Get portfolio history
curl --request GET \
--url https://api.paperdrill.dev/v1/portfolio/history \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.paperdrill.dev/v1/portfolio/history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.paperdrill.dev/v1/portfolio/history"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"quoteAsset": "<string>",
"range": "24h",
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"points": [
{
"at": "2023-11-07T05:31:56Z",
"cash": "125.50",
"positionsValue": "125.50",
"equity": "125.50",
"realizedPnl": "+3.40",
"unrealizedPnl": "+3.40",
"netContributions": "125.50",
"totalPnl": "+3.40",
"partial": true
}
]
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"details": [
{
"field": "qty",
"message": "invalid decimal format"
}
]
},
"requestId": "f4c0baf4-b8d2-4c9a-a17b-c8656c4a7b0e"
}Account
Get portfolio history
Returns persisted portfolio snapshots for a chart. Recent history keeps
every minute; older rows are thinned to one per hour, day, and week, and
snapshots expire after one year. At most 2000 rows are read before the
response is downsampled to 120 chart points. Requires the ACCOUNT_READ scope.
GET
/
portfolio
/
history
Get portfolio history
curl --request GET \
--url https://api.paperdrill.dev/v1/portfolio/history \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.paperdrill.dev/v1/portfolio/history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.paperdrill.dev/v1/portfolio/history"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"quoteAsset": "<string>",
"range": "24h",
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"points": [
{
"at": "2023-11-07T05:31:56Z",
"cash": "125.50",
"positionsValue": "125.50",
"equity": "125.50",
"realizedPnl": "+3.40",
"unrealizedPnl": "+3.40",
"netContributions": "125.50",
"totalPnl": "+3.40",
"partial": true
}
]
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"details": [
{
"field": "qty",
"message": "invalid decimal format"
}
]
},
"requestId": "f4c0baf4-b8d2-4c9a-a17b-c8656c4a7b0e"
}