Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

enter image description here


Stack.JS is the JavaScript equivalent of Stack.PHP and aims to replicate the request structure of that library as much as possible. The library is still a long ways from being complete but is functional at this point. As was the case with Stack.PHP, Stack.JS is 100% fully documented and comes with a test suite to make sure the library functions as documented.

Request throttling was just added and there are plans to implement a cache.

Code Snippet

var site = API.Site('stackapps');

var response = site.Questions([1, 2, 3]).SortBy('creation_date').Exec();

response.Fetch(function(data) {

    for(var i=0; i<data['items'].length; ++i)



Stack.JS (like Stack.PHP) is released under the MIT license.


You will need to check out the code from the repository (see below) until an official release is made.


Stack.JS will run on all major browsers (IE, Firefox, Chrome, Opera, and Safari). Currently, I am running the tests in Chrome.


I can be reached at


The code is located at You can check it out using Bazaar by running these commands in an empty directory:

bzr init
bzr pull lp:stackjs
share|improve this question
I'm wondering how I would implement using this library code to get all the three-letter tags on a site. – hippietrail Jan 24 '12 at 16:54
@hippietrail: Here is an example using the latest code in trunk: – Nathan Osman Jan 24 '12 at 18:45
Is there a URL where we can "include" the latest version in a script tag, like jQuery has? And the same for a minified version? – hippietrail Jan 24 '12 at 18:52
@hippietrail: not yet, though that is planned. In the meantime, feel free to use this: Keep in mind that the library is still in its early stages. – Nathan Osman Jan 24 '12 at 18:58
I just tried running it in jsfiddle and after some time I got my first ever API error! {"error_id":502, "error_name":"throttle_violation", "error_message":"too many requests from this IP"} – hippietrail Jan 24 '12 at 19:17
@hippietrail: Hmm... sounds like the request throttling needs some more work. Edit: okay, I've made some adjustments. Please try it again. – Nathan Osman Jan 24 '12 at 19:56
Had to wait for my ban to expire. Same problem still though! It seems you're not setting a page size, which could be up to 100. – hippietrail Jan 25 '12 at 19:45
@hippietrail: That's very strange. I will look into this and let you know when this gets resolved. – Nathan Osman Jan 25 '12 at 20:43
OK that problem seems to be solved. But now I can't figure out how to get the list of all 3-letter tag synonyms. The obvious way of just chaning Tags in the code to Synonyms didn't work and I couldn't find much useful documentation other than the source code. – hippietrail Sep 7 '12 at 11:40
Does this library (still) work? Can anyone provide a jsfiddle or some examples? – foobarbecue yesterday
@foo I don't think it does. It was never updated for the latest version of the API. – Nathan Osman yesterday

You must log in to answer this question.

Browse other questions tagged .