PokemonTCG / pokemon-tcg-api

Pokemon TCG API allows developers to easily consume Pokemon card and set data in JSON format.
61 stars 3 forks source link

Searching for "N" is a pain #81

Closed cssagogo closed 6 years ago

cssagogo commented 6 years ago

Searching for the supporter card "N" is a pain. If you try it today, it shows up way, way down the list. Could you return exact matches first and then do contains second, or offer some other way to get it to the top of the list? Support for star selectors?

"N" exact match
"N*" starts with
"*N" ends with
"*N*" contains

Just throwing it out there. Not sure what API standards would be for something like this.

adback03 commented 6 years ago

Star selectors could be a good idea to introduce. Have you tried putting quotes around your search? For example: https://api.pokemontcg.io/v1/cards?name="n"

cssagogo commented 6 years ago

Perfect! Must have missed that in the documentation? So is the default contains and with quotes an exact match?

adback03 commented 6 years ago

Yup! Check here for the name parameter and its description. Glad it's working for you though!