PokeAPI / pokeapi

The Pokémon API
https://pokeapi.co
BSD 3-Clause "New" or "Revised" License
4.07k stars 923 forks source link

[Feature Request] Past Stats for Pokemon #849

Open Anguishjumps opened 1 year ago

Anguishjumps commented 1 year ago

Hiya, I might be mistaken, but I can't seem to find past stats for Pokemon. Moves have their past iterations listed, and Pokemon even have their past types listed, but I'm unable to find that same information for stats. I'm able to correct my data manually for now, but is it possible to request such a feature for the future? Thank you.

diogofd8 commented 1 year ago

I've made a .csv recording the changes in a similar format to the past_types. These are manually typed in from researching bulbapedia and lack the special split from gen 1 that I intend to add here in case this is accepted.

pokemon_stats_past.csv

I would make a pull request but I still have to study the api further to understand how to add this file to it and have it displayed on v2/pokemon/id. That's a task for another day, if this isn't implemented by then I'll give it a shot.

Naramsim commented 1 year ago

Maybe something along the way of

https://github.com/PokeAPI/pokeapi/pull/848

diogofd8 commented 1 year ago

Alright, I managed to grab the html of pokemon showdown for gen 1 ubers and parse the base stats of the original 151 in red/blue which I then added to the .csv, using 8 as the 'special' 'stat-id' since v2/pokemon/stat has already 8 entries so special would be the 9th addition.

I'll be checking #848 to attempt to mimic a similar implementation for past_stats, albeit I've never made a pull request on github so it will be a bit of a learning experience for me.

Here's the file in case someone wants to go ahead and check if I made a mistake in any of the entries. For the gen 5, 6 and 7 stat changes I've used pokeAPI to get the current stats and pokemondb's info about each pokemon with stat changes, replacing the stat/stats with changes for each pokemon and generating the csv. Hopefully there shouldn't be room for human error as everything was scripted and I confirmed the script values for a dozen of random entries.

pokemon_stats_past.csv

EDIT: @Naramsim I've forked pokeAPI and attempted to replicate the changes. Granted, I didn't understand much of what I've done as my knowledge is pretty basic but I did replicate the methods of past_abilities for past_stats by checking how stats are done and how abilities are done, comparing and figuring out what needs to be changed. Should I make a pull request or giving you the link to my fork with the commited changes is enough? https://github.com/diogofd8/pokeapi