import requests


def get_ynab_account_balance(TOKEN, BUDGET_ID, ACCOUNT_ID):
    """
    Makes a GET request to the YNAB API to retrive the current balance of an account
    Args:
        BASE_URL [str]: The base URL for the YNAB API.
        TOKEN [str]: YNAB token used for API authentication.
        BUDGET_ID [str]: ID for the YNAB Budget containing the Account you want the budget for.
        ACCOUNT_ID [str]: ID for the specific YNAB Account you need the balance for.
    Returns:
        [int]: Returns an integer from the current account balance
    """
    headers = {'Authorization': 'Bearer ' + TOKEN}
    params = {
        'method': 'GET',
        'headers': headers,
        'contentType': 'application/json'
    }

    response = requests.get(f'http://api.youneedabudget.com/v1/budgets/{BUDGET_ID}/accounts/{ACCOUNT_ID}', headers=headers, params=params)
    data = response.json()
    accountData = data['data']['account']
    accountBalance = accountData['balance'] / 1000
    print(f'YNAB Account balance: ${accountBalance}')
    return accountBalance