Files
pagina-de-incio-universidad/home/services/weather.py

14 lines
257 B
Python

import requests
url = "https://api.openweathermap.org/data/2.5/weather/"
def get(city, key):
data = {
'q': city,
'appid': key,
'units': 'metric',
}
response = requests.get(url, params=data)
return response.json()