Skip to content

A local-first personal finance app

Update nynab.md (#815)

Jessica Ld7128919216d
diff --git a/docs/migration/nynab.md b/docs/migration/nynab.md
index 36a6255a90..013af07835 100644
--- a/docs/migration/nynab.md
+++ b/docs/migration/nynab.md
@@ -10,6 +10,8 @@ This is the easiest method available. While we don't maintain this tool, https:/
If you don't want to use a third party tool, you will need an API key.
+### Step 1. Get API key
+
If you don't already have an API key, you'll need to:
Sign in to the YNAB web app
@@ -21,19 +23,31 @@ If you don't already have an API key, you'll need to:
The API key is only shown once, so make sure you copy it down somewhere! More information on how to access the YNAB API can be found at https://api.youneedabudget.com/
:::
+### Step 2. Get budget ID
+
Now open a terminal window / command prompt, and enter:
+```
+curl -H "Authorization: Bearer <ACCESS_TOKEN>" https://api.youneedabudget.com/v1/budgets
+```
+
+This will get the list of all the budgets you have. You'll need to find the id of the budget you want to export.
+
:::note
+It might help to use pretty formatting to find the budget id by piping to `jq` (which can be installed with homebrew `brew install jq`):
+
+```
+curl -sH "Authorization: Bearer <ACCESS_TOKEN>" https://api.youneedabudget.com/v1/budgets | jq -r '.data.budgets | sort_by(.last_modified_on) | reverse | .[] | "\(.name): \(.id)"'
+```
+
If you receive an error message like: `Invoke-WebRequest : Cannot bind parameter 'Headers'`, this is because curl is probably aliased to the "Invoke-WebRequest" Powershell commandlet. Use `curl.exe` instead of just `curl` in the commands below to fix this.
:::
-```
-curl -H "Authorization: Bearer <ACCESS_TOKEN>" https://api.youneedabudget.com/v1/budgets
-```
+### Step 3. Download entire plan
-This will get the list of all the budgets you have. You'll need to find the id of the budget you want to export and use it to perform the following API request:
+Use the budget id to perform the following API request:
```
curl -H "Authorization: Bearer <ACCESS_TOKEN>" https://api.youneedabudget.com/v1/budgets/<BUDGET ID> --output budget.json