Posted on Sat, 08 Jun 2019 by Jean JacqueAdmin Answered
I can't retrieve the fields according to their type (see my example below). I always get the following message: "KeyError: 'ozone"
I have never encountered this problem with other APIs of this type. It is a real pity that your documentation is not more provided as examples.
Could you tell me what's wrong or give me an example?
app_id = 'MYAPI' city_name = 'Raleigh' country_code = 'NC' api_call = 'http://api.weatherbit.io/v2.0/forecast/hourly?city=' + city_name + ',' + country_code + '&key=' + app_id + '&lang=en&hours=48' r = requests.get(api_call) data = r.json() print(data['ozone'])