This can be used in any application with minimum lines of code. I guess this is the best Weather API you will find on the internet. Easy to use and Opensource.
To get API Key
- Go to Open Weather
- Sign in / Sign up to your account
- Go to API Key Page
- Give your API Key a name, and click generate.
import requests
api_address='http://api.openweathermap.org/data/2.5/weather?appid=YOUR_API_KEY&q='
city = input('City Name :')
url = api_address + city
json_data = requests.get(url).json()
print(json_data)
formatted_data = json_data['weather'][0]['main']
print(formatted_data)
Top comments (0)