I am looking for a Google REST endpoint or SDK that will report the quota usage of a specific project and Google API. For example, if I write a query like
{
"project": "my-project",
"api": "searchconsole.googleapis.com",
"function": "/urlInspection/index:inspect"
}
it will return the quota usage for that API, e.g.
{
"qpd": {
"used": 20,
"limit": 200
}
}
I've found this SO post from 2018 that uses a timeseries
query to monitoring.googleapis.com, but it seems "hacky" and as it's old, I'm wondering if there's a better way. I tried looking into https://cloud.google.com/monitoring/api/metrics_gcp but as I have no prior experience with monitoring, the documentation is confusing.