USD valuation of your portfolio over time
Retrieve a history of the USD value of your account's portfolio at hourly or daily intervals
GET https://api.sfox.com/v1/account/balance/history
GET
https://api.sfox.com/v1/account/balance/history
{ "data": [ { "timestamp": 1701475200000, "usd_value": 349515.64495392627 }, { "timestamp": 1701561600000, "usd_value": 349628.6458040236 }, { "timestamp": 1701648000000, "usd_value": 349653.452981625 }, { "timestamp": 1701734400000, "usd_value": 349301.02066800353 }, { "timestamp": 1701820800000, "usd_value": 350066.51819476683 }, { "timestamp": 1701907200000, "usd_value": 350761.96052562393 } ] }
//Invalid start_date { "error": "start_date must be a valid unix timestamp in milliseconds" } //Invalid end_date { "error": "end_date must be a valid unix timestamp in milliseconds" } // Invalid interval { "error": "interval must be 3600 or 86400" }
curl -H 'Authorization: Bearer <API_TOKEN>' 'https://api.sfox.com/v1/account/balance/history?interval=86400&start_date=1701475200000&end_date=1701734400000'
const axios = require('axios'); axios({ method: 'get', url: 'https://api.sfox.com/v1/account/balance/history?interval=86400&start_date=1701475200000&end_date=1701734400000', headers: { 'Authorization': 'Bearer <API_KEY>' } }).then(response => { console.log(response) }).catch(err => { console.error(err) });
import requests data = requests.get( "https://api.sfox.com/v1/account/balance/history?interval=86400&start_date=1701475200000&end_date=1701734400000", headers={ "Authorization": "Bearer <API_KEY>", } ) print(data)
Last updated 1 month ago
start_date*
Number
Timestamp of the start of the query
Unix timestamp (ms)
end_date
Timestamp of the end of the query
interval
Timeseries interval (sec)
Options:
3600 (hourly)
3600
86400 (daily)
86400
Default: 86400
timestamp
Unix timestamp (ms) of the valuation
usd_value
USD valuation of your portfolio as of the timestamp
1701475200000
349515.64495392627