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

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

    {"total":6363}

**For tags**: [/2.2/tags?site=stackoverflow&filter=total][7], 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][5].

Note that you can set the pagesize up to 100.  See [the doc page for badges][6], for example.


  [1]: http://stackoverflow.com/tags
  [2]: http://stackoverflow.com/help/badges
  [3]: https://api.stackexchange.com/docs/filters
  [4]: https://api.stackexchange.com/2.2/badges?site=stackoverflow&filter=total
  [5]: https://api.stackexchange.com/docs/wrapper
  [6]: https://api.stackexchange.com/docs/badges#pagesize=100&site=stackoverflow
  [7]: https://api.stackexchange.com/2.2/tags?site=stackoverflow&filter=total