For the complete documentation index, see llms.txt. This page is also available as Markdown.

Get Portfolio Valuation

GET https://api.sfox.com/v1/account/balance/history

Retrieve a history of the USD value of your account's portfolio at hourly or daily intervals

Request

Query Parameters

Name
Type
Description

start_date required

timestamp

Timestamp of the start of the query. Unix timestamp (ms)

end_date

timestamp

Timestamp of the end of the query. Unix timestamp (ms)

interval

int

Timeseries interval (sec). Possible values: 3600 (hourly), 86400 (daily)

Default value: 86400

Example Request

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)

Response

Response Body

Key
Type
Description

data

[object]

An array of portfolio value objects, each object with a timestamp and usd_value

timestamp

timestamp

Unix timestamp (ms) of the valuation

usd_value

number

USD valuation of your portfolio as of the timestamp

Responses

Last updated