Now that the API is all done on stackexchange.com. What happens if say just certain sites go offline (eg just Stackoverflow). Will the API continue to return results or will it return the HTML offline page?

Also if the whole network goes offline (as it did earlier today it seems), can we pleas have a JSON response rather than HTML?

Also the HTML response (when the network is offline) for the authentication route should be about the same size as the dialog is when online. I know all the Open ID providers have different size login pages, but they are on different domains so can be identified easily. Whereas if the network is offline and a user tries to authenticate, the domain (and I'm pretty sure the URL is the same as when it works) is the same.

At the very least can we have some documentation on what happens when the site/network go offline?

  • The behavior of API v2.0 in the face of a network outage is being spec'd out; we've faced the problem in the past of every outage being sort of a one off (often planned, but rarely regular), thankfully things are finally settling down. Commented Feb 19, 2012 at 5:56

1 Answer 1


So, here's the deal.

As the Stack Exchange network enters increasingly "bad" states exactly how the API copes degrades as gracefully as we can.

  • A meteor hit NYC and Oregon falls into the sea, or (more practically) we've got 100% loss of hardware or connectivity
    • we're basically screwed here, we can't guarantee anything
    • presumably we're failing over as quickly as a we can to our backups (if they're functioning), API is a lower priority than the sites themselves; and the auth flow less critical than the read functions.
  • The entire web tier is down, only our routers are up
    • we do our best to respond with a "temporarily unavailable" error object, adhering to the compression constraints may not be possible
    • note that applications should be able to handle uncompressed content for users who are behind dodge proxies anyway
  • Various services (DB, aggregation, scheduled tasks, etc.) are down, but the web tier is up
    • we return "temporarily unavailable" errors for the affected methods, while the rest function normally
  • Bad code, bad data, nebulous "other" errors
    • we return the "internal error" error when such conditions are encountered
  • 1
    I assume the last three scenarios return JSON data? Commented Feb 23, 2012 at 21:17
  • @GeorgeEdison yes, we return the same common wrapper object for as long as we can respond at all. Compression becomes impossible to guarantee (though obviously, we'll try) long before we can no longer respond, however. Commented Feb 23, 2012 at 21:20

You must log in to answer this question.

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