Skip to main content
9 of 10
added 299 characters in body
Brock Adams
  • 13k
  • 5
  • 39
  • 64

The question was not originally clear if you wanted tags or badges, but the answer is the same...

To just get totals, use the total filter.
For example, for badges: /badges?site=stackoverflow&filter=total, which currently returns:

{"total":6363}

For tags: /tags?site=stackoverflow&filter=total, which currently returns:

{"total":48667}

###WARNING: In practice, the total filter is dangerous, because it masks errors, warnings and backoff intervals.
So, in practice use !w-*Ytm8YGWVl9..xoC instaed of total, per: My filter is not returning any results. How to create a minimal filter?.


If you want both the badges/tags and the total, you can set a custom filter, or just count the members of the items array as you page through them. The latter option is less expensive in the API and thus less likely to get you backoff warnings.

Note that you can set the pagesize up to 100. See the doc page for tags, for example.



IMPORTANT: The Tags page also shows synonyms and also a great many tags that have zero questions.
The API /tags route , however, returns neither of these, as best as I can tell. (3 or 4 very recently orphaned tags being the exception). So the totals will not match up.


EG, currently Stack Apps only has 7 synonyms. Confirmed that none of those show in the /tags route, but all show on the Tags pages. Likewise, the only zero count tag in the API is currently the featured tag, which is moderator only.

Brock Adams
  • 13k
  • 5
  • 39
  • 64