URL game identifier search

Avatar image for rangersedge
rangersedge

8

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

How do you search a game title and get back the id for the web page (3030-9169)? Or is there a way to download a complete game list with the associate identifiers?

Avatar image for chaser324
chaser324

9415

Forum Posts

14945

Wiki Points

0

Followers

Reviews: 1

User Lists: 15

#2  Edited By chaser324  Moderator

You should be able to get what you want through the games resource:

http://www.giantbomb.com/api/games/?format=jsonp&api_key=YOUR_API_KEY

The id will be returned along with the site_detail_url if all you really want is a link to the page on GB. In order to get a full list, you'll need to iteratively bump up the offset parameter until you've retrieved all of the results. For instance, to get the second set of 100 results:

http://www.giantbomb.com/api/games/?format=jsonp&api_key=YOUR_API_KEY&offset=100

Avatar image for rangersedge
rangersedge

8

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

That returns a 4 digit ID number. I'm looking for a list of all the game's URL ID numbers that look like 3030-9169.

Avatar image for chaser324
chaser324

9415

Forum Posts

14945

Wiki Points

0

Followers

Reviews: 1

User Lists: 15

#4 chaser324  Moderator

@rangersedge: The "3030" part of that never changes - it's just some identifier for the "games" entry type. The other half of that is the id that you can retrieve through the API.

Avatar image for rangersedge
rangersedge

8

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

I thought I have seen some where the "3030" part was different. So... to get a list of all the games I would also need to use the limit filter set to say... 100, then use the offset for each query to get the next 100? So the first query would be 1-100, the second query would use offset 100 and return records 101-200?

Avatar image for lordandrew
LordAndrew

14609

Forum Posts

98305

Wiki Points

0

Followers

Reviews: 0

User Lists: 36

There are pages that are not 3030, but that's because they're not games. You don't have to worry about those.

Incrementing the offset should get you all game pages, unless a page is deleted while you're doing this causing another game to shift to a previous page and not appear in your results. That would suck.