New API: how to search game on specific platform

Need help with your application? Ask here.
Post Reply
malte
Posts: 4
Joined: Tue Jun 05, 2018 10:51 am

New API: how to search game on specific platform

Post by malte »

Hi,

just starting to look at the new API and wondering how to search for a game released on a certain platform.

With the old API I used to do searches like this:

Code: Select all

http://thegamesdb.net/api/GetGamesList.php&name=Super+Mario&platform=Super Nintendo (SNES)
With the new API I made several attempts like this:

Code: Select all

https://api.beta.thegamesdb.net/Games/ByGameName?name=Super+Mario&platform=6&apikey=mykey
https://api.beta.thegamesdb.net/Games/?name=Super+Mario&platform=6&apikey=mykey
But nothing gives the desired result. Either I get no results at all or results that contain games from all platforms.

Is this kind of search still possible? If so, could you show me a working example? Of course I could just filter the platform on the client but this would cause unnecessary traffic on both ends.

Regards
Malte

User avatar
Zer0xFF
Posts: 330
Joined: Fri Apr 20, 2018 9:18 am

Re: New API: how to search game on specific platform

Post by Zer0xFF »

Hi malte,

while this option isn't exposed in the API it's already part of the code, so ill add an API endpoint for it within the next 2 weeks.

Regards
Zer0xFF
Regards
Zer0xFF

malte
Posts: 4
Joined: Tue Jun 05, 2018 10:51 am

Re: New API: how to search game on specific platform

Post by malte »

Great! Thanks a lot.

emuFe
Posts: 2
Joined: Mon Jul 02, 2018 11:23 pm

Re: New API: how to search game on specific platform

Post by emuFe »

Is this endpoint still planned?

Thanks,
emufe

User avatar
Zer0xFF
Posts: 330
Joined: Fri Apr 20, 2018 9:18 am

Re: New API: how to search game on specific platform

Post by Zer0xFF »

yes, that will be added, I'm current focused on fixing bugs and making sure the API is in usable condition before we get more users.

Regards
Zer0xFF
Regards
Zer0xFF

User avatar
Zer0xFF
Posts: 330
Joined: Fri Apr 20, 2018 9:18 am

Re: New API: how to search game on specific platform

Post by Zer0xFF »

Hi emuFe,
I've now added a new argument to the search API end point
below is an example of a query with 2 platform filters, even if you have 1 platform you must use the array format as show

Code: Select all

https://api.thegamesdb.net/Games/ByGameName?name=God+Of+War&filter[platform][]=39&filter[platform][]=12
ideally would encode the square brakes first

Code: Select all

https://api.thegamesdb.net/Games/ByGameName?name=God+Of+War&filter%5Bplatform%5D%5B0%5D=39&filter%5Bplatform%5D%5B1%5D=12
currently the filter only supports platform, but other filters might be added as needed
Regards
Zer0xFF

Post Reply