Note: This is an unofficial Python library for interacting with the YNAB API. This library is not developed or supported by YNAB.
The YNAB API is currently only available to Early Access users. You can request access to the API by filling out this form. For the full details of API usage and endpoints, see https://api.youneedabudget.com/.
This Python package is automatically generated by the Swagger Codegen project using the YNAB API spec.
Python 2.7 and 3.4+
Coming soon...
import ynab
# Define your API key
ynab_config = ynab.configuration.Configuration()
ynab_config.api_key['Authorization'] = 'api_key'
ynab_config.api_key_prefix['Authorization'] = 'Bearer'
# Initialize the API client
api_client = ynab.api_client.ApiClient(configuration=ynab_config)
# Get a list of all budgets and print their names
budget_response = ynab.BudgetsApi(api_client).get_budgets()
for budget in budget_response.data.budgets:
print(budget.name)
# Data can also be used a dictionary
budget_response.to_dict()['data']['budgets'][0]['name']
All URIs are relative to https://api.youneedabudget.com/v1
Class | Method | HTTP request | Description |
---|---|---|---|
AccountsApi | get_account_by_id | GET /budgets/{budget_id}/accounts/{account_id} | Single account |
AccountsApi | get_accounts | GET /budgets/{budget_id}/accounts | Account list |
BudgetsApi | get_budget_by_id | GET /budgets/{budget_id} | Single budget |
BudgetsApi | get_budgets | GET /budgets | List budgets |
CategoriesApi | get_categories | GET /budgets/{budget_id}/categories | List categories |
CategoriesApi | get_category_by_id | GET /budgets/{budget_id}/categories/{category_id} | Single category |
MonthsApi | get_budget_month | GET /budgets/{budget_id}/months/{month} | Single budget month |
MonthsApi | get_budget_months | GET /budgets/{budget_id}/months | List budget months |
PayeeLocationsApi | get_payee_location_by_id | GET /budgets/{budget_id}/payee_locations/{payee_location_id} | Single payee location |
PayeeLocationsApi | get_payee_locations | GET /budgets/{budget_id}/payee_locations | List payee locations |
PayeeLocationsApi | get_payee_locations_by_payee | GET /budgets/{budget_id}/payees/{payee_id}/payee_locations | List locations for a payee |
PayeesApi | get_payee_by_id | GET /budgets/{budget_id}/payees/{payee_id} | Single payee |
PayeesApi | get_payees | GET /budgets/{budget_id}/payees | List payees |
ScheduledTransactionsApi | get_scheduled_transaction_by_id | GET /budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id} | Single scheduled transaction |
ScheduledTransactionsApi | get_scheduled_transactions | GET /budgets/{budget_id}/scheduled_transactions | List scheduled transactions |
TransactionsApi | bulk_create_transactions | POST /budgets/{budget_id}/transactions/bulk | Bulk create transactions |
TransactionsApi | create_transaction | POST /budgets/{budget_id}/transactions | Create new transaction |
TransactionsApi | get_transactions | GET /budgets/{budget_id}/transactions | List transactions |
TransactionsApi | get_transactions_by_account | GET /budgets/{budget_id}/accounts/{account_id}/transactions | List account transactions |
TransactionsApi | get_transactions_by_category | GET /budgets/{budget_id}/categories/{category_id}/transactions | List category transactions |
TransactionsApi | get_transactions_by_id | GET /budgets/{budget_id}/transactions/{transaction_id} | Single transaction |
TransactionsApi | get_transactions_by_payee | GET /budgets/{budget_id}/payees/{payee_id}/transactions | List payee transactions |
TransactionsApi | update_transaction | PUT /budgets/{budget_id}/transactions/{transaction_id} | Updates an existing transaction |
UserApi | get_user | GET /user | User info |
- Account
- AccountResponse
- AccountWrapper
- AccountsResponse
- AccountsWrapper
- BudgetDetailResponse
- BudgetDetailWrapper
- BudgetSummary
- BudgetSummaryResponse
- BudgetSummaryWrapper
- BulkIdWrapper
- BulkIds
- BulkResponse
- BulkTransactions
- CategoriesResponse
- Category
- CategoryGroup
- CategoryGroupsWrapper
- CategoryResponse
- CategoryWrapper
- CurrencyFormat
- DateFormat
- ErrorDetail
- ErrorResponse
- HybridTransactionsResponse
- HybridTransactionsWrapper
- MonthDetailResponse
- MonthDetailWrapper
- MonthSummariesResponse
- MonthSummariesWrapper
- MonthSummary
- Payee
- PayeeLocation
- PayeeLocationResponse
- PayeeLocationWrapper
- PayeeLocationsResponse
- PayeeLocationsWrapper
- PayeeResponse
- PayeeWrapper
- PayeesResponse
- PayeesWrapper
- SaveTransaction
- SaveTransactionWrapper
- ScheduledSubTransaction
- ScheduledTransactionResponse
- ScheduledTransactionSummary
- ScheduledTransactionWrapper
- ScheduledTransactionsResponse
- ScheduledTransactionsWrapper
- SubTransaction
- TransactionResponse
- TransactionSummary
- TransactionWrapper
- TransactionsResponse
- TransactionsWrapper
- User
- UserResponse
- UserWrapper
- BudgetDetail
- CategoryGroupWithCategories
- HybridTransaction
- MonthDetail
- ScheduledTransactionDetail
- TransactionDetail