#1 Posted by rangersedge (4 posts) -

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?

#2 Edited by Chaser324 (6587 posts) -

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

Moderator
#3 Posted by rangersedge (4 posts) -

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.

#4 Posted by Chaser324 (6587 posts) -

@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.

Moderator
#5 Posted by rangersedge (4 posts) -

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?

#6 Posted by LordAndrew (14426 posts) -

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.