Avatar image for metaltechie
#1 Edited by MetalTechie (2 posts) -

Hello everyone. I'm building a backlog tracking web app, and I was hoping I could use GiantBomb's APIs to get the required data.

Here's the thing. Instead of getting back the appropriate JSON results as a response, I'm getting some HTML that says "Wordpress RSS Reader, Anonymous Bot or Scraper Blocked" (along with more HTML). I've Googled it, and found out I had to use a User Agent. However, when I do, nothing is changing.

My code is in Python and I'm using Unirest to send the request.

I'm unable to receive the correct response. What can I do to fix this?

Avatar image for thisiseric
#2 Edited by thisiseric (26 posts) -

That response means you are still getting blocked by the user agent filter. Maybe you're not entering it correctly? The request should look something like this.

response = unirest.get('http://www.giantbomb.com/api/games/?format=json&api_key=1234abcd', headers={'User-Agent': 'metaltechie app'})

I use requests, personally, but the idea with unirest is exactly the same.