Gov APImetoffice.gov.uk ↗
Access UK weather forecasts, real-time lightning strikes, storm data, and weather warnings from the Met Office via 9 structured JSON endpoints.
What is the Gov API?
The Met Office API exposes 9 endpoints covering UK weather data from hourly and daily forecasts to real-time lightning strikes and active weather warnings. Start with search_location to resolve any UK place name into a geohash, then pass that geohash to get_hourly_forecast or get_daily_forecast for structured forecast data. Regional narrative forecasts, storm centre information, and bounding-box spot forecasts are also available.
curl -X GET 'https://api.parse.bot/scraper/f3476396-f4c9-4c00-8861-ee4d7559ab32/search_location?query=London' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace metoffice-gov-uk-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""
UK Met Office Weather API - Usage Example
Get your API key from: https://parse.bot/settings
"""
from parse_apis.uk_met_office_weather_api import MetOffice, Region, ForecastLayer
metoffice = MetOffice()
# Search for a location
for location in metoffice.locations.search(query="London"):
print(location.name, location.geohash, location.area, location.domestic)
break
# Get the daily forecast for London
daily = metoffice.dailyforecasts.get(geohash="gcpvj0v07")
print(daily.current_conditions.temperature, daily.current_conditions.feels_like)
for day in daily.daily_forecast:
print(day.date, day.weather_condition, day.high_temp, day.low_temp)
# Get the hourly forecast
hourly = metoffice.hourlyforecasts.get(geohash="gcpvj0v07")
for hour in hourly.hourly_forecast:
print(hour.time, hour.weather_condition, hour.temperature)
# Get the regional forecast using the Region enum
regional = metoffice.regionalforecasts.get(region=Region.SOUTH_EAST)
for section in regional.sections:
print(section.title, section.content)
# Get spot forecast with ForecastLayer enum
spot = metoffice.spotforecasts.get(layers=ForecastLayer.TEMPERATURE)
for point in spot.spotdata:
print(point.name, point.lat, point.lng)
# Get lightning strike data
lightning = metoffice.lightningdatas.get()
print(lightning.last_update)
for strike in lightning.lightning_strikes:
print(strike.strike_time, strike.coordinates)
Search for UK locations by name to retrieve their unique geohash codes, which are required for forecast endpoints. Returns up to 10 matching locations with their geohash, coordinates, area, and type.
| Param | Type | Description |
|---|---|---|
| queryrequired | string | Location name to search for (e.g. 'London', 'Manchester', 'Edinburgh'). |
{
"type": "object",
"fields": {
"results": "array of location objects with name, area, geohash, type, domestic, and latLong"
},
"sample": {
"data": {
"results": [
{
"area": "Greater London",
"name": "London",
"path": null,
"type": "Residential",
"geohash": "gcpvj0v07",
"latLong": [
51.508,
-0.125
],
"domestic": true,
"nearestGeohash": "gcpvj0v07"
}
]
},
"status": "success"
}
}About the Gov API
Location Resolution and Forecasts
All location-based forecast endpoints require a geohash identifier. Use search_location with a query string (e.g. 'Edinburgh') to retrieve matching locations; each result includes name, area, geohash, latLong, and a domestic boolean indicating UK coverage. Pass the geohash to get_daily_forecast for a 7-day outlook — each day returns date, weather_condition, high_temp, and low_temp, plus a current_conditions object with temperature, feels_like, rain_chance, and wind_gust. For sub-daily detail, get_hourly_forecast accepts the same geohash plus an optional date parameter (ISO YYYY-MM-DD); each hourly entry can include time, weather_condition, temperature, feels_like, precip_chance, and wind_speed.
Regional and National Forecasts
get_uk_regional_forecast takes a region code (e.g. 'se' for South East England, 'nw' for North West England) and returns an array of sections, each with a title and content string covering current conditions, short-term outlook, and longer-range narrative. For the UK-wide picture, get_uk_long_range_forecast needs no inputs and returns a national_forecast array of titled sections spanning a multi-week outlook.
Warnings, Storms, and Lightning
get_uk_weather_warnings returns an active_warnings array — the array is empty when no warnings are in force, and the response includes a status string in that case. get_uk_storm_centre returns sections with storm naming conventions and history, plus a storm_info array of descriptive strings about the current season. get_lightning_data delivers real-time strike coordinates as an array of objects with strike_time (ISO timestamp) and [longitude, latitude] coordinates, an intensity grid mapping cells to strike counts, and a last_update timestamp.
Spot Forecasts Over a Geographic Area
get_spot_forecast accepts a bbox string in minLon,minLat,maxLon,maxLat format, a zoom integer, and a layers string ('symbol', 'temperature', or 'wind'). It returns a spotdata array of named location objects with lat, lng, name, and layer-specific forecast values, alongside time_steps (unix timestamps with offsets) and a refreshed_epoch indicating when the data was last updated.
The Gov API is a managed, monitored endpoint for metoffice.gov.uk — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when metoffice.gov.uk changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official metoffice.gov.uk API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Display a 7-day UK weather widget using
high_temp,low_temp, andweather_conditionfromget_daily_forecast. - Plot real-time lightning strikes on a map using
coordinatesandstrike_timefields fromget_lightning_data. - Alert users to active Met Office weather warnings by polling
get_uk_weather_warningsfor a non-emptyactive_warningsarray. - Build a UK route-planning tool that queries
get_hourly_forecastfor each waypoint using resolved geohashes. - Render temperature or wind overlays on a map tile viewer using
get_spot_forecastwith a dynamicbboxandzoomlevel. - Summarise regional weather conditions in a dashboard by fetching narrative text from
get_uk_regional_forecastfor multipleregioncodes. - Track storm season activity and named storms by parsing
sectionsandstorm_infofromget_uk_storm_centre.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does the Met Office have an official developer API?+
What does `get_lightning_data` return and how current is it?+
get_lightning_data returns a lightning_strikes array where each object has a strike_time ISO timestamp and a two-element [longitude, latitude] coordinate. It also includes an intensity grid (strike counts per cell per time interval) and a last_update timestamp. Data freshness is tied to the last_update field in the response; there is no configurable time-window parameter on this endpoint.Which UK regions are supported by `get_uk_regional_forecast`?+
'se' (South East England), 'nw' (North West England), and 'ne' (North East England), among others listed in the endpoint spec. Coverage is limited to defined Met Office UK regional boundaries. If a specific region code you need is not in the accepted list, you can fork this API on Parse and revise it to add the missing region.Does the API return historical weather data or past observations?+
Can `get_spot_forecast` return data outside the UK?+
bbox parameter accepts any minLon,minLat,maxLon,maxLat bounding box, but the underlying data is sourced from the Met Office, whose forecast coverage is focused on the UK. Spot data for locations outside UK coverage will likely return an empty or incomplete spotdata array. The domestic boolean on search_location results is a useful proxy for whether a location falls within covered territory.