PokeAPI / pokeapi

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

Retrieve (basic) info of all Pokémon? #138

Closed TheOddler closed 8 years ago

TheOddler commented 8 years ago

Is there a way, in a single request, to get (basic) info of all Pokémon in the database?

With basic information I mean id, name and a single sprite at least. Basically the minimal information needed to show a grid of all Pokémon.

TheOddler commented 8 years ago

I just found that you can call each endpoint without any parameter, so just GET api/v2/pokemon for instance. But this only returns the names and urls. Is there a way to request more information about each resource?

sargunv commented 8 years ago

Currently this does not exist. You could request all the pokemon-species and cache them, and look at the cache for the additional information without making a ton of requests.

TheOddler commented 8 years ago

Ok, thanks!

Maybe this is a good idea as extra functionality then ;)

zaneadix commented 8 years ago

@TheOddler Also, the resource references you're getting in that list really do provide the information you're looking for (sort of)

The resource name could be parsed into the actual name (a bit awkwardly I admit) The id of the pokemon could be stripped from the end of the url The image could be referenced by using the id stripped from the url. For example, the standard sprite of any pokemon would be at http://pokeapi.co/media/sprites/pokemon/{id}.png so drifloon would be http://pokeapi.co/media/sprites/pokemon/425.png

Hope that helps some, but as @sargunster said, caching is the most solid way to go.