I was curious to find out how many microbadges I had bought and discovered that I needed to count them by hand. I had to develop a program to do it for me. Sure enough, I could have copied my BGG profile page and pasted it into a spreadsheet or a text editor, but it seemed primitive. No fun in that!
Please let me know whether you encounter any problem.
CountMB 2.0 (2021-12-13): Counts the MB goups separately.