Most fields are missing from /Games/byPlatformID

Need help with your application? Ask here.
Post Reply
schworak
Posts: 6
Joined: Wed Sep 11, 2019 11:56 am

Most fields are missing from /Games/byPlatformID

Post by schworak » Mon Sep 16, 2019 2:15 pm

Swagger says these fields should be included:

id, game_title, release_date, platform, players, overview, last_updated, rating, coop, youtube, os, processor, ram, hdd, video, sound, developers, genres, publishers, alternates



I can't get most of those to return from the API call. After pulling down the entire game set using /Games/byPlatformID and saving them to .json files so I can tinker without hammering the API, I found that after scanning every file, the only fields I ever got back were these:

developers, game_title, id, platform, release_date


I tried these two methods, one without specifying the fields and one with all of the fields. I get the exact same result...

Code: Select all

https://api.thegamesdb.net/Games/ByPlatformID?apikey=[my-key-here]&id=1&fields=players%2C%20publishers%2C%20genres%2C%20overview%2C%20last_updated%2C%20rating%2C%20platform%2C%20coop%2C%20youtube%2C%20os%2C%20processor%2C%20ram%2C%20hdd%2C%20video%2C%20sound%2C%20alternates
and

Code: Select all

https://api.thegamesdb.net/Games/ByPlatformID?apikey=[my-key-here]&id=1
What could I be doing wrong? Why am I not getting the remaining fields?

StainlessSteelRat
Posts: 12
Joined: Mon May 21, 2018 7:18 am

Re: Most fields are missing from /Games/byPlatformID

Post by StainlessSteelRat » Mon Sep 16, 2019 9:26 pm

Correct me if I'm wrong Zero or someone else, but I believe the documentation might be wrong here. I think the idea behind getting all the games of a platform is for a quick general list. Then you can use the IDs you've gathered to accurately query the more detailed APIs in large batches.

schworak
Posts: 6
Joined: Wed Sep 11, 2019 11:56 am

Re: Most fields are missing from /Games/byPlatformID

Post by schworak » Mon Sep 16, 2019 10:19 pm

I am not sure that is the right answer.

/Games/Updates with a last edit of 23159 returns a long description for game 48237. So I would update my copy of the data to remember that change.

On the other hand...

/Games/byGamyID for 48237 only returns the minimall folds I described above. So querying an individual game won't give me the correct values either. No description, no box art, just very minimal info.


I am using my private server key, but I tested one with the public key and got the same result.

Could someone give me a url that actally works so (minus the key ofcourse) so I can see what I am doing wrong?

I get the sane result testing with curl, python or directly in swagger. So I am not sure what I am missing.

Thanks.

schworak
Posts: 6
Joined: Wed Sep 11, 2019 11:56 am

Re: Most fields are missing from /Games/byPlatformID [SOLVED]

Post by schworak » Tue Sep 17, 2019 3:55 am

OH MY GOODNESS!

Ok, I am a total idiot. I knew I was doing something wrong but I just wasn't seeing it.

YES, to get the extra fields you MUST list them comma separated. If you don't you will only get the minimal set. Also, if you make any typing errors, the requested fields won't be recognized and of course, won't be returned.

I PUT A SPACE AFTER EACH NAME!

Once I removed the spaces, the queries started working and returned all of the expected data. Fortunately, I have just enough requests left to reprocess the copy down.

This is a working copy of the URL I used just a moment ago to get one block of data back. PERFECT!

Code: Select all

https://api.thegamesdb.net/Games/ByPlatformID?id=22&apikey=[my-key-here]&fields=players,publishers,genres,overview,last_updated,rating,platform,coop,youtube,os,processor,ram,hdd,video,sound,alternates&include=boxart

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

Re: Most fields are missing from /Games/byPlatformID

Post by Zer0xFF » Sat Sep 28, 2019 11:48 am

yup, all request under let say `/Games/` accept the same field param, and should even return similar data structure so it can be processed the same, except for `/Updates` for obvious reasons (and there was another endpoint which was revised since it has a slightly different data structure)
Regards
Zer0xFF

Post Reply