Skip to content

Repository files navigation

YNAB API Python Library

BuildPyPI version

This is the Python client for the YNAB API.

Please read the YNAB API documentation for an overview of using the API and a complete list of available resources.

This client is generated using the OpenAPI Generator.

Requirements

Python 3.8+

Installation

First, install the package using pip:

pip install ynab

Then import the package:

importynab

Usage

To use this client, you must obtain an access token from the Account Settings area of the YNAB web application.

importynabconfiguration=ynab.Configuration(
access_token="b43439eaafe2_this_is_fake_b43439eaafe2"
)
withynab.ApiClient(configuration) asapi_client:
plans_api=ynab.PlansApi(api_client)
plans_response=plans_api.get_plans()
plans=plans_response.data.plansforplaninplans:
print(plan.name)

Methods

ClassMethodDescription
UserApiget_userGet user
AccountsApicreate_accountCreate an account
get_account_by_idGet an account
get_accountsGet all accounts
PlansApiget_plan_by_idGet a plan
get_plan_settings_by_idGet plan settings
get_plansGet all plans
CategoriesApicreate_categoryCreate a category
create_category_groupCreate a category group
get_categoriesGet all categories
get_category_by_idGet a category
get_month_category_by_idGet a category for a specific plan month
update_categoryUpdate a category
update_category_groupUpdate a category group
update_month_categoryUpdate a category for a specific month
MonthsApiget_plan_monthGet a plan month
get_plan_monthsGet all plan months
PayeeLocationsApiget_payee_location_by_idGet a payee location
get_payee_locationsGet all payee locations
get_payee_locations_by_payeeGet all locations for a payee
PayeesApicreate_payeeCreate a payee
get_payee_by_idGet a payee
get_payeesGet all payees
update_payeeUpdate a payee
MoneyMovementsApiget_money_movement_groupsGet all money movement groups
get_money_movement_groups_by_monthGet money movement groups for a plan month
get_money_movementsGet all money movements
get_money_movements_by_monthGet money movements for a plan month
TransactionsApicreate_transactionCreate a single transaction or multiple transactions
delete_transactionDelete a transaction
get_transaction_by_idGet a transaction
get_transactionsGet all transactions
get_transactions_by_accountGet all account transactions
get_transactions_by_categoryGet all category transactions
get_transactions_by_monthGet all plan month transactions
get_transactions_by_payeeGet all payee transactions
import_transactionsImport transactions
update_transactionUpdate a transaction
update_transactionsUpdate multiple transactions
ScheduledTransactionsApicreate_scheduled_transactionCreate a scheduled transaction
delete_scheduled_transactionDelete a scheduled transaction
get_scheduled_transaction_by_idGet a scheduled transaction
get_scheduled_transactionsGet all scheduled transactions
update_scheduled_transactionUpdate a scheduled transaction

Versioning

The version of this client is defined in the pyproject.toml file and follows semantic versioning. The version of this client is maintained independently and does not align with the the version of YNAB API itself (which is defined in the OpenAPI spec). To determine which spec version of the YNAB API was used when generating this client you can refer to the "description" field in the pyproject.toml file.

License

Copyright (c) 2025 YNAB

Licensed under the Apache-2.0 license

About

Official Python client for the YNAB API

Topics

Resources

Stars

49 stars

Watchers

4 watching

Forks

Releases

Contributors

Languages