4

I want to show an animation of:

  • Questions being asked and answered in the most popular tag
  • Comments being posted
  • New users joining

All in real time.
Is there access to real-time data?

2 Answers 2

5

You can get data close-enough to "real time" for most practical purposes. See the StackHose app, for example.

Read the page about the API's Throttles and Quotas. From that page we can deduce:

  1. The maximum, burst, request rate is 30 requests per second, and this risks getting your app shut down.
  2. Your app will never be allowed more than 10,000 requests per day. This works out to 1 request every 9 seconds -- if the app runs 24 hours a day.
    Or,
    only 2 hours and 46 minutes of polling once per second.
  3. Your application must monitor and respect the backoff flag.


The API developer confirms that that is about as "real time" as the API is ever going to get ("Status by design"). The API seems to be designed around reasonable request rates and volumes of traffic.
Note that that 60-second caching does not currently apply in all cases, like the /events path.

0

There is now an unofficial realtime WebSockets API. A persistent connection should be less demanding than multiple requests per second or thousands of requests per day. It should be more or less turnkey and not require backoff flag considerations. Since the data here is streamed, it will be as "real time" as possible. More details about this WebSocket API can be found at https://meta.stackexchange.com/q/218343/1373352 .

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .