Stack Exchange has a very full featured, albeit currently read-only, API. You can view some of the nifty applications people have created with the Stack Exchange API in the app gallery on Stack Apps, or check out the winners of the Stack Exchange API contest we held last year.
We’re currently in the planning stages for Stack Exchange API 2.0. There’s a draft API 2.0 specification on Stack Apps, so head on over there and take a look if you want a voice in that process.
As a part of our research process leading up to 2.0, we analyzed usage statistics of the API to date. For the period from 8/21/2011 to 9/21/2011 inclusive, there were 34.2 million requests against the API. That’s about 12 requests per second.
API usage skews heavily toward users and questions:
The top API calls, by volume, are:
There’s a precipitous drop in usage after that. It’s somewhat surprising just how user centric the queries are, given how Q&A; focused Stack Exchange sites are. This suggests that user authentication to get to the tiny bit of hidden user information we have really will be a popular feature — and that is slated for API V2.0.
Approximately 6% of API traffic is the result of internal Stack Exchange requests. Chat made approximately 1.1m requests, stackexchange.com made about 250k requests, and careers.stackoverflow made approximately 140k requests. Only Chat actually requires the raised API request limit that we give it.
The top applications by API usage are:
Roughly 59% of all API requests are from non-web applications. Of the top 20 applications, 8 are non-web applications. This is of some interest with regards to the debate around HTML encoding all output by default, to ensure it is HTML safe. This suggests that there are many opportunities for script injection, although the reach of the attack is somewhat mitigated.
API usage growth is basically flat. This is not terribly surprising, since we’re read-only until API v3.0.
Getting cache hit rates out of our logs is a bit difficult, but we’ve got an upper limit of 10% based on the numbers. I’d say we can be confident in a 3-5% cache hit rate.
We hope these statistics are interesting, if for nothing else than learning about some useful apps that work with the Stack Exchange API that you might not have heard of. You can find out more about these apps, and discover a bunch more, at Stack Apps!
Stack Apps is more than an app (and script) directory — there’s also a comprehensive set of documentation, support, and examples for the Stack Exchange API over at Stack Apps — and the entire API is self-documented at …
… with examples you can run directly in your browser. And naturally, it works against every Stack Exchange site exactly as you’d expect!
Thanks to everyone who has built apps against our API. We’ll do our best to support you, and keep evolving the API to add more awesome for you.