OpenWeatherMap - free weather data and forecast API
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:
- Seaching by city name api.openweathermap.org/data/2.5/weather?q=London,uk
- Seaching by geographic coordinats api.openweathermap.org/data/2.5/weather?lat=35&lon=139
- Seaching by city ID api.openweathermap.org/data/2.5/weather?id=2172797
Examples of XML format:
To get data in XML or HTML formats you need to use mode = xml or html. Example:
- Seaching by city name in XML api.openweathermap.org/data/2.5/weather?q=London&mode=xml
- Seaching by geographic coordinats in HTML api.openweathermap.org/data/2.5/weather?lat=35&lon=139&mode=html
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:
Getting forecast weather data
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
- Seaching by city name at XML format api.openweathermap.org/data/2.5/forecast?q=London,us&mode=xml
- Seaching by geographic coordinats at JSON format api.openweathermap.org/data/2.5/forecast?lat=35&lon=139
- Seaching by city ID api.openweathermap.org/data/2.5/forecast?id=524901
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:
- Seaching 7 days forecast by city name at XML format and metric units
api.openweathermap.org/data/2.5/forecast/daily?q=London&mode=xml&units=metric&cnt=7 - Seaching 10 days forecast by geographic coordinats at JSON format
api.openweathermap.org/data/2.5/forecast/daily?lat=35&lon=139&cnt=10&mode=json - Seaching by city ID
api.openweathermap.org/data/2.5/forecast/daily?id=524901
Searching of city
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:
- json api.openweathermap.org/data/2.5/find?q=London&mode=json
- xml api.openweathermap.org/data/2.5/find?q=London&mode=xml
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
- Like api.openweathermap.org/data/2.5/find?q=London&type=like&mode=xml
- Accurate api.openweathermap.org/data/2.5/find?q=London&type=accurate&mode=xml
Metric systems:
- internal api.openweathermap.org/data/2.5/find?q=London
- metric api.openweathermap.org/data/2.5/find?q=London&units=metric
- imperial api.openweathermap.org/data/2.5/find?q=London&units=imperial
More detailed information about features of API
- More detailed infomration about features of API bugs.openweathermap.org/projects/api/wiki/
- For web developers - examples and code
- The protocol of weather station data transmission
- How to create charts with weather data
- How to create weather widgets
- How to create maps with weather data
- Mobile version of site
'프로그래밍' 카테고리의 다른 글
[EDITOR] Sublime 2.0.2 Update (0) | 2013.07.10 |
---|---|
컬쳐랜드 오류에 대해서... (0) | 2013.06.20 |
SSO(Single Sign On) (0) | 2013.06.14 |
drupal - 드루팔 (0) | 2013.06.11 |
문자메시지 피싱(SMS phising, 스미싱) (0) | 2013.06.10 |