Rate Limiting & Pagination
You can use query parameters to apply filters on the bulk data and view only the appropriate response.
Rate Limits
Sourcehub uses a request Rate Limiter to limit the number of requests received by the API within a time frame. Rate Limiter helps maintain system stability during heavy traffic loads.
While integrating with any APIs, watch for HTTP status code 429 and build the retry mechanism based on the requirement. Use an Exponential backoff/stepped backoff strategy to reduce request volume and stay within the limit. Add some randomization within the backoff schedule to avoid the thundering herd effect.
Pagination
If you want to get information on all the orders of a customer, the result could be a massive response with hundreds of orders. Use a combination of the query parameters given below to receive a specific number of records in the API response.
| Query Parameters | Description |
|---|---|
| from_date | Format dd-mm-yyyy |
| to_date | Format dd-mm-yyyy |
| count | integer Number of entities to fetch. Default is 10. This can be used for pagination, in combination with skip. |
| skip | integer Number of entities to skip. Default is 0. This can be used for pagination, in combination with count. |