6. Print out story titles


Can anyone tell me what's wrong with this code. I keep getting this error..

Traceback (most recent call last):
File "python", line 11, in
ValueError: No JSON object could be decoded

I swear its exactly the same as the opening minus the user input. Any help would be appreciated.

from urllib2 import urlopen
from json import load

url = 'http://api.npr.org/query?apiKey='
key = 'API_KEY'
url = url + key
url += '&numResults=3&format=json$id=1001'
print url

response = urlopen(url)
json_obj = load(response)

for story in json_obj['list']['story']:
print story['title']['$text']



That's the only mistake I can see.


That was it...Thanks!