How to get all details of a Platform?

Need help with your application? Ask here.
Post Reply
User avatar
GamersDatabase
Posts: 20
Joined: Wed Jul 04, 2018 2:48 pm

How to get all details of a Platform?

Post by GamersDatabase »

Looking through the docs and trying a few different calls I'm not having any luck pulling all the data for any particular platform.

Say I want all the details for platform id 1 (PC)

Code: Select all

https://api.thegamesdb.net/Platforms/ByPlatformID?id=1&apikey=removed
But all this returns is:

Code: Select all

{"code":200,"status":"Success","data":{"count":1,"platforms":{"1":{"id":1,"name":"PC","alias":"pc"}}},"remaining_monthly_allowance":979,"extra_allowance":0}
Am I missing something obvious here?

thanks.

Leo_Pride
Posts: 630
Joined: Mon Apr 23, 2018 2:10 am

Re: How to get all details of a Platform?

Post by Leo_Pride »

To my knowledge platform details aren't yet implemented, but the data is present.
We're curious to see how new projects use TGDB API.
If you have a new public project, please provide a link to it so we can highlight cool new applications! 8-)

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

Re: How to get all details of a Platform?

Post by Zer0xFF »

look at "/Platforms*` Common" in the api documentation page.
Regards
Zer0xFF

User avatar
GamersDatabase
Posts: 20
Joined: Wed Jul 04, 2018 2:48 pm

Re: How to get all details of a Platform?

Post by GamersDatabase »

Ok I've got the Platform calls working well, but I'm not seeing a listing of the images related to each platform. Well there is some information there, but I can't make sense of it.

For instance Nintendo Gamecube (id=2) there is:

Code: Select all

     "icon": "nintendo-gamecube-1336524714.png",
        "console": "2.png",
        "controller": "2.png",
How can I lookup the base URL for these images?

When I inspect the images presented on the website listing, the image filenames don't match up.

edit:
It looks like the Platform image data can be obtained via the "Games/Boxart?id=GameIDForAGameOnThePlatformYouWant" call, but that seems a little out of place? ie:

Code: Select all

https://api.thegamesdb.net/Games/Boxart?games_id=1&apikey=remove&filter=fanart,series,boxart,screenshot,platform-banner,platform-fanart,platform-boxart,clearlogo
returns:

Code: Select all

