What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 134 Stack Exchange communities.

I wonder how many pages (questions) all Stack Exchange sites have together and how much it grows per day. Is there a reliable source for this number?

share|improve this question
1  
Look at how many pages stackoverflow has. Then add 10% of that. –  jjnguy Sep 15 '10 at 0:49
    
I think the easiest way to do this is by using the API, but I'm not familiar enough with it to provide details in the form of a complete answer. –  Jon Seigel Sep 15 '10 at 0:56
    
@jjnguy from the Nick answer the correct fraction you have to add is 14.79% but you got so close that I'll upvote you –  Jader Dias Sep 16 '10 at 11:27

1 Answer 1

Here's a very quick, very dirty dump using the API of various totals available from the API. It's not a complete list of statistics, but it hopefully gives you an idea.

You can see the statistics for every site here: http://jsfiddle.net/nick_craver/eGzcZ/7/embedded/result,js/ Or edit/play with the code yourself here: http://jsfiddle.net/nick_craver/eGzcZ/7/

As of the time of this answer, I'm seeing totals of:

  • Questions: 1,254,981
  • Answers: 3,167,921
  • Unanswered: 220,314
  • Comments: 4,983,783
  • Users: 604,286
  • Votes: 11,338,830
  • Badges: 1,432,424

Edit: I went through and commented the code this morning in case anyone wants to build something on it later or just generally screw around. Also, I added a 300 ms delay between requests, so it takes longer to run, but it won't IP address ban you (for 2 minutes) if run many times in a row:

var sites = {},
    stats = ["total_questions", "total_answers", "total_unanswered", "total_comments", "total_users", "total_votes", "total_badges"];

$("#output").tablesorter();
$.ajax({
    url: "http://stackauth.com/1.0/sites", //API route to get the list of sites: http://stackauth.com/1.0/help/method?method=sites
    dataType: "jsonp",                     //We're making a JSONP response for a cross-domain call
    jsonp: "jsonp",                        //Setting the jsonp callback to 'jsonp' since the API expects ?jsonp=method
    success: function(data) {              //Do something with the data when it's returned
        $.each(data.api_sites, function(d) {   //Loop though each of the sites in the SE network, d is the index in the loop
            sites[this.name] = this;           //Store the site in our sites object
            setTimeout($.proxy(function() {                //We're delaying 300 ms between requests for the API trottle
                $.ajax({                                   //Begin call of the individual site's stats route
                    url: this.api_endpoint + "/1.0/stats", //The route of the site, e.g. http://api.stackoverflow.com/1.0/stats
                    dataType: "jsonp",                     //Again we're using a JSONP request
                    jsonp: "jsonp",                        //Again we're passing the ?jsonp=method parameter
                    context: this,                         //Maintain this so it refers to the current site
                    success: function(sdata) {             //Do something with the individual stats when returned
                        this.statistics = sdata.statistics[0];                           //Store stats for possible later use
                        var tr = $("<tr />").append($("<td />", { text: this.name }));   //Set the site name for the row
                        for (var i = 0; i < stats.length; i++) {                         //Loop through the stats we want
                            tr.append($("<td />", { text: this.statistics[stats[i]] })); //Append each stat as a cell in the row
                        }
                        tr.appendTo("#output tbody")                                    //Append the row to the <tbody>
                          .hide().fadeIn('fast');                                       //simple fade effect
                        $("#output").refresh();                                         //Update totals each time, more for effect
                    }
                });
            }, this), d*300);                                                            //The delay: index * 300 ms, to space them out
        });
    }
});

$.fn.refresh = function() {                                                                          //Method to refresh the table
    var t = this.trigger("update");                                                                  //Update tablesorter
    setTimeout(function() { t.trigger("sorton",[[[0,0]]]); }, 1);                                    //Perform the sort, blame TS for this
    var totals = this.find("tfoot tr td"), total = {};                                               //Get cells, start total tracking
    $.each(sites, function() {                                                                       //Loop through each site
        for (var stat in this.statistics) {                                                          //Loop through each stat
            if (this.statistics.hasOwnProperty(stat) && typeof(this.statistics[stat]) == "number") { //If the stat's a number...
                total[stat] = (total[stat] || 0) + this.statistics[stat];                            //Add it to the total
            }
        }
    });
    for (var i = 1; i <= stats.length; i++) {                                                         //Loop through the totals
        totals.eq(i).text(total[stats[i - 1]]);                                                      //Update the footer counts
    }
};

Also, I hadn't really come across a need for the API before this. My interests were better suited for the data dump..., but cheers to all the Stack Overflow guys, that was completely painless.

share|improve this answer
1  
I never appreciated inline code comments before. But after this I'm changing my mind –  Jader Dias Sep 16 '10 at 11:24

You must log in to answer this question.

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