![]() |
VOOZH | about |
The OpenWeatherMap is a service that provides weather data, including current weather data, forecasts, and historical data to the developers of web services and mobile applications.
It provides an API with JSON, XML, and HTML endpoints and a limited free usage tier. Making more than 60 calls per minute requires a paid subscription starting at USD 40 per month. Access to historical data requires a subscription starting at 150 USD per month. Users can request current weather information, extended forecasts, and graphical maps (showing cloud cover, wind speed, pressure, and precipitation).
You can follow theWeather Forecast Projectto create your own weather application using Weather API using HTML, CSS and JavaScript.
To use this current weather data API, one must need the API key, which can be get from here.
Note: User need to create an account on openweathermap.org then only can use the APIs.
- requests
- json
Output :
Enter city name : Delhi
Temperature (in kelvin unit) = 312.15
atmospheric pressure (in hPa unit) = 996
humidity (in percentage) = 40
description = haze
Sample Input:
Mahoba
Sample Output:
Enter the Name of City -> Mahoba
Searching...Mahoba, Uttar Pradesh
Monday, 12:00 am
Cloudy
27°C
Have a Nice Day:)
Explanation:
Here in the second approach, we will use some of the following modules and functions as listed below,
pip install beautifulsoup