Get Concurrent Player Count of Top 100 Games

I am brand new(big noob) to Python. I started 2 days ago. One thing that I’ve done is I’ve web scraped data from a game’s homepage to get the concurrent player count of the game. Now I want to try this on the game’s page and apply it to the first 100 games there. When I tried this on the popular page, it didn’t work because the data isn’t in the page’s source(maybe it is, I couldn’t find it).

I found out that Roblox has endpoints and it looks like I might be able to use this to get the top 100 games’ id/player count? I’m not sure how endpoints work and how I would get the top 100 games with it so any help would be great.

I found out that GET /v1/games/list could get the top games on Roblox. I’m just unsure how I would use this in Python. So far I’ve used requests.get and I got a 200 status code which means that the request was successful. But the content of the page doesn’t give the data shown in the response bodyimage

Getting https://games.roblox.com/v1/games/list seems to return “{“errors”:[{“code”:0,“message”:“InternalServerError”}]}” only.

Try using https://games.roblox.com/v1/games/list?model.maxRows=100, I have no idea how the rows work but 100 seem to return 110 games.

After you get requests body, just import json and decode it.

2 Likes

I think it has data for 110 games because 10 of them seem to be sponsored.

1 Like