I'd like to query my account's remaining credit ($) through API, it is possible?
curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxx" "https://api.digitalocean.com/v2/account/credit"
When I run it, it will return my account's remaining credit.
I want to build a Linux script to query my account remaining credit so I can notify myself to charge more credit into the account when the remaining credit is running low.
This is especially useful if I have multiple digitalocean accounts, then I don't have to login into every account manually to see which account is running low on credit and needs a charge
Balance information (including remaining credits if applicable) is now available via the API. See the API changelog for more details: https://developers.digitalocean.com/documentation/changelog/api-v2/new-endpoint-for-retrieving-balance-information/