#1 Edited by IvoSlash (1 posts) -

Hi all!

I'm making a project for my grad school that must consit in extracting the name, image, release date and platform from a input based query.

the user inputs the game name (query) in my website and the api needs to extract the info told above.

I can only extract the game name, release date, and images... i've read some posts and found out that it's impossible to withdraw the platforms tag using a query.

and there's any option to sort the oldest games first? my website is based in retrogaming...

my Api url is:

http://api.giantbomb.com/search/?query=ocarina+of+time&resource=game&field_list=name,image,original_release_date,platfoms&api_key=[edited out by mod]&format=xml

If someone is willing to help, i'll be very very thankful. Thanks

#2 Posted by tracert (7 posts) -

You've posted your API key in a public place. This is a bad idea for security reasons, it would be good if you edited your post to remove it.

#3 Posted by calcuseless (16 posts) -

You've got a typo, it's "&resources=game". If you want to get platforms, remove "platforms" from field_list and add "id" to field_list. Then make a second query where you look up the platform information using that id. Like with id=12572:

http://api.giantbomb.com/game/12572/?field_list=platforms&format=xml&api_key=???

If you're using search, you're going to have to sort it yourself, but it shouldn't be that hard in any language with the right tools. Depending on the scope of this project, you may want to consider ditching search and maintaining your own database backend where you pull all your information off giantbomb every so often (probably rarely since this is mostly used for retro games instead of new releases) to keep it updated. It would let you do so much more and make you not rely on your connection to giantbomb.com.

As a side note, any particular reason you're using XML instead of JSON/JSONP? JSON is not only easier to read, but it also takes up less bytes so you'll use less bandwidth and have better response times. You can find implementations to help with whatever language you're using at http://www.json.org.