Skip to content

A local-first personal finance app

Add instructions to retrieve nYNAB budget using an API key (#263)

Seth Gillett80c8c665f502
diff --git a/docs/migration/nynab.md b/docs/migration/nynab.md
index 4f07d1971e..a1f91f06df 100644
--- a/docs/migration/nynab.md
+++ b/docs/migration/nynab.md
@@ -1,10 +1,45 @@
# Migrating from nYNAB
-## 3rd Party nYnab exporter
+In order to export your budget from YNAB, you will need to use one of two methods.
-While we don't maintain this tool, you can also use https://json-exporter-for-ynab.netlify.app to export your budget from nYNAB into jSON.
+## 3rd Party nYnab Exporter
-### Import json file
+This is the easiest method available. While we don't maintain this tool, https://json-exporter-for-ynab.netlify.app will handle authorizing with your account to export your nYNAB budget into JSON.
+
+## Export Using API Key
+
+If you don't want to use a third party tool, you will need an API key.
+
+If you haven't already got an API key, you'll need to:
+
+ Sign in to the YNAB web app
+ Go to the "Account Settings" page, then to the "Developer Settings" page
+ Under the "Personal Access Tokens" section, click "New Token"
+ Enter your password and click "Generate" to get a new access token
+
+:::caution
+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/
+:::
+
+Now open a terminal window / command prompt, and enter:
+
+:::note
+
+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
+```
+
+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:
+
+```
+curl -H "Authorization: Bearer <ACCESS_TOKEN>" https://api.youneedabudget.com/v1/budgets/<BUDGET ID> --output budget.json
+```
+
+### Import the JSON File
- Open Actual
- Select the drop down menu and **Close File**