So I am working on the NPR API, and got stuck at "Print out Story title" page. Below is a copy of my codes, I cant quite figure out why I am getting a "syntax error on line 8" as printed out on the console:
from urllib2 import urlopen
from json import load
url = "http://api.npr.org/query?apiKey="
key = "API_KEY"
url = url+key
url = url&numResults=3&format=json&id=1001
response = urlopen(url)
json_obj = load(response)
for story in json_obj['list']['story']:
Your suggestions will be very much appreciated