Developer API
Recipes
Two complete Developer API scripts, a year of transactions to CSV and a monthly cash-flow table, and a map from Lunch Money and YNAB API concepts.
This page has two complete scripts that read your data through the Developer API, each as a shell script (curl and jq) and as a Python script that uses only the standard library, with the output of a real run. Both take the app’s address from TAIGA_API and a token from TAIGA_TOKEN, and add /api/v1 to every path, so with TAIGA_API=https://app.taiga.finance the requests go to https://app.taiga.finance/api/v1. A read-only token is enough for both; Authentication covers creating one. The runs used a demo household’s seeded data.
How do I export every transaction for a year?
Section titled “How do I export every transaction for a year?”This script writes every transaction dated in one calendar year to CSV, one page of up to 1,000 rows at a time. It needs a token of either kind, and bash with curl, jq and awk, or Python 3.
#!/usr/bin/env bash# Export every transaction of one year to CSV, following next_cursor.# Needs curl and jq. Usage: ./a-export-year.sh 2025 > transactions-2025.csvset -euo pipefail: "${TAIGA_API:?set TAIGA_API, e.g. https://app.example}" "${TAIGA_TOKEN:?set TAIGA_TOKEN}"year=${1:-2025}
get() { # GET $1; on 429 sleep for Retry-After and try again local hdr status body; hdr=$(mktemp) while :; do body=$(curl -sS -D "$hdr" -H "Authorization: Bearer $TAIGA_TOKEN" "$1") status=$(awk 'NR==1{print $2}' "$hdr") if [ "$status" = 429 ]; then sleep "$(awk 'tolower($1)=="retry-after:"{print $2+0}' "$hdr")"; continue fi rm -f "$hdr" [ "$status" = 200 ] || { echo "HTTP $status: $body" >&2; exit 1; } printf '%s' "$body"; return done}
echo "id,split_of,date,account,merchant,category,amount,currency,amount_home"cursor=""while :; do page=$(get "$TAIGA_API/api/v1/transactions?from=$year-01-01&to=$year-12-31&limit=1000${cursor:+&cursor=$cursor}") jq -r '.data[] | [.id, .split_of, .date, .account_name, .merchant, (if .category then .parent_category + "::" + .category else "" end), .amount, .currency, .amount_home] | @csv' <<<"$page" cursor=$(jq -r '.next_cursor // empty' <<<"$page") [ -n "$cursor" ] || breakdone"""Export every transaction of one year to CSV, following next_cursor.
Standard library only. Usage: python3 a-export-year.py 2025 > transactions-2025.csv"""import csvimport jsonimport osimport sysimport timeimport urllib.errorimport urllib.parseimport urllib.request
API = os.environ["TAIGA_API"]TOKEN = os.environ["TAIGA_TOKEN"]
def get(path, **params): """GET a /api/v1 path; on 429 wait for Retry-After and try again.""" url = f"{API}/api/v1{path}?{urllib.parse.urlencode(params)}" req = urllib.request.Request(url, headers={"Authorization": f"Bearer {TOKEN}"}) while True: try: with urllib.request.urlopen(req) as resp: return json.load(resp) except urllib.error.HTTPError as e: if e.code != 429: sys.exit(f"HTTP {e.code}: {e.read().decode()}") time.sleep(int(e.headers.get("Retry-After", "1")))
year = sys.argv[1] if len(sys.argv) > 1 else "2025"out = csv.writer(sys.stdout)out.writerow(["id", "split_of", "date", "account", "merchant", "category", "amount", "currency", "amount_home"])params = {"from": f"{year}-01-01", "to": f"{year}-12-31", "limit": 1000}while True: page = get("/transactions", **params) for t in page["data"]: category = f"{t['parent_category']}::{t['category']}" if t["category"] else "" out.writerow([t["id"], t["split_of"], t["date"], t["account_name"], t["merchant"], category, t["amount"], t["currency"], t["amount_home"]]) if not page["next_cursor"]: break params["cursor"] = page["next_cursor"]The run exported 2025 for one person in the demo household: 1,077 rows over two pages. The first seven rows follow; jq quotes every string, Python’s csv module only where it must.
id,split_of,date,account,merchant,category,amount,currency,amount_home"1610843",,"2025-01-01","Chase Sapphire Preferred","Sweetgreen","Food::Dining Out",-21.47,"USD",-21.47"1610844",,"2025-01-01","Chase Sapphire Preferred","Apple.Com","Utilities::Subscriptions",-6.06,"USD",-6.06"1610845",,"2025-01-02","Chase Joint Checking","Denver Parking","Transportation::Transportation",-19.08,"USD",-19.08"1610846",,"2025-01-02","Chase Joint Checking","Lowe's","Housing::Home Improvement",-160.97,"USD",-160.97"1610847",,"2025-01-02","Chase Joint Checking","Transfer From Alliant Checking","Transfers::Transfers",3000.0,"USD",3000.0"1610848",,"2025-01-03","Chase Joint Checking","King Soopers","Food::Groceries",-100.04,"USD",-100.04"1610849",,"2025-01-03","Chase Joint Checking","Circle K","Transportation::Gas",-40.7,"USD",-40.7id,split_of,date,account,merchant,category,amount,currency,amount_home1610843,,2025-01-01,Chase Sapphire Preferred,Sweetgreen,Food::Dining Out,-21.47,USD,-21.471610844,,2025-01-01,Chase Sapphire Preferred,Apple.Com,Utilities::Subscriptions,-6.06,USD,-6.061610845,,2025-01-02,Chase Joint Checking,Denver Parking,Transportation::Transportation,-19.08,USD,-19.081610846,,2025-01-02,Chase Joint Checking,Lowe's,Housing::Home Improvement,-160.97,USD,-160.971610847,,2025-01-02,Chase Joint Checking,Transfer From Alliant Checking,Transfers::Transfers,3000.0,USD,3000.01610848,,2025-01-03,Chase Joint Checking,King Soopers,Food::Groceries,-100.04,USD,-100.041610849,,2025-01-03,Chase Joint Checking,Circle K,Transportation::Gas,-40.7,USD,-40.7The cursor loop. /transactions returns rows oldest first and a next_cursor with each page. The script sends it back as cursor with the same from and to, and stops when next_cursor is null. from and to are required and both inclusive; limit runs from 1 to 1,000 and defaults to 100. A split transaction reads as one row per leg, with the parent’s id in split_of, which is why the CSV has that column. Conventions covers the envelope, cursors and ids; Read reference lists every field of a row.
Backing off on a 429. Each person has 60 requests a minute and 2 in flight, across all their tokens. A request past either limit is 429 with a Retry-After header in whole seconds, and both scripts sleep that long and send the same request again. Limits and errors lists every refusal.
How do I make a monthly cash-flow table?
Section titled “How do I make a monthly cash-flow table?”This script prints income, expenses and net for each month of a date range, in the household’s home currency. It needs a token of either kind, and bash with curl, jq and awk, or Python 3.
#!/usr/bin/env bash# A monthly cash-flow table (income, expenses, net, in the household's home currency).# Needs curl and jq. Usage: ./b-monthly-cashflow.sh 2025-01-01 2025-12-31set -euo pipefail: "${TAIGA_API:?set TAIGA_API}" "${TAIGA_TOKEN:?set TAIGA_TOKEN}"from=${1:-2025-01-01}; to=${2:-2025-12-31}
curl -sS --fail-with-body "$TAIGA_API/api/v1/cashflow?from=$from&to=$to&granularity=month" \ -H "Authorization: Bearer $TAIGA_TOKEN" |jq -r '.home_currency as $cur | (.data[] | [.period, .income, .expenses, .net, (if .partial then "partial" else "" end), $cur] | @tsv)' |awk -F'\t' 'NR==1 {printf "%-9s%12s%12s%12s (%s)\n", "month", "income", "expenses", "net", $6} {printf "%-9s%12.2f%12.2f%12.2f%s\n", $1, $2, $3, $4, ($5 ? " " $5 : "")}'"""A monthly cash-flow table (income, expenses, net, in the household's home currency).
Standard library only. Usage: python3 b-monthly-cashflow.py 2025-01-01 2025-12-31"""import jsonimport osimport sysimport urllib.parseimport urllib.request
API = os.environ["TAIGA_API"]TOKEN = os.environ["TAIGA_TOKEN"]date_from, date_to = (sys.argv[1:3] if len(sys.argv) > 2 else ("2025-01-01", "2025-12-31"))
query = urllib.parse.urlencode({"from": date_from, "to": date_to, "granularity": "month"})req = urllib.request.Request(f"{API}/api/v1/cashflow?{query}", headers={"Authorization": f"Bearer {TOKEN}"})with urllib.request.urlopen(req) as resp: page = json.load(resp)
print(f"{'month':<9}{'income':>12}{'expenses':>12}{'net':>12} ({page['home_currency']})")for p in page["data"]: flag = " partial" if p["partial"] else "" print(f"{p['period']:<9}{p['income']:>12,.2f}{p['expenses']:>12,.2f}{p['net']:>12,.2f}{flag}")The run covered 2025 for the same household. The first six months follow; the full run printed all twelve.
month income expenses net (USD)2025-01 8340.00 8442.66 -102.662025-02 5560.00 9240.96 -3680.962025-03 5560.00 9118.23 -3558.232025-04 5560.00 9193.43 -3633.432025-05 5560.00 13463.67 -7903.672025-06 5560.00 9004.20 -3444.20month income expenses net (USD)2025-01 8,340.00 8,442.66 -102.662025-02 5,560.00 9,240.96 -3,680.962025-03 5,560.00 9,118.23 -3,558.232025-04 5,560.00 9,193.43 -3,633.432025-05 5,560.00 13,463.67 -7,903.672025-06 5,560.00 9,004.20 -3,444.20One request, no cursor. Only /transactions and /balances paginate. /cashflow returns every period in one answer with next_cursor null, so the script makes a single call and has no retry loop. granularity takes month, quarter or year, up to 60 months, 40 quarters or 20 years per request. Every figure is in the envelope’s home_currency.
The partial flag. Periods before the first recorded flow and after the envelope’s as_of day are left out. A period that lacks some of its data has partial true, and the script marks that row; partial_start, excluded_count and excluded_currencies say what is missing. Read reference lists the fields.
Coming from Lunch Money or YNAB
Section titled “Coming from Lunch Money or YNAB”The table maps the read concepts of the Lunch Money API and the YNAB API to the Taiga Finance API.
| Lunch Money | YNAB | Taiga Finance /api/v1 |
|---|---|---|
| Access token (Bearer) | Personal access token (Bearer) | Personal token taiga_pat_…, in the Authorization: Bearer header only, expiring after 30, 90 or 365 days |
GET /transactions with start and end dates, offset paging |
GET /budgets/{id}/transactions with since_date; delta requests with server_knowledge |
GET /transactions?from=&to=, both required and inclusive, with an opaque cursor. No delta or changes feed, no webhooks |
| Assets, Plaid accounts | Accounts | GET /accounts, including a partner’s accounts shared at balance only; GET /balances for dated balance history |
| Categories, category groups | Category groups, categories | parent_category and category (the sub-category) on each transaction row |
| Payee | Payee | merchant on each transaction row; no payee list endpoint |
| Tags | Flags | tags on each transaction row, a list of names |
| Split transactions | subtransactions |
One row per leg, id <id>-s<slot>, with split_of, split_slot and split_note |
| Budgets | Months, budgeted amounts per category | GET /budget?month=YYYY-MM |
| Recurring items | Scheduled transactions | GET /recurring |
| — | — | GET /cashflow, GET /holdings |
| Transaction groups | — | No equivalent: the API has no transaction groups |
| Decimal strings | Integer amounts in thousandths of a currency unit | Decimal JSON numbers in the row’s currency, and amount_home in the household’s home currency |
Scripts that change data, and the write rows of this map, are on Write recipes.