Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8447153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:06:57+00:00 2026-06-10T10:06:57+00:00

I’ve run into this issue in the past, and have been able to work

  • 0

I’ve run into this issue in the past, and have been able to work around it until now. When making a call to the Twitch API in app engine, I get an Error 400. I’ve been to the google groups twitch page, as well as twitch tv’s own forum.

I was able to talk to a ton of people at Twitch TV as well as App Engine, and to no luck have I been able to solve this problem. In hopes of clarifying my question, I have been able to make a simple app to replicate directly what is occurring when I try to make a URL call to Twitch TV’s API.

Summary:

This is the simple code that fails when my application is deployed, but works flawlessly in the localhost environment:

import webapp2
import urllib2

class MainHandler(webapp2.RequestHandler):
    def get(self):
    url = ('https://api.twitch.tv/kraken/streams/nl_kripp')
        contents = urllib2.urlopen(url)
    self.response.out.write(contents.read())


app = webapp2.WSGIApplication([('/', MainHandler)],
                              debug=True)

Here is what this exact application generates when being run on localhost (as it is suppose too):

{“stream”:{“name”:”live_user_nl_kripp”,”game”:”Guild Wars 2″,”viewers”:3229,”_links”:{“self”:”https://api.twitch.tv/kraken/streams/nl_kripp”},”_id”:3681678672,”broadcaster”:”fme”,”channel”:{“game”:”Guild Wars 2″,”name”:”nl_kripp”,”created_at”:”2012-04-15T02:25:31Z”,”teams”:[{“name”:”nolife”,”created_at”:”2012-06-20T23:48:51Z”,”background”:null,”updated_at”:”2012-06-20T23:49:08Z”,”banner”:null,”_links”:{“self”:”https://api.twitch.tv/kraken/teams/nolife”},”_id”:330,”logo”:null,”info”:”\n”,”display_name”:”noLife”}],”banner”:null,”updated_at”:”2012-08-26T21:12:55Z”,”background”:”http://static-cdn.jtvnw.net/jtv_user_pictures/nl_kripp-channel_background_image-527e8b792a46df22.png”,”url”:”http://www.twitch.tv/nl_kripp”,”logo”:”http://static-cdn.jtvnw.net/jtv_user_pictures/nl_kripp-profile_image-267fd5e2fb95a15d-300×300.png”,”_id”:29795919,”_links”:{“stream_key”:”https://api.twitch.tv/kraken/channels/nl_kripp/stream_key”,”self”:”https://api.twitch.tv/kraken/channels/nl_kripp”,”chat”:”https://api.twitch.tv/kraken/chat/nl_kripp”,”commercial”:”https://api.twitch.tv/kraken/channels/nl_kripp/commercial”,”features”:”https://api.twitch.tv/kraken/channels/nl_kripp/features”},”mature”:null,”video_banner”:”http://static-cdn.jtvnw.net/jtv_user_pictures/nl_kripp-channel_offline_image-f3ad1124bc19cffd-640×360.png”,”display_name”:”nl_Kripp”,”status”:”nolife Kripparrian — GW2 Ranger Lvling. Server = Maguuma”},”preview”:”http://static-cdn.jtvnw.net/previews/live_user_nl_kripp-630×473.jpg”,”partner”:true},”_links”:{“self”:”https://api.twitch.tv/kraken/streams/nl_kripp”}}

And now the same exact application in the App Engine environment:

http://urltestingsite.appspot.com/

I have spent quite a while trying to solve this problem as it is a major chain link in my website. Does anyone, have any remote idea as to why this occurs?

EDIT – this is the code from my actual application:

def check_if_live(self, b):
    url = ('https://api.twitch.tv/kraken/streams/%s' %b)
    url2 = urlfetch.fetch(url, headers = {'User-Agent': "suitegamer_User-Agent"}) 
    contents = urllib2.urlopen(url2)
    if (contents.read()).find('{"stream":null,') == 0:
        return 'Offline'
    else:
        return 'Live'

This code is returning this AttributeError:

AttributeError: '_URLFetchResult' object has no attribute 'get_type'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:06:58+00:00Added an answer on June 10, 2026 at 10:06 am

    This errors are returned some times when you hit the rate limit or when your app is denied access.

    According to this thread, it may be what could actually be happening. Since GAE is a shared environment, you will most certainly hit these limits very often, because there could be many users querying the twitch.tv and/or justin.tv (I don’t know if the limits are shared between the two).

    Also according to this other thread, the api just don’t like the GAE production User-Agent (I tried it myself and the problem is still there).

    The solution to the second problem is to set the User-Agent (see How to change User-Agent on Google App Engine UrlFetch service?), but you will still probably be hitting the rate limits.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is what i have right now Drawing an RSS feed into the php,
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.