Today I'd like to announce 4 changes to the API:
- Last week I announced that `genre`, `developer` & `publisher` updates were inbound, so I'd like to confirm that `genre` & `developer` changes have been completed and those fields will be removed in favour of `genres` & `developers` within the next 24hours.
- Note: `genres` & `developers` returns are json arrays containing IDs (example can be found below), and those IDs can be matched to an associated name through a list found at `/Genres` and `/Developers` respectively.
- Note: the pending changes to `publisher` will follow the same trend and we hope to have that completed soon TM as well.
Code: Select all
{ "code": 200, "status": "Success", "data": { "count": 1, "games": [ { "id": 8901, "game_title": "Command & Conquer: The First Decade", "release_date": "2006-02-07", "platform": 1, "genres": [ 1, 2, 6 ], "developers": [ 925, 2579, 10025, 10026, 10027 ] } ] }, [...] }
- this change will now allow us to provide a standard user selectable Genres and Developers (and Publishers) list to ensure consistent naming and ease of mass change if needed.
- this also means that we can now display list of games from a specific developer https://thegamesdb.net/listgames.php?dev_id=2808 while this change is currently exclusive to the website, it will be made available in the API as well.
- platform filter was something that should have been available from the start, but as the saying goes, better late than never.
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
Note: this filter only applies to `/Games/ByGameName` API endpoint, should there be a need for other filters here or another endpoint please feel free to make a forum post pointing that out for us.for consistency you should encode the square brakes firstCode: Select all
https://api.thegamesdb.net/Games/ByGameName?name=God+Of+War&filter[platform][]=39&filter[platform][]=12
Edit: the array format `&filter[platform][]=39` will be removed in favour of a simpler list format `&filter[platform]=39,12`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
- Small but significant update to update API endpoint, I've added argument `last_edit_id` which can be used instead of `time` to request the latest updates, a simple change, but should make checking for updates simpler.
- another note worthy change is that returned text (game_title, overview..etc) was being returned with html encoding, that now has been removed and any encoding applied will only be done by the JSON encoder itself (which your JSON parser should handle without any intervention on your behalf).
Regards
Zer0xFF