29 location_url = f
"{geo_url}/v1/search?name={quote_plus(query)}"
31 resp = get(location_url)
32 if resp.status_code != 200:
35 json_locations = resp.json().get(
"results", [])
36 if len(json_locations) == 0:
39 location = json_locations[0]
41 'latitude': location[
'latitude'],
42 'longitude': location[
'longitude'],
43 'timeformat':
'unixtime',
45 'current': data_of_interest,
47 'hourly': data_of_interest,
50 params[
'url'] = f
"{api_url}/v1/forecast?{urlencode(args)}"