This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by James Nelson
about 11 years

1.3 npr API story

can’t figure out how to do 1.3 of the npr story API. this is what i have:

urllib2(urlopen) json(load) url = “http://api.npr.org/query?apiKey=“ key = “API_KEY” url += key

not sure what i’m doing wrong.

Answer 5111567592232bf84e000851

2 votes

Permalink

Hi James,

Your syntax for importing modules is incorrect. It should be in the format:

from module_name import function

Thanks

points
Submitted by Javaun Moradi
about 11 years

Answer 5160c2f7563c2668e10025e9

1 vote

Permalink

should be: from urllib2 import urlopen from json import load url = “http://api.npr.org/query?apiKey=“ key = “API_KEY” url += key

points
Submitted by Nick Zink
almost 11 years

Answer 510fc323f72679af810039a5

0 votes

Permalink

url = “http://api.npr.org/query?apiKey=“ key = “API_KEY”

url = url + key

points
Submitted by Reto
about 11 years