GET /v1/holdings

Investment positions with their latest market value

Auth. Send the token in the X-Ledger-Token header.

Parameters

NameInTypeRequiredDescription
account_idquerystringoptional

Responses

StatusMeaningBody
200Holdings, ordered by account then symbolHolding[]
400Request rejectedError
429Too many requests from this client address. Wait the number of seconds in Retry-After, then try again.Error

Example response

[
  {
    "id": "string",
    "account_id": "string",
    "symbol": "string",
    "description": "string",
    "currency": "string",
    "shares": 0,
    "purchase_price": "string",
    "cost_basis_cents": 0,
    "created_at": "2026-10-11T00:00:00Z",
    "as_of": "2026-10-11T00:00:00Z",
    "market_value_cents": 0
  }
]

Code samples

Set KEY to your own token first.

curl

curl \
  -H X-Ledger-Token:$KEY \
  "https://api.sasek.org/ledger/v1/holdings"

JavaScript

const res = await fetch("https://api.sasek.org/ledger/v1/holdings", {
  headers: { "X-Ledger-Token": KEY },
});
const data = await res.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://api.sasek.org/ledger/v1/holdings",
    method="GET",
    headers={
        "X-Ledger-Token": os.environ["KEY"],
    },
)
with urllib.request.urlopen(request) as response:
    print(json.load(response))