Overview
Rate limiting is a technique used to control the number of API requests a client can make to a server within a specific period of time. It helps prevent abuse, ensures fair usage and protects our backend systems from being overwhelmed.
- Ensure fair access for all users
- Protect system stability and performance
- Protects system resources and improves scalability
-
Avoids unexpected outages
The Class platform enforces a rate limit of 500 endpoint calls per minute per OAuth client. The limit is shared across every business connection and access token that uses your client, and it applies at all times, both during and outside business hours. There is no daily or monthly limit. If you exceed the per-minute limit, your API calls receive a 429 Too Many Requests response.
For full technical detail, see Rate Limiting on the developer portal.
Rate limit response headers
| Response header | Description |
| X-RateLimit-1Min-Remaining | The number of API calls you have left in the current one-minute period. It starts at 500. When it reaches 0, further calls receive a 429 Too Many Requests response. |
| X-RateLimit-ResetAfter | The number of seconds until your limit resets to 500 calls. It starts at 60 and counts down. |
Handling a 429 response
A 429 Too Many Requests response means your application has temporarily exceeded the allowed request volume. When this happens:
- Stop sending further requests straight away.
- Read the
X-RateLimit-ResetAfterheader. - Wait the number of seconds it gives before sending another request.
- Resume from where you stopped, rather than restarting work that has already succeeded.
Always respect X-RateLimit-ResetAfter. Retrying immediately or repeatedly only extends the delay and puts unnecessary strain on Class systems.
When to sync
The rate limit is the same at all times, but when you make calls matters. Design your integration around two patterns:
| During business hours | Outside business hours (overnight) | |
|---|---|---|
| When | 8am to 8pm, Australian Eastern time (Sydney) | 8pm to 8am, Australian Eastern time (Sydney) |
| Purpose | Refresh one entity when a user needs it | Bulk and scheduled syncing |
| Pattern | Minimal calls, scoped to a single fund or portfolio | Parallel calls, with controlled concurrency |
| Examples | A user opens a fund in your app and you refresh that fund's data | Nightly sync of all connected funds, initial sync of a new customer |
During business hours: sync one entity at a time
Keep calls during business hours to a minimum. Only call the APIs needed to refresh the entity (fund or portfolio) a user is working with, at the time they need it. You may need several endpoints to do this, but the purpose should be to obtain or sync one entity's data at a time, not to sync your whole customer base.
Outside business hours: sync overnight
Run bulk and scheduled syncs between 8pm and 8am (Australian Eastern time).
Initial syncs must run overnight. When a new customer connects, the first full sync of their funds creates a large volume of calls. Schedule it outside business hours, even if the customer connects during the day.
Use parallel calls to sync faster
Making one call and waiting for its response before sending the next is slow. To sync efficiently overnight, make calls in parallel. This means your application needs to:
- run calls on multiple threads or workers
- manage how many calls are in flight at once (concurrency)
- queue work on your side, so the combined volume stays within 500 calls per minute
- monitor
X-RateLimit-1Min-Remainingand slow down as it approaches 0
Data freshness
Class receives data feed and market data that update holdings and valuations for most entities with listed investments. These updates arrive throughout the night, and Class can't guarantee that every feed has been updated by a specific time.
If your integration needs this updated data before the start of the business day, plan your overnight sync with that in mind. Syncing more than once a day to pick up later updates is an exception that needs approval. Contact partners@class.com.au to discuss your requirements before building it in.
Rate limiting for serverless technologies
With serverless technologies such as AWS Lambda, API traffic is no longer tied to a single IP address. Requests may come from a wide range of dynamic sources, but they still count towards your OAuth client's single limit.
A typical integration:
- Calls an endpoint to retrieve a list of all active funds.
- For each fund, calls further endpoints to fetch specific data (for example transactions, investment data or member contributions).
Each fund commonly triggers 5 to 7 calls, depending on your use case. Some businesses have a large number of funds, so to stay within 500 calls per minute, queue your requests per fund and don't run more than 10 concurrent queues at any one time.
Rate limit strategy
To stay within 500 calls per minute, we recommend:
- Queue fund processing: group a small number of funds (for example 3 or 4) and process them together, so you control the number of calls per queue. A batch can be one fund or a few, depending on your use case.
- Limit concurrency: run only a few queues at the same time, to prevent traffic spikes that breach the limit.
- Queue responsibly: even without a formal queuing system, design your logic to wait for one batch to complete before starting the next.
- Factor in retries: retries after errors or timeouts add to your call volume, so leave a buffer in your calculations.
- Adjust for fund complexity: some funds need more data and therefore more calls. Adjust your batch size to the expected volume per fund.
- Schedule bulk work overnight: run nightly and initial syncs between 8pm and 8am (Australian Eastern time), and keep business-hours calls to single-entity refreshes.
By following these principles, your integration stays within the rate limit while delivering reliable, scalable performance.
What's Next?
- Rate Limiting on the developer portal
- Managing Access and Refresh Tokens: managing tokens for long-running syncs
- AWS's documentation on AWS Lambda functions
- Questions about your sync design or data freshness requirements? Contact partners@class.com.au.