Query by UPC

Avatar image for tex8503
tex8503

4

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

Hey folks,

I'm starting out to try and use the API and I'm trying to run a search by UPC:

This is the API call I'm making:

http://www.giantbomb.com/api/releases/?api_key=[API KEY]&filter=product_code_value:047875802056&format=json&limit=1

I'm expecting to get back the GBA version of doom:

http://www.giantbomb.com/doom/3030-7326/releases/

Any ideas what I'm doing wrong?

Thanks!

Avatar image for acsct3
acsct3

16

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

@tex8503: When trying to get a specific resource (giantbomb.com/api/[resource]) you need to specify the ID of what you are trying to get after the resource type (giantbomb.com/api/[resource]/[id]). So, unless you know what you are looking for, you need to search, like this: giantbomb.com/api/search/?api_key=[key]&query=[search query]&resource=[resource type].

The problem I found is that the resource type can't be "release" (as seen here). If someone is able to find a solution, please post it here.

You can find a specific release by searching for a game's name and getting it's ID. Using this ID, you can get the list of releases which you can narrow down by platform, until you get the desired result.

This is the API link to the GBA release of Doom: http://www.giantbomb.com/api/release/3050-18631/?api_key=[your key]. You can also see the "product_code_type" and "product_code_value" fields, taunting you :).

Avatar image for tex8503
tex8503

4

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

@acsct3 - Thanks for the info. It sounds like I can't do what I'm trying to (do a lookup of a game via the UPC code) because the resource endpoint requires the game's ID (which you don't know if you've only got the UPC), correct?

Guess this puts me back to finding a resource where I can feed in the UPC and get the game name out before I can look it up the GB API :)

Avatar image for acsct3
acsct3

16

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

@tex8503: As far as I can tell, no, you can't get stuff with just that code.

I've looked a bit on the Doom releases page and I've noticed that some US versions of the game have the same code, even if they're on different platforms and released on different dates. I don't know if this correct, but what it means is that if you were to search by UPC code alone, you could get multiple results for one code.

Avatar image for tex8503
tex8503

4

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

@acsct3 - Yeah - that'd also pose a problem; but for my purposes, it's a moot point without the ability to start the search via UPC. Thank you though!

Avatar image for chaser324
chaser324

9415

Forum Posts

14945

Wiki Points

0

Followers

Reviews: 1

User Lists: 15

#6 chaser324  Moderator

@tex8503: Honestly, the UPC info is pretty lacking in the wiki anyway. You might be better off looking into a way to pull data through Amazon's API to get the game title and then pull additional info from GB.