Total Players with Badge

Hello, I was just wondering if there was any way for me to get the total number of players that have ever received a badge, I thought it would be a cool feature to add to my difficulty chart obby (telling the players how many and what percentage of players have made it that far). Thanks in advance!

i don’t think there’s a way to count how many players has the badge, but if you really want to you can make a data store and add one every time a player joins with a badge (but of course it only adds one time per player)

edit: there’s actually a way, my bad lol

I believe you can do it using the inventory api.

i don’t think that’s what he’s looking for, he says how to count how many players has “his” (his game badge) badge and not how to count “someones” badges

You can get that information using this endpoint: https://badges.roblox.com/docs#!/Badges/get_v1_badges_badgeId

1 Like

An easy idea is that when awarding the badge, add +1 to an int and save it in a datastore. This isn’t really tracking how many people have your badges realtime, but it does track how many players have earned your badge and you can just reference the saved number when trying to display how many people have won the badge.

oh, so you can get it. i didn’t know lol

Not natively but you can do it with a proxy as @iBuzzes said.

I use this personally:

And creating the request is easy:

local result = httpService:JSONDecode(module:Get('https://badges.roblox.com/v1/badges/2124801830').body)

Output:

{
                    ["awardingUniverse"] =  ▼  {
                       ["id"] = 2726898524,
                       ["name"] = "Cody's Difficulty Chart Obby",
                       ["rootPlaceId"] = 7070459916
                    },
                    ["created"] = "2021-08-09T17:12:45.82-05:00",
                    ["description"] = "Complete Effortless",
                    ["displayDescription"] = "Complete Effortless",
                    ["displayIconImageId"] = 7230399205,
                    ["displayName"] = "Effortless",
                    ["enabled"] = true,
                    ["iconImageId"] = 7230399205,
                    ["id"] = 2124801830,
                    ["name"] = "Effortless",
                    ["statistics"] =  ▼  {
                       ["awardedCount"] = 5,
                       ["pastDayAwardedCount"] = 0,
                       ["winRatePercentage"] = 0
                    },
                    ["updated"] = "2021-08-09T17:12:45.82-05:00"
                 }
2 Likes