Avatar image for andrewfader
#1 Posted by andrewfader (4 posts) -

I'm using the GiantBomb API on my site, it's awesome and I have enhanced my lists of games with screenshots, genres, and descriptions from GiantBomb. 
 
My one problem has been the strange order that the search returns sometimes. For example, I searched for Donkey Kong Country, and the results came back with Donkey Kong Country Returns for Wii first, followed by the SNES game that I was looking for, and then the SNES sequels. My search for Contra came up with Hitman: Contracts, then just about every other Contra game before the first NES one that I was searching for. 
 
The strangest thing is, these results are in a different order than those from the website search box...

Avatar image for skiguyusc
#2 Edited by skiguyusc (43 posts) -

I realize this is an incredibly old post, but was there ever an answer for this?

I noticed similar behavior where if I search for "Super Mario Galaxy", the API actually returns "Super Mario Galaxy 2" as the first result followed by "Super Mario Galaxy". The website search box returns them in the opposite order, like I'd expect.

Anyone have any thoughts?

Example URL:

https://www.giantbomb.com/api/search/?api_key=<my api key>&format=json&query=Super%20Mario%20Galaxy&resources=game&field_list=api_detail_url,name

Avatar image for hogonalog
#3 Edited by hogonalog (20 posts) -

@skiguyusc: If you're only searching one type of resource, you can try filtering by name. That way, you only return items with the exact search query in the name:

https://www.giantbomb.com/api/games/?api_key=[API_KEY]&format=json&filter=name:Super%20Mario%20Galaxy&field_list=api_detail_url,name

Just keep in mind that you can't do fuzzy matching that way, e.g. "assassins creed" vs "assassin's creed".

Avatar image for freebrunch
#4 Edited by freeBrunch (3 posts) -

also running into same issue. I see this is old post. I am trying to search on bioshock and first search result is bioshock infinite. Referring to the previous post I'm not sure "filter=name" is supported by the API for search (http://www.giantbomb.com/api/documentation#toc-0-38) unless i am confused which is very possible