Access bandwidth usage through API

Hey guys,

I would like to stay up to date on the bandwidth usage of my sites, to be able to quickly identify potential malicious activity that could incur excessive costs. I’d like to create a script that monitors the bandwidth usage every so often, and flat out takes the site offline if certain thresholds are surpassed. Is there any way to do this with the current Netlify API? I found ways to monitor your build minutes used, but nothing so far that does the same for the bandwidth. I know I can see them through the dashboard itself, but the point would be to create some sort of a fail-safe mechanism that would not require me to check the dashboard manually.

Thanks for your time!

1 Like
GET https://api.netlify.com/api/v1/accounts/<account_slug>/bandwidth
Authorization: Bearer <token>
1 Like