Programming Any api to fetch the usage data from smogon database.

I am currently working on a discord bot that will display the usage stats of the pokemons. For example when searched for aegislash. It will return the information like Its usage percentage, most used moves on it with percentage, abilities with their usage percentage.

I searched a little bit and stumbled upon this api SmogonUsageStats . I can't figure out how it actually works. Like i should be able to enter pokemon name and tier, and it should give the results like what percentage of teams are using that pokemon in that tier, with what movesets and abilities. If that pokemon is banned then raise the errors.

In this api, when i search for dragapult it gives out the results but not for pokemons like landorus or blissey. I mean, any pokemon can be used in a tier which either belongs to the tier or any tier below it. So gen8ou tier searched for aron should give results even though they will approximately equal to zero as aron is almost never used in ou. While same query made to gen8lc should give expected results. Examples like Terrakion in gen8ou give this result
Code:
{"error":404,"message":"Unable to find usage data for terrakion in gen8ou during 2019-12 with rating 1695"}
Can anyone suggest me a api for this usecase or point out something about this api that i am doing wrong.

Thanks ^^
 
Can anyone suggest me a api for this usecase or point out something about this api that i am doing wrong.
Terrakion, Landorus, and Blissey did not exist in SWSH OU in December 2019 because Home and the DLC had not released yet.

EDIT:
I found this thread about the API that has some info on how to make it work. You can omit the month and year to get the most recent stats apparently.
https://www.smogon.com/forums/threads/usage-stats-api.3661849/
 
Last edited:

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top