Gamespot API: how to get data in JSON format?

Avatar image for avalloneandrea
avalloneandrea

8

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 5

#1 avalloneandrea
Member since 2018 • 8 Posts

I'd like to do some experimenting with the Gamespot API, so I have registered an account and grabbed an API key. I'm able to retrieve data in XML format, but I can't find how to switch the format to JSON. Could someone help me with this?

Avatar image for wemmick
wemmick

372

Forum Posts

0

Wiki Points

0

Followers

Reviews: 14

User Lists: 2

#2 wemmick
Member since 2013 • 372 Posts

@avalloneandrea: Sure, you can get a JSON response by adding this to your query string: &format=json. Somehow that disappeared from the docs - we'll get it back in. Thanks!

Avatar image for avalloneandrea
avalloneandrea

8

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 5

#3  Edited By avalloneandrea
Member since 2018 • 8 Posts

Thank you very much, it's working now!

May I ask you another question? I'd like to get the top games by score, but the query `reviews?score:desc` is not working. Am I missing something or is not possibile to achieve this?

Avatar image for wemmick
wemmick

372

Forum Posts

0

Wiki Points

0

Followers

Reviews: 14

User Lists: 2

#4 wemmick
Member since 2013 • 372 Posts

@avalloneandrea: The filter syntax is more like "&sort=field:direction", so in your case, give this a try: 'reviews?sort=score:desc'.

Avatar image for avalloneandrea
avalloneandrea

8

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 5

#5 avalloneandrea
Member since 2018 • 8 Posts

You are right, I have copy-pasted a wrong string. Anyway, tried with 'http://www.gamespot.com/api/reviews?format=json&sort=score:desc&api_key=xxxxxxxxxx' with no luck: I get the reviews in the default order (sorted by publish_date I guess).

Avatar image for wemmick
wemmick

372

Forum Posts

0

Wiki Points

0

Followers

Reviews: 14

User Lists: 2

#6 wemmick
Member since 2013 • 372 Posts

@avalloneandrea: Indeed that sort is not working. We have a fix in, and I expect it be released tomorrow. Thanks for the heads-up!

Avatar image for avalloneandrea
avalloneandrea

8

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 5

#7 avalloneandrea
Member since 2018 • 8 Posts

The sort by score is working now, thank you very much @wemmick!

Can you explain to me how to use the filter by publish_date? I can't figure out how to filter the reviews published between two dates...

Also, do you think you can fix/add the filter by platform? Something like `http://www.gamespot.com/api/reviews?format=json&filter=platform:PC&api_key=xxxxxxxxxx` to get all the PC game reviews would be great.

Avatar image for wemmick
wemmick

372

Forum Posts

0

Wiki Points

0

Followers

Reviews: 14

User Lists: 2

#8 wemmick
Member since 2013 • 372 Posts

@avalloneandrea: The date filter would look like https://www.gamespot.com/api/reviews/?format=json&filter=publish_date:1997-05-01%7C1997-07-03

And sorry, we don't currently have a filter on it for platforms, but I'll try to get it in the queue.

Avatar image for egraves2
egraves2

1

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 5

#10 egraves2
Member since 2018 • 1 Posts

@wemmick I am trying to filter games in the Gamespot API but the same list of games are generated each time. My url looks like: http://www.gamespot.com/api/games/?api_key=xxxxxxxx&format=json&limit=5&filter=genres:Action

Avatar image for wemmick
wemmick

372

Forum Posts

0

Wiki Points

0

Followers

Reviews: 14

User Lists: 2

#11 wemmick
Member since 2013 • 372 Posts

@egraves2: That does appear to be a bug - we're looking into it.

Avatar image for david266
David266

1

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 5

#12 David266
Member since 2020 • 1 Posts

Hi, please help me, if I want to get the id of the articles is this url correct ?

"https://www.gamespot.com/api/articles/?api_key=MY_API_KEY&format=json&filter=id"