{
  "code": 200,
  "status": "Success",
  "data": {
    "count": 1,
    "base_url": {
      "original": "https://cdn.thegamesdb.net/images/original/",
      "small": "https://cdn.thegamesdb.net/images/small/",
      "thumb": "https://cdn.thegamesdb.net/images/thumb/",
      "cropped_center_thumb": "https://cdn.thegamesdb.net/images/cropped_center_thumb/",
      "medium": "https://cdn.thegamesdb.net/images/medium/",
      "large": "https://cdn.thegamesdb.net/images/large/"
    },
    "boxart": {
      "1": [
        {
          "id": 242,
          "type": "fanart",
          "side": null,
          "filename": "fanart/1-2.jpg",
          "resolution": "1920x1080"
        },
        {
          "id": 248,
          "type": "fanart",
          "side": null,
          "filename": "fanart/1-3.jpg",
          "resolution": "1920x1080"
        },
        {
          "id": 249,
          "type": "fanart",
          "side": null,
          "filename": "fanart/1-4.jpg",
          "resolution": "1920x1080"
        },
        {
          "id": 433,
          "type": "fanart",
          "side": null,
          "filename": "fanart/1-5.jpg",
          "resolution": "1920x1080"
        },
        {
          "id": 476,
          "type": "series",
          "side": null,
          "filename": "graphical/1-g.jpg",
          "resolution": null
        },
        {
          "id": 4277,
          "type": "fanart",
          "side": null,
          "filename": "fanart/1-6.jpg",
          "resolution": "1920x1080"
        },
        {
          "id": 17158,
          "type": "fanart",
          "side": null,
          "filename": "fanart/1-7.jpg",
          "resolution": "1920x1080"
        },
        {
          "id": 22963,
          "type": "platform-banner",
          "side": null,
          "filename": "platform/banners/1-1.png",
          "resolution": null
        },
        {
          "id": 22977,
          "type": "platform-boxart",
          "side": null,
          "filename": "platform/boxart/1-1.jpg",
          "resolution": "763x1080"
        },
        {
          "id": 22993,
          "type": "platform-fanart",
          "side": null,
          "filename": "platform/fanart/1-1.jpg",
          "resolution": "1920x1080"
        },
        {
          "id": 23015,
          "type": "platform-fanart",
          "side": null,
          "filename": "platform/fanart/1-2.jpg",
          "resolution": "1920x1080"
        },
        {
          "id": 23413,
          "type": "boxart",
          "side": "front",
          "filename": "boxart/front/1-1.jpg",
          "resolution": "1529x2156"
        },
        {
          "id": 23414,
          "type": "boxart",
          "side": "back",
          "filename": "boxart/back/1-1.jpg",
          "resolution": "1527x2156"
        },
        {
          "id": 24399,
          "type": "platform-banner",
          "side": null,
          "filename": "platform/banners/1-2.jpg",
          "resolution": null
        },
        {
          "id": 26570,
          "type": "platform-fanart",
          "side": null,
          "filename": "platform/fanart/1-3.jpg",
          "resolution": "1920x1080"
        },
        {
          "id": 26573,
          "type": "platform-fanart",
          "side": null,
          "filename": "platform/fanart/1-4.jpg",
          "resolution": "1920x1080"
        },
        {
          "id": 48904,
          "type": "platform-fanart",
          "side": null,
          "filename": "platform/fanart/1-5.jpg",
          "resolution": "1920x1080"
        },
        {
          "id": 60337,
          "type": "screenshot",
          "side": null,
          "filename": "screenshots/1-1.jpg",
          "resolution": null
        },
        {
          "id": 60338,
          "type": "screenshot",
          "side": null,
          "filename": "screenshots/1-2.jpg",
          "resolution": null
        },
        {
          "id": 60339,
          "type": "screenshot",
          "side": null,
          "filename": "screenshots/1-3.jpg",
          "resolution": null
        },
        {
          "id": 96687,
          "type": "clearlogo",
          "side": null,
          "filename": "clearlogo/1.png",
          "resolution": "400x200"
        }
      ]
    }
  },
  "pages": {
    "previous": null,
    "current": "https://api.thegamesdb.net/Games/Boxart?games_id=1&apikey=removed&filter=fanart%2Cseries%2Cboxart%2Cscreenshot%2Cplatform-banner%2Cplatform-fanart%2Cplatform-boxart%2Cclearlogo&page=1",
    "next": null
  },
  "remaining_monthly_allowance": 966,
  "extra_allowance": 0
}

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

Re: How to get all details of a Platform?

Post by Zer0xFF »

it is out of place, the database was laid out like this, but I had plans to fix that but got distracted.

eiterway, I've introduced a new API endpoint

Code: Select all

https://api.thegamesdb.net/Platforms/Images?platforms_id=1,2&filter[type]=boxart,fanart,icon,etc
though to note, icons are somewhat oddly laid out (there is 4 sets, which don't really fit into the current API layout, I might just expose the higher res one), so this won't apply to them for now.
Note: ill remove the platform-* filter from `/Games/Boxart` in time, so you should avoid that going forward.

edit:
added filter icon

Regards
Zer0xFF
Regards
Zer0xFF

User avatar
GamersDatabase
Posts: 20
Joined: Wed Jul 04, 2018 2:48 pm

Re: How to get all details of a Platform?

Post by GamersDatabase »

Awesome thanks for the quick response.

User avatar
GamersDatabase
Posts: 20
Joined: Wed Jul 04, 2018 2:48 pm

Re: How to get all details of a Platform?

Post by GamersDatabase »

I just noticed that Controller Art is missing from the Boxart calls. Will that still be an option?

Post Reply