GET /v1/summary/monthly
Spending and income per account per month
Auth. Send the token in the X-Ledger-Token header.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
account_id | query | string | optional | |
since | query | string | optional | First month to include, YYYY-MM |
limit | query | integer | optional |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | Monthly totals, newest month first | MonthlySummary[] |
400 | Request rejected | Error |
429 | Too many requests from this client address. Wait the number of seconds in Retry-After, then try again. | Error |
Example response
[
{
"account_id": "string",
"month": "string",
"spent_cents": 0,
"received_cents": 0,
"count": 0
}
]
Code samples
Set KEY to your own token first.
curl
curl \
-H X-Ledger-Token:$KEY \
"https://api.sasek.org/ledger/v1/summary/monthly"
JavaScript
const res = await fetch("https://api.sasek.org/ledger/v1/summary/monthly", {
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/summary/monthly",
method="GET",
headers={
"X-Ledger-Token": os.environ["KEY"],
},
)
with urllib.request.urlopen(request) as response:
print(json.load(response))