#1 Edited by risseless (477 posts) -

I'm new to this GB API thing (very awesome by the way), but I don't see a way in the documentation to get a list of galleries for a game, or see what galleries an image is in, etc. Nothing to do with galleries whatsoever. Any plans for this? Did I miss it in the docs?

#2 Posted by mosdl (3228 posts) -

You do get a list of images, but it doesn't contain all images

#3 Posted by LordAndrew (14426 posts) -

You can only get the default image, plus 10 of the most recent images if the resource is a game. That's probably best, actually. You really don't want to run into copyright problems with images you can't even control. You could probably claim fair use for the default image and ten screenshots. Anything more may be risking it.
 
If you really want to grab all the images from a gallery, maybe you could try scraping.

#4 Posted by risseless (477 posts) -

I was going to use it to make a list of games that are missing box art, by looking in each game's "Box Art" gallery. But I can make the assumption that the primary image is the box art. It's not quite as accurate, but good enough.

#5 Posted by LordAndrew (14426 posts) -
@risseless: Even without knowing whether it's box art, that would be a very useful list. Myself, I've thought about using the API to generate various types of lists for maintenance purposes. Have you ever seen the database reports on Wikipedia? I love those things. Of course we don't have database access like toolserver users do, but the API is a decent alternative.
 
For these kinds of things, perhaps the API could at least provide metadata about images. Even if we can't access the images directly, knowing whether what galleries exist and how many images are in a gallery would be very useful. You could check whether a game has box art, or you could get a list of games that have galleries for platforms that the game wasn't actually released on. More valuable information could be made available if they opened up the API a bit more.
 
Of course, since that information's not available, getting what you want is more difficult. You could get a list of games from the API, and assume that games without images are also without box art. For games with images, you would have to fetch the actual gallery page and grep for the Box Art gallery. If there are no images in that gallery, then you can assume it is a game without box art. Unfortunately, since the image counts aren't completely reliable, you would probably want to fetch the contents of the Box Art gallery too and actually check for the presence of images. It's a bit cumbersome, but it can get you the information you want.
#6 Edited by risseless (477 posts) -
@LordAndrew:  I had not seen the Wikipedia database reports, but that kind of maintenance/status statistics are why I am interested in the API. I'm thinking about using it to compile a list of places that need work -- games with no releases, people with no associated game, etc. This would allow me (and anyone else) to know where the work needs to be done without having to take stabs in the dark. The API is fantastic, but doesn't quite give the same level of queriability as SQL, and unfortunately not all parts of the site are available it seems. Doubt the staff will give me database access though, so I'll make due with browsing games looking for conditions that match. =)
 
No idea how soon I'd get to something like this. I was just tossing around the idea in my head and playing with the API to see what's possible.