In the preceding section, we introduced API authentication to prevent unnecessary access to the API. Even the authenticated users can overload the API by unnecessarily accessing it, therefore, we need to implement user tokens to limit the use of the API. There can be many reasons for limiting requests to an API. We can think of two main reasons for limiting the API access as listed here:
Avoid unnecessary overloading of server resources
Bill the users based on API usage
If you are developing a premium API, it's important to track the usage for billing purposes. Various APIs uses unique parameters to measure API usage. Here, are some of the unique ways of measuring API usage:
Twitter API uses number of requests per hour to measure the API usage
Google Translate uses number of words translated to measure the API usage
Google Cloud SQL uses input and output storage to measure the API usage
Here, we are not going to measure the usage or limit the access to the portfolio...