Q: How to get newest games through API call?

Avatar image for knight_9
knight_9

5

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#1  Edited By knight_9

Good evening gents, I am a total newb in web developing. I am learning API calls right now.

I am just wondering if there is a way to get newest games in the data base.

Should I use search or is there a specific API call for that.

Could someone please show me an example, let's say get 20 newest games in the database? (Just the request URL)

e.g. http://www.giantbomb.com/api/search/?api_key=[key]&format=json&query="fallout" will get me all fallout games. How do I search by release date?

Thank you.

Avatar image for avenged
avenged

43

Forum Posts

282

Wiki Points

0

Followers

Reviews: 0

User Lists: 3

Have you tried using sort?

&sort=original_release_date:desc

You could also combo this with a date filter:

Date filters: &filter=field:start value|end value (using datetime format)

Avatar image for jslack
jslack

1186

Forum Posts

1165

Wiki Points

0

Followers

Reviews: 1

User Lists: 6

Avatar image for knight_9
knight_9

5

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

Thank you two. I will try it out.

Avatar image for knight_9
knight_9

5

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

@avenged:Hi avenged, I tried the sort, it is very interesting. I used asc and desc. I limited the responds to 20 resources. I got different results, however, all of them got null in original_release_date.

http://www.giantbomb.com/api/games/?api_key=[KEY]&sort=original_release_date:desc&format=json

http://www.giantbomb.com/api/games/?api_key=[KEY]&sort=original_release_date:asc&format=json

Is this the way to get it? I got different results, but all of them got no original release date. All Null.

Avatar image for avenged
avenged

43

Forum Posts

282

Wiki Points

0

Followers

Reviews: 0

User Lists: 3

@knight_9: Use a date filter as well (see my original response) to prevent Null original_release_date values.

Avatar image for knight_9
knight_9

5

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

@avenged: Thank you very much. It works now. Happy Thanksgiving.