---
# System prepended metadata

title: Weather API

---

# Weather API

API stands for **application program interface** You need to develop a program which sends a request to [OpenWeatherMap API](https://openweathermap.org/api) to get the waether of a particular region using **ZIP code** and **country code**.
You then need to extract the following information from the JSON output:
**Name, Temp, Pressure, Humidity** 
USE THE API KEY - `ad08215b3cedb867a884dbd27e115784`
You can use any scripting language of your choice. Any API library of your choice can be used, preferably Requests.


## Documentations

**API Documentation** [https://openweathermap.org/api](https://openweathermap.org/api)
**RequestsLib** [https://realpython.com/python-requests/](https://realpython.com/python-requests/)


## Example Inputs

`Enter Zip Code:` 95050
`Enter Country Code:` US

## Example Output

### Sample JSON
> {"coord":{"lon":-121.95,"lat":37.35},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"base":"stations","main":{"temp":287.31,"pressure":1016,"humidity":67,"temp_min":284.26,"temp_max":290.37},"visibility":16093,"wind":{"speed":2.6,"deg":300},"clouds":{"all":5},"dt":1571108630,"sys":{"type":1,"id":5903,"message":0.0124,"country":"US","sunrise":1571062472,"sunset":1571103165},"timezone":-25200,"id":0,"name":"Santa Clara","cod":200}

### Sample Info taken out from JSON
`Name: Santa Clara`
`Temp: 287.31`
`Pressure: 1016`
`Humidity: 67`

## Hints

**API Key** Use the API key `ad08215b3cedb867a884dbd27e115784` while calling requests
eg- http://api.openweathermap.org/data/2.5/weather?zip=95050,us&APPID=ad08215b3cedb867a884dbd27e115784
Here, 95050 is the zip code, us is the country code and ad08215b3cedb867a884dbd27e115784 is the API key.

Get an API key.
Try pasting the API call URL in a browser to get familiar with the API.
Print the JSON response to get familiar with the structure.
Extract information from JSON.