Search code examples
google-cloud-platformlimitgoogle-cloud-runquotagoogle-cloud-api-gateway

API Gateway request API Limitation Google Cloud


Can I limit my API Gateway request limitation?

For example URL A with path like this :

aaaaaaaa.com/predict

I set URL A only can be requested 1000 per day and the same URL with another path like this :

aaaaaaaa.com/calling

/calling only can be requested 500 per day

So, can I set a path with a limited request?


Solution

  • I wrote an article with Cloud Endpoint and it's the same thing with API Gateway (simply a managed version of Cloud Endpoint).

    If you want to limit the requests per day AND per requester, you need to add API keys to differentiate all the requesters. And the requester need to use it to indicate in which quota the request if counted.

    Take care, an API identify a project. If you have several requesters, you need several API keys, each one in a different project. Else, if you put all in the same project, it's the same project which will be identified, and thus the same quota decreased.