pokedex icon indicating copy to clipboard operation
pokedex copied to clipboard

Basculegion returns 404 when requesting to https://pokeapi.co/api/v2/pokemon/basculegion

Open LucasTrindadeDev opened this issue 2 years ago • 3 comments

I don't know if I'm doing something wrong, but requesting https://pokeapi.co/api/v2/pokemon/basculegion returns a 404 - Not Found error. Requesting https://pokeapi.co/api/v2/pokemon-species/902 correctly returns Basculegion data, but I can't find out how to return him by his name. Am I missing something?

https://pokeapi.co/api/v2/pokemon/basculegion image

https://pokeapi.co/api/v2/pokemon-species/902 image

LucasTrindadeDev avatar Aug 09 '23 23:08 LucasTrindadeDev

It's correct. You can find the relative Pokemons in the pokemon-species endpoint

Naramsim avatar Aug 15 '23 19:08 Naramsim

That doesn't seem right, a call to https://pokeapi.co/api/v2/pokemon/basculegion should work, as it is a valid Pokémon name, don't?

To be more user friendly, I search Pokémon by it's names in my application, not the species number. This is the only Pokémon that returns not found by it's name (as far as I know).

I know that are special cases such as urshifu (that returns not found because you need to specify the style), but basculegion should work, right?

LucasTrindadeDev avatar Aug 15 '23 20:08 LucasTrindadeDev

That doesn't seem right, a call to https://pokeapi.co/api/v2/pokemon/basculegion should work, as it is a valid Pokémon name, don't?

To be more user friendly, I search Pokémon by it's names in my application, not the species number. This is the only Pokémon that returns not found by it's name (as far as I know).

I know that are special cases such as urshifu (that returns not found because you need to specify the style), but basculegion should work, right?

The "pokemon" endpoint is for specific variants of a species. It's confusing because any pokemon without variants will work with its species name, as will some that do have variants, such as unown. The distinction is that unown's forms are only distinct visually. Any time there is a difference that is more than just visual, it will be listed separately here. From the documentation:

"Each Pokémon belongs to a specific species but may take on a variant which makes it differ from other Pokémon of the same species, such as base stats, available abilities and typings."

For example, Wormadam returns a 404 as well: https://pokeapi.co/api/v2/pokemon/wormadam

This is because Wormadam has three forms with different typings. So to access, for example, the trash from, you can use this url: https://pokeapi.co/api/v2/pokemon/wormadam-trash

Basculegion's male and female forms are listed separately because they have different stats. (Males have higher attack, females have higher speed.) They can be accessed like so: https://pokeapi.co/api/v2/pokemon/basculegion-male https://pokeapi.co/api/v2/pokemon/basculegion-female

But you don't need to keep track of these yourself. As @Naramsim was saying, you want to be using the pokemon-species endpoint for all of these. Every pokemon name will work there, including Basculegion:

https://pokeapi.co/api/v2/pokemon-species/basculegion https://pokeapi.co/api/v2/pokemon-species/wormadam https://pokeapi.co/api/v2/pokemon-species/unown https://pokeapi.co/api/v2/pokemon-species/urshifu https://pokeapi.co/api/v2/pokemon-species/snorlax

The JSON data for these also has a property called "pokemon" that points you to all the variants. With Urshifu for example, not only does it give you the Single Strike and Rapid Strike versions, but the GMAX versions of both of those.

shockthetoast avatar Sep 21 '23 09:09 shockthetoast