OpenWeatherMap - free weather data and forecast API
http://openweathermap.org/
OpenWeatherMap is a free service that provides weather data and a forecast API that can be used with any mapping services. Data includes current weather, weekly forecast, wind, clouds, precipitation, and more.
The OpenWeatherMap service provides free weather data and forecast API suitable for any cartographic services like web and smartphones applications. Ideology is inspired by OpenStreetMap and Wikipedia that make information free and available for everybody. OpenWeatherMap provides wide range of weather data such as map with current weather, week forecast, precipitation, wind, clouds, data from weather stations and many others. Weather data is recieved from global meterological broadcast services and more than 40 000 weather stations.
Getting current weather data
Using this kind of requests you can get weather data in any location on the earth. The current weather data are updated online based on data from more than 40,000 weather stations. All weather data can be obtained in JSON, XML or HTML format.
You can search weather data by different ways:
- By city name
- By geographic coordinats
- By city ID
Examples of JSON format:
Examples of XML format:
To get data in XML or HTML formats you need to use mode = xml or html. Example:
Data format:
You can use different types of metric systems by units = metric or imperial
Example: api.openweathermap.org/data/2.5/weather?q=London&mode=xml&units=metric
Multilingual support:
You can use lang parameter to get output in your language. We support the following languages that you can use with the corresponded lang values: English - en, Russian - ru, Italian - it, Spanish - sp, Ukrainian - ua, German - de, Portuguese - pt, Romanian - ro, Polish - pl, Finnish - fi, Dutch - nl, French - fr, Bulgarian - bg, Swedish - se, Chinese Traditional - zh_tw, Chinese Simplified - zh_cn, Turkish - tr
Example: http://api.openweathermap.org/data/2.5/forecast/daily?id=524901&lang=zh_cn
Call back function for JavaScript code:
To use JavaScrip code you can transfer callback functionName to JSONP callback.
Example: api.openweathermap.org/data/2.5/weather?q=London,uk&callback=test
More about data returned:
You can recieve weather forecast in any location on the earth. The flexible algorithm of weather calculation let us provide weather data not only for cities but for any geographic coordinates. It is important for megapolices, for example, where weather is different on opposit city edges. You can get forecast data every 3 hours or daily. The 3 hours forecast is available for 5 days. Daily forecast is available for 14 days. All weather data can be obtained in JSON or XML format.
You can search weather data by different ways:
- By city name
- By geographic coordinats
- By city ID
Getting forecast data every 3 hours
Getting daily forecast weather data
You can get weather forecast for 14 days. All weather data can be obtained in JSON or XML format.
Examples:
You can search weather data by different ways:
- By city name. Put the city name or its part and get the list of the most proper cities in the world. Example - Lon or Lond or London. The more precise city name you put the more precise list you will get. To make it more precise put the city's name or its part, comma, the name of the county or 2-letter country code. You will get all proper cities in chosen county. The order is important - the first is city name than comma than county. Example - Lon, UK or Lon, GB or London, GB or Lon, England.
- By geographic coordinats.
Seaching by city name
api.openweathermap.org/data/2.5/find?q=London&units=metric&mode=xml
Seaching by geographic coordinats
api.openweathermap.org/data/2.5/find?lat=57&lon=-2.15
Data output format:
Restriction output:
To limit number of listed cities please setup cnt parameter api.openweathermap.org/data/2.5/find?lat=57&lon=-2.15&cnt=3
Accuracy:
To setup accuracy level please use type parameter that have two values - accurate and like. In case of accurate value you will get results that exactly equivalent to your searching word. In case of like value the result is searching by substring. type ['accurate', 'like']
Example
Metric systems: