Pokeapi: Search for a pokemon

Created on 17 Oct 2018  路  7Comments  路  Source: PokeAPI/pokeapi

I'm trying to find a way to search for pokemons based on name (not exact search), for example, Star Wars API has this:

https://swapi.co/api/people/?search=sk

Is there anything like that in Poke API?

Most helpful comment

@renatoi Unfortunately, without caching every Pok茅mon resource, @sargunv's suggestion will only work in English. However, I am building a GraphQL API for Pok茅API that will allow complex filtering, including by name in any language, as well as by other criteria. Work on that is currently paused, but I hope to get back into it soon.

All 7 comments

I recommend just getting the entire list and filtering for name on the client side, it's only <1000 elements in the list.

@renatoi Unfortunately, without caching every Pok茅mon resource, @sargunv's suggestion will only work in English. However, I am building a GraphQL API for Pok茅API that will allow complex filtering, including by name in any language, as well as by other criteria. Work on that is currently paused, but I hope to get back into it soon.

What I currently use is a MySQL database and a hand full of spell checkers for each language. Each table includes the names of a resource in each language as well as the "PokeAPI-friendly" name. As long as the guess is close enough, you can get the Pokemon by any of its names. The tables are pretty easy to generate, though the spell checkers can be a bit more time consuming.

The GraphQL API sounds super cool. I'm excited to see it completed.

Will the GraphQL API allow for searching across resources?

Any update on this?

It looks like some progress was made here but there are no currently active GraphQL plans: https://github.com/cmmartti/pokemon-finder

Closing in favor of #474

If anybody would like to spin up Charles' graphQL pokeapi server, here you find his code.

Was this page helpful?
0 / 5 - 0 ratings