Reducing the number of API calls
To maintain optimum performance and ensure that infrastructure resources are not disproportionately used in an inefficient manner, Alma has Governance Thresholds in place.
Governance thresholds ensure that no single institution negatively impacts other Alma institutions, prevent performance degradation and can help reduce the risks of malicious attacks (See Alma Governance Thresholds for more details).
If you make a lot of API requests in a short amount of time, you may bump into the threshold limit:
- If you reached the Daily API Request Threshold, you will receive “Too Many Requests” response.
- If you reached the Concurrent API Request Threshold, your requests will be queued and processed later.
In this article we will share ideas for reducing the number of API calls:
- Optimize your code to eliminate any unnecessary API calls
- Cache frequently used data
- Cache data that is not changed often
- Use webhooks in order to track changes
- Consider batching multiple requests into a single request
Get multiple BIB records – applications that give a results list page need information regarding a group of bibliographic records. Instead of getting each record separately using the GET BIB record API, it is possible to use the GET multiple BIB records API and retrieve the list at once.