Resource Usage stats API

https://usage-server.herokuapp.com/

I threw this together, as part of another project I'm doing and the other API that was hosted by Fingerprint (since banned) was not being updated anymore. I don't know if it matters, but I am using Express, Node and PostgreSQL.

It takes two arguments:
`date` in the form of YYYY-MM
`tier` in the form of 'gen' + 1 to 8 (or 9 or whatever when get there) + the tier (eg: ou, monotype) so gen 8 little cup is gen8lc

A link direct to the API: https://usage-server.herokuapp.com/

Why you might get errors:

did you forget the "data"?
does the tier exist at the time of accessing? Make sure it did exist.
I probably made a mistake, message me on smogon or on discord, @ alan#8283. (I will probably respond to discord faster)

The data is pulled straight from the smogon stats pages, but put into a JSON format for easy access with requests libraries. Please don't hammer it too hard as I am paying for hosting because of the sheer size of the data, but it should stay on the cheap plan for a while. ~6-7 years of data is only a little over 1 million rows. For that reason, though, I am only including data from the tiers with rating of 1650 (or whatever the adjusted one is for some OU tiers). Including the other ratings was over 4 million rows and that's a lot. If you want those ratings though, you can easily modify the source code I used to do the web scraping and stuff at my github: https://github.com/Stu-Gotz/smog_usage_stats. I think that's everything I need to say on this. I hope it works for you, this is my first time deploying anything on Heroku or really anything except my gh pages.

edit: oh and here is the source code for the server, in case this ever goes down, someone else can pick up and won't have to build it from the ground up. https://github.com/Stu-Gotz/usage_server

PS: If you're viewing the data in browser, I recommend Firefox, as it prettifies the data very well, and I believe it's a default setting. I don't know if Chrome or Edge do the same thing but if they do than ignore is this.
 
Last edited:
Yeah! Sorry, turns out I havent updated it since February, I'm running that now, and it should be good to go once I push it up to the database. I need to set it up to run on a timer, but at the moment I don't that done, as I'm still writing the logic for the autoupdate function and want it to be tight before I deploy it and break things.
 
Would it be possible to include an optional 'limit' argument so that it would return only the top 'limit' number of pokemon sorted by rank within the tier, instead of every pokemon in the entire tier? I would like to obtain just the top 50 pokemon per tier instead of the whole thing. Thank you by the way this was exactly what I was looking for.
 
Last edited:
hello

i unfortunately dont really have time for pokemon these days, but I am now working towards a masters degree and trying to career change to software development as a small midlife crisis and i'm now going to be actively maintaining this.

it now has:
https://usage-server.herokuapp.com/

- A basic front-end (WOW!) [attn mods if me having the koffing is too much like brand infringement, let me know and i will pick another one]
- up-to-date information (as of today) and will be updated each month (woohoo!) because i finally figured out how to use a calendar to keep a schedule)

api starts at path /data/YYYY-MM/tier (tier eg: gen8ou) here is a list of metagames and how they will be formatted: https://www.smogon.com/stats/2016-11/metagame/ for a better example, just remove the "-1630" or whatever at the end. best with FireFox because its JSON prettifier

feel free to use it in your applications or just to play around it, but please be mindful i am paying by working part-time.

im going to be actively working on this to add things as well including:
- hopefully a monotype branch soon (have to build the database for it but it shouldn't be too hard tbh)
- ideally a nice UI to display the stats
- UI and path for movesets
- display for movesets

I'm still maybe going to use this for a school project, so I don't think I can accept contributions, but if you see anything I could do better coding-wise, i'm open to it. i know the parser has LOTS of room for improvement (like not using pandas for the CSV lol i just wanted a working solution) and just some of the code being not as efficient as it could be.

this is the backend: https://github.com/Stu-Gotz/smog_usage_stats
this is the frontend: https://github.com/Stu-Gotz/usage_server

i dont really get on here much these days feel free to contact me on discord (alan#8283) if you see anything technical or especially if you are a admin vis-a-vis the koffing

idk if he is still around, but in the words of Hipmonlee,

Have a nice day.
 
Last edited:
I am a poor uni student so i am taking it offline because heroku is expensive and i cant be fucked to find a new hosting service at this time (considering netlify?). so if i find another ill put it back up and change the link. sorry! repos are still available though.
 

Maxouille

Gastrodon east sea <3
is a Tiering Contributor Alumnus
I am a poor uni student so i am taking it offline because heroku is expensive and i cant be fucked to find a new hosting service at this time (considering netlify?). so if i find another ill put it back up and change the link. sorry! repos are still available though.
i can host it in my house if you want, i'll relaunch my servers on july
 

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

Top