PokeAPI / pokeapi

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

Alolan forms missing #455

Closed Sec42 closed 3 years ago

Sec42 commented 4 years ago

When querying for Pokemon, the alolan forms seem to be missing:

curl https://pokeapi.co/api/v2/pokemon/74 | jq .forms
[
  {
    "name": "geodude",
    "url": "https://pokeapi.co/api/v2/pokemon-form/74/"
  }
]

I can not find any reference to the alola form in the output for /pokemon/74 nor /pokemon/geodude

For example https://veekun.com/dex/pokemon/geodude shows the Alola form.

Naramsim commented 4 years ago

Maybe we have to update the data. Can you please check on Veekun when did they add the form for Geodude?

Thanks

Sec42 commented 4 years ago

I am not very familiar with the veekun database. I checked the github repo @ https://github.com/veekun/pokedex/blob/master/pokedex/data/csv/pokemon_forms.csv and that seems to list the geodude-alolan as pokemon_id 10109 - the link given above (https://veekun.com/dex/pokemon/geodude) does have alola form listed.

Naramsim commented 4 years ago

Well, they touched that file and changed the data inside 12 days ago. Our data probably is missing and if it was there it was probably wrong. I'll try to update the APIs.

Thanks for pointing this out

DresseurPakito commented 4 years ago

It seems that the "Pokemon" model is specific to the form you're currently checking. It does not concern Alolan Pokemon only : if you test it on Rotom (https://pokeapi.co/api/v2/pokemon/rotom) his only form is the base one ; and if you check for one of his forms (https://pokeapi.co/api/v2/pokemon/rotom-heat) you get a result and it seems that it's is only form.

In fact, forms are listed under the Pokemon-Species model. If once again we try it with Rotom (https://pokeapi.co/api/v2/pokemon-species/rotom) you can see a key named "varieties" who contain each forms the Pokemon could have.

Now you got the way to list all forms for a specific Pokemon specy, in order to display those datas on a Pokedex page or something like that.

Now, if you need to list all Pokemon forms in a single screen, you can get https://pokeapi.co/api/v2/pokemon-form which contain all the (current) 1.123 Pokemon forms, including events ones like cap Pikachus, regional forms (Galar isn't implemented yet) and so on.

Naramsim commented 3 years ago

Closing, Alola data has been added to the API.

Although, it's a bit counterintuitive to fetch it.

First, you query Geodude species and then look at its varieties and you find geodude-alola. Which is then linked to https://pokeapi.co/api/v2/pokemon/10109/