Home > api > weather information

weather information

Problem
You need a free weather API.

Solution
Use http://openweathermap.org. See the API description here.

Example:

http://api.openweathermap.org/data/2.5/weather?q=budapest&appid=44db6a862fba0b067b1930da0d769e98&units=metric

Sample output:

{
	"coord": {
		"lon": 19.04,
		"lat": 47.5
	},
	"weather": [
		{
			"id": 600,
			"main": "Snow",
			"description": "light snow",
			"icon": "13n"
		},
		{
			"id": 701,
			"main": "Mist",
			"description": "mist",
			"icon": "50n"
		}
	],
	"base": "cmc stations",
	"main": {
		"temp": -4,
		"pressure": 1034,
		"humidity": 85,
		"temp_min": -4,
		"temp_max": -4
	},
	"wind": {
		"speed": 2.1,
		"deg": 100
	},
	"clouds": {
		"all": 90
	},
	"dt": 1453579200,
	"sys": {
		"type": 1,
		"id": 5724,
		"message": 0.0092,
		"country": "HU",
		"sunrise": 1453530015,
		"sunset": 1453563103
	},
	"id": 3054643,
	"name": "Budapest",
	"cod": 200
}

As can be seen, the temperature in this city is -4 Celsius.

Categories: api Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: