通知
本站点除 Legacy 产品与方案外,已迁移至 声网新文档中心 ,当前页面不再维护
Documentation
All
Console 官网 Community Technical support

How can I avoid being frequency limited when calling Agora Server RESTful APIs?

Type: Integration issues    Platform: RESTful   Last Updated: 2022/09/14 02:16:33

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:

  • 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.
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.
What if the default frequency limit still cannot meet your project needs after considering the preceding suggestions?

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.