Dev Center
All
Agora.io Community
How can I avoid being frequency limited when calling Agora Server RESTful APIs?
Type: Integration issues    Platform: RESTful   Last Updated: 2020/11/11 20:20:17

When the request of an Agora Server RESTful API exceeds its call frequency limit, the API returns the HTTP status code 429, indicating that you have made too many requests in a specified amount of time. The following suggestions can help you optimize API call frequency based on the needs of your project.

Tips to avoid exceeding call frequency limits

  • Distribute your API requests evenly across time windows.
    For example, if you want to call https://api.agora.io/dev/v1/channel/user/{appid}/{channelName} to query the user list of 100 online channels, the default call frequency limit for this API is 20 times per second. To avoid exceeding the call frequency limit, you can set the query interval of a single channel to 5 seconds, and then query the user list of 20 channels per second.
  • Do not directly call Agora Server RESTful APIs on your client; call these APIs on your application server instead.
    For example, when using the API for querying online channel statistics, you can configure your application server to periodically send requests to Agora and cache the returned results. When a client queries channel information, your server sends the latest locally cached data to the client.

If the default frequency limit still cannot meet your project needs after considering the preceding suggestions, contact support@agora.io to apply to adjust the call frequency limit. See Apply to raise API call frequency limit.

Each Agora Server RESTful API has an upper call frequency limit and cannot guarantee high real-time performance. In the case of high concurrency, you can contact support@agora.io to enable Agora message notification service and configure your server to receive Real-Time Communication events.

Apply to raise API call frequency limit

To raise the call frequency limit of an Agora Server RESTful API, you need contact support@agora.io with the following information:

  • Your industry, such as education, pan-entertainment, or medical.
  • Your application scenario, such as chat room, small class, or PK host.
  • Both the average and maximum number of concurrent channels.
  • Both the average and peak number of concurrent users in each channel.
  • The RESTful API that does not meet your project needs, as well as how you use it and in what scenarios.
score