YNAB's API launched in June 2018. It's a REST API that spits out JSON - standard stuff if you've used any API before. Base URL is https://api.ynab.com/v1
and everything comes back wrapped in a data
object. The team documented how they use OpenAPI/Swagger to build their interactive docs, which is why their API documentation actually works.
Personal Tokens vs OAuth
Personal tokens are way easier for personal projects. Go to your YNAB settings, generate a token, done. Never expires unless you revoke it. Perfect for automating your own budget or pulling reports.
OAuth is required if you're building an app for other people. Standard OAuth 2.0 flow - nothing weird here. You start in "restricted mode" (25 users max) until YNAB manually approves your app. Takes a few days typically. The starter kit shows how OAuth works if you need examples.
Use personal tokens unless you hate yourself and want to deal with OAuth. Way easier - the setup is 5 minutes vs 2 hours.
What Actually Works
The API hits the main YNAB features you actually care about: Budgets - list them, get metadata, the usual stuff. Accounts - balances, transactions, everything you'd expect. Categories - read budgeted amounts, modify them (this is where it gets useful). Transactions - create, update, delete, full CRUD on everything. Payees - manage who you pay money to. All the endpoints are documented if you want the full reference.
Delta sync saves your ass - only returns what changed since your last request. Saves bandwidth and makes everything faster. Learned this when I was hitting rate limits every 10 minutes debugging transaction imports - switched to delta requests and suddenly my problems went away. The OpenAPI specification includes all the technical details if you need to generate your own client.
Rate Limits and Gotchas
200 requests per hour in a rolling window. Hit the limit, get a 429 error, wait it out. The limit is fine for most personal projects - I've never hit it building automation scripts. But if you're polling every 5 minutes, you'll run into trouble. The official rate limiting docs explain how to check your remaining requests in response headers.
Pro tip: Cache responses and use delta requests. Don't be the person fetching all transactions every time when you only need the new ones.
Milliunits confused the shit out of me for like a week: $100.50 becomes 100500 milliunits. Why? Because JavaScript's floating point math is garbage and YNAB didn't want transaction amounts to randomly change by a penny. More details here.
Error handling is pretty good - actual useful messages instead of generic 500s. The API docs are solid too, with interactive examples you can test right in your browser. For more context on the API design decisions, check out YNAB's support overview which explains the philosophy behind their developer tools.