Question

API for account information

Posted December 6, 2016 2.5k views
DebianAPI

Hello,
Does anyone have any ideas for getting accounting information via the API? As our droplets increase it would be great to have a way of pinging the API for costings. We could then use that information to build a local dashboard that refreshes every so often. At the moment, every time a droplet is built, via the API or otherwise, somebody has to manually record the costing in a local spreadsheet - seems a bit stone age!

Thanks

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
3 answers

I don’t think there is billing API available.

But you can find a work around. If you want just to calculate how much Droplets will cost you monthly, use API to fetch all Droplets. Then based on size calculate how much each will cost and sum it.

If you want real-time stats you can do that too.
Fetch all Droplets. List has Created at which will tell you when you created.
Calculate how much hours passed for that month. Don't forget that Droplets are charged for 672 hours per month.
Now you have real time stats whenever you need.

Don’t forget Snapshots, Backups and Block Storage if you use it.

Great, thanks for the replies.
I think I could also make use of Tags (provided they were created with the correct information on droplet creation) and sum the values that way.

Lots for me to try, thanks.

Submit an Answer