This forum is now read-only. Please use our new forums! Go to forums
"Did you create a query string parameter for format ?"
I don’t understand what is wrong for 1.4, I’ve done everything it says and compared my code against the code for 1.1 and can’t see any difference at all. Am I missing something?
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'
I tried separating the concat like so:
url+='&numResults=3'
url+='&format=json'
I also tried clearing cache.
I am out of ideas :(
Answer 5135ded507bbf032400035e8
Answer 513350e7dd51efe03b005f60
1 vote
For me this worked perfectly:
from urllib2 import urlopen
from json import load
url = "http://api.npr.org/query?apiKey="
key = "API_KEY"
url += key
url += "&numResults=3&format=json"
1 comments
Aezakmi over 10 years
I have the same code but it doesn’t work…
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
1 comments
I hadn’t, I was busy learning Django and forgot about this track, thanks for your answer!