GET /v1/transactions/export.csv
The transactions matching the same filters as the list, as CSV
Amounts are decimal text with negative meaning money out, as in Ledger CSV v1. Text fields that begin with = + - @ or a tab are prefixed with an apostrophe so spreadsheets do not run them as formulas. At most 10,000 rows.
Auth. Send the token in the X-Ledger-Token header.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
since | query | string (date) | optional | Only rows on or after this date |
until | query | string (date) | optional | |
account_id | query | string | optional | |
category | query | string | optional | |
merchant | query | string | optional | |
q | query | string | optional | |
min_amount | query | integer | optional | |
max_amount | query | integer | optional |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | CSV, with a header row | string |
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
"string"
Code samples
Set KEY to your own token first.
curl
curl \
-H X-Ledger-Token:$KEY \
"https://api.sasek.org/ledger/v1/transactions/export.csv"
JavaScript
const res = await fetch("https://api.sasek.org/ledger/v1/transactions/export.csv", {
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/transactions/export.csv",
method="GET",
headers={
"X-Ledger-Token": os.environ["KEY"],
},
)
with urllib.request.urlopen(request) as response:
print(json.load(response))