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.
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: