Avatar image for f4b1n0u
#1 Edited by f4b1n0u (2 posts) -

Hi Guys, first of all, a big thank you for your job here, it's really appreciated here xD

But sadly I have an issue.

I'm building a mobile app, which display a list a games base on a keyword search or a specific franchise

- from a keyword:

I'm using https://www.giantbomb.com/api/games/

with this query strings:

- filter=name:%KEYWORD%

- field_list=id,name,image,images,platforms

sadly I do not have any images, to have them, I need to use https://www.giantbomb.com/api/game/ID_OF_THE_GAME

that's not a big deal because I need this images only when you want to display the details of the game which is user triggered, so I'm not worried about api limitation here.

- from a franchise:

the franchise provide a very low level of information about the games, I supposed it is due to the fact we have the exhaustive list of games fo this franchise and it could be quite long (example mario), so that could be expensive to request for all the details for each games

but to display my list I need to display more than just the name and the id, I need the main image and the platforms at least, so I'm doing an API call (same as before), https://www.giantbomb.com/api/game/ID_OF_THE_GAME to have them.

Thanks to my lazy load, I do not request the details of the whole list in one go. I do it 10 by 10 in function of the scroll of the user, but if he scrolls too fast, the app calls loads of game details, and of course at one point, I encountered a 420, so I start to worry because there is only one API key for all the instances of the app, so if there is even a few users, this key will saturate the API limit pretty fast.

I could ask every user to have is own API key ... but sounds like a terrible user experience, and even I didn't found any clean way (API call) to register and have one API key per device, but could be cool actually.

so here is what I'm trying to do. I want a game endpoint where I can give list of IDs, and where I will have the desired details via filters (like usual)

I tried something like https://www.giantbomb.com/api/games/filter=id:1234,id:456

but the filters are working as AND and not OR (I guess) and due to the unicity of the ID, you cannot have a game who match 2 difference IDs

I noticed that other people have a similar issue but it is about the concept field not the ID

So am I doing something wrong here ?

Can I use a OR filter instead of an AND one ?

Is there an endpoint to target specific games in one call ?


Avatar image for zinther
#2 Posted by Zinther (6 posts) -

Inside the filter, I do not believe you will be able to use a custom Logical Operator. However, you can do something like the following:

Pseudo Code because I don't know what language you are working in.

Get query from user

Send query to API

Capture response

Iterate through results and send new query with ID returned from initial response

Capture images desired