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

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

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

{"total":6363}

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

{"total":48667}

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 badges, for example.

Brock Adams
  • 13k
  • 5
  • 39
  • 64