API

MetaWeather provides an API that delivers JSON over HTTPS for access to our data.

Drop me an email if you're going to make more than maybe a request a minute to this. We also ask that you link back to MetaWeather.com where appropriate, in a sensible way that's useful to the user.


Weather States

Name Abbreviation Icon
Snow sn Snow
Sleet sl Sleet
Hail h Hail
Thunderstorm t Thunderstorm
Heavy Rain hr Heavy Rain
Light Rain lr Light Rain
Showers s Showers
Heavy Cloud hc Heavy Cloud
Light Cloud lc Light Cloud
Clear c Clear

Icons

Feel free to hotlink these images. Replace "X" in the table below with the weather state abbreviation.

Type URL Example
SVG (preferred) /static/img/weather/X.svg Showers
ICO /static/img/weather/ico/X.ico Showers
PNG (600x600 px) /static/img/weather/png/X.png Showers
PNG (64x64 px) /static/img/weather/png/64/X.png Showers

Methods

Location Search
Find a location
Location
Location information, and a 5 day forecast
Location Day
Source information and forecast history for a particular day & location

Location Search

URL

/api/location/search/?query=(query) /api/location/search/?lattlong=(latt),(long)

Arguments

Either query or lattlong need to be present.

query
Text to search for.
lattlong
Coordinates to search for locations near. Comma separated lattitude and longitude e.g. "36.96,-122.02".

Examples

Response Fields

Field Type Unit Description
title string Name of the location
location_type string (City|Region / State / Province|Country|Continent)
latt_long floats, comma separated
woeid integer Where On Earth ID

Location

URL

/api/location/(woeid)/

Arguments

woeid
Where On Earth ID. Docs.

Examples

Response Fields

Field Type Unit Description
title string Name of the location
location_type string (City|Region / State / Province|Country|Continent)
latt_long floats, comma separated
time datetime Time in location
sun_(rise|set) datetime
timezone_name string Name of the timezone that the location is in
parent
title string Name of the parent location
location_type string (City|Region / State / Province|Country|Continent)
latt_long floats, comma separated
woeid integer Where On Earth ID
consolidated_weather
id integer Internal identifier for the forecast
applicable_date date Date that the forecast or observation pertains to
weather_state_name string Text description of the weather state
weather_state_abbr string One or two letter abbreviation of the weather state
wind_speed float mph
wind_direction float degrees
wind_direction_compass string compass point Compass point of the wind direction
(min|max|the)_temp integer centigrade
air_pressure float mbar
humidity float percentage
visibility float miles
predictability integer percentage Our interpretation of the level to which the forecasters agree with each other - 100% being a complete consensus.
sources
title string Name of the source
url string URL of the source

Location Day

URL

/api/location/(woeid)/(date)/

Arguments

woeid
Where On Earth ID. Docs.
date
Date in the format yyyy/mm/dd. Most location have data from early 2013 to 5-10 days in the future.

Examples

Response Fields

Returns a date ordered list of fields as described in the consolidated_weather section of the location method.