curl --request GET \
--url https://api.burokku.app/v1/pnl \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.burokku.app/v1/pnl', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.burokku.app/v1/pnl"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"range": "1D",
"start_usd": 123,
"end_usd": 123,
"change_usd": 123,
"change_pct": 123,
"high_usd": 123,
"low_usd": 123,
"points": [
{
"at": "2023-11-07T05:31:56Z",
"usd": 123
}
],
"unrealised": {
"pnl_usd": 123,
"cost_usd": 123,
"roi_pct": 123,
"coverage_pct": 123,
"by_holding": [
{
"symbol": "<string>",
"pnl_usd": 123,
"cost_usd": 123,
"roi_pct": 123,
"partial": true
}
]
},
"note": "<string>",
"read_at": "2023-11-07T05:31:56Z",
"refreshing": true,
"currency": {
"code": "<string>",
"per_usd": 123
},
"drivers": {
"coins": [
{
"symbol": "<string>",
"usd": 123,
"pct": 123
}
],
"fees": {
"network_usd": 123,
"perp_trading_usd": 123,
"bots_usd": 123,
"funding_paid_usd": 123,
"total_usd": 123
},
"by_source": [
{
"kind": "<string>",
"name": "<string>",
"usd": 123,
"venue": "<string>"
}
],
"perps": {
"realised_usd": 123,
"funding_usd": 123,
"fees_usd": 123,
"open_unrealised_usd": 123
},
"activity_from": "2023-11-07T05:31:56Z"
}
}Profit and loss
Use this when the user asks how their net worth or profit and loss moved over a period. Returns the change in dollars and percent, the high, the low and up to 13 points; for 1D, 1W and 1M also what drove it (coins, accounts, realised perp PnL, funding and fees); and unrealised PnL on holdings whose cost Burokku knows. These are not tax figures.
curl --request GET \
--url https://api.burokku.app/v1/pnl \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.burokku.app/v1/pnl', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.burokku.app/v1/pnl"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"range": "1D",
"start_usd": 123,
"end_usd": 123,
"change_usd": 123,
"change_pct": 123,
"high_usd": 123,
"low_usd": 123,
"points": [
{
"at": "2023-11-07T05:31:56Z",
"usd": 123
}
],
"unrealised": {
"pnl_usd": 123,
"cost_usd": 123,
"roi_pct": 123,
"coverage_pct": 123,
"by_holding": [
{
"symbol": "<string>",
"pnl_usd": 123,
"cost_usd": 123,
"roi_pct": 123,
"partial": true
}
]
},
"note": "<string>",
"read_at": "2023-11-07T05:31:56Z",
"refreshing": true,
"currency": {
"code": "<string>",
"per_usd": 123
},
"drivers": {
"coins": [
{
"symbol": "<string>",
"usd": 123,
"pct": 123
}
],
"fees": {
"network_usd": 123,
"perp_trading_usd": 123,
"bots_usd": 123,
"funding_paid_usd": 123,
"total_usd": 123
},
"by_source": [
{
"kind": "<string>",
"name": "<string>",
"usd": 123,
"venue": "<string>"
}
],
"perps": {
"realised_usd": 123,
"funding_usd": 123,
"fees_usd": 123,
"open_unrealised_usd": 123
},
"activity_from": "2023-11-07T05:31:56Z"
}
}인증
OAuth 2.1 for apps that act for a Burokku user: the authorization code grant with PKCE (S256) required of every client. Clients use a Client ID Metadata Document, or register at /oauth/register (at most 20 registrations an hour from one network). Set resource to https://api.burokku.app/v1: a token issued for the MCP server (the default without resource) is refused here with a 401 (invalid-token); a token is for one resource, so authorize once for each and refresh with the same resource (another gets invalid_target). Every grant includes portfolio.read. Authorization server metadata: https://app.burokku.app/.well-known/oauth-authorization-server; this API’s protected resource metadata: https://api.burokku.app/.well-known/oauth-protected-resource/v1. Access tokens last 1 hour; each refresh returns a new refresh token (use the newest), and one unused for 30 days lapses. OAuth errors are JSON, { error, error_description }.
응답
OK
When these figures were read (ISO 8601, UTC).
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$