Unofficial Go client for YNAB API
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ynab Use url.Parse() to create correct url May 9, 2018
.gitignore Initial commit May 8, 2018
LICENSE Initial commit May 8, 2018
README.md

README.md

Go YNAB Client

Unofficial Golang client library for the YNAB API.

Example Usage

accessToken := "foobar"
client := ynab.NewDefaultClient(accessToken)

budgets, _ := client.BudgetService.List()
for _, budgetSummary := range budgets {
    fmt.Printf("Budget %v: %v\n", budgetSummary.Id, budgetSummary.Name)

    budget, _ := client.BudgetService.Get(budgetSummary.Id)

    fmt.Printf("Accounts:\n")
    for _, account := range budget.Accounts {
        fmt.Printf("\tAccount %v: %v\n", account.Id, account.Name)
        fmt.Printf("\t\tBalance: %v\n", account.Balance)

        transactions, _ := client.TransactionsService.GetByAccount(budgetSummary.Id, account.Id)

        fmt.Printf("\t\tTransactions:\n")
        for _, transaction := range transactions {
            fmt.Printf("\t\t\t%v: %v\n", transaction.Date, transaction.Amount)
        }
    }
}