Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

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

Open
LucasTrindadeDev opened this issue Aug 9, 2023 · 3 comments

Comments

@LucasTrindadeDev
Copy link

LucasTrindadeDev commented Aug 9, 2023

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

@Naramsim
Copy link
Member

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

@LucasTrindadeDev
Copy link
Author

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?

@shockthetoast
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants