The reliable way to get those numbers is calling the /sites endpoint on the Stack API and compensate for the missing Area 51 from that list. That is the total number of sites reported in the site switcher of Stack Exchange.com.
If you run the code snippet you'll get the actual count for each category. When you subtract the number of closed_beta
from the total, you'll get the number of sites that is available in the Site switcher of the Q/A sites. Notice that the number equals the site databases in SEDE (but wait for the next Sunday if a site went into beta)
$.get(['https://api.stackexchange.com',
'2.2',
'sites'].join('/') + '?pagesize=500&filter=!6Oe787x*vzH7Z',
function(data) {
var states=[], i, j, val, tot = 0;
for(i=0; i< data.items.length; i++){
val = states[data.items[i].site_state];
if (val == undefined) {
val =1;
} else {
val++;
}
states[data.items[i].site_state] = val;
}
for(j in states) {
if (j !== 'linked_meta') {
tot = tot + states[j];
$('#site_stat').append(
$('<tr>').append(
$('<td>').text(j), $('<td>').text(states[j])
)
);
}
console.log(j);
console.log(states[j]);
}
$('#site_stat').append(
$('<tr>').append(
$('<td>').text('Area 51'), $('<td>').text('1')
)
);
$('#site_stat').append(
$('<tr>').append(
$('<td>').text('total'), $('<td>').text(tot+1)
)
);
});
td:nth-child(2)
{
text-align: right;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table id="site_stat">
</table>
?lq=1
appended, so it doesn't redirect: How many Stack Exchange sites are there really?