National and regional text forecast tutorial
Basic tutorials showing how the UK national and regional forecast data feeds can be used to retrieve data.
Introduction
The regional forecast data feeds provide access to regional script forecasts for a number of regions across the UK, giving detailed forecasts for the day the forecasts were issued and the following day, and describing the general outlook for the following days. The data feeds are routinely updated twice daily, in the morning and afternoon, normally early morning and early afternoon, and are sometimes updated more frequently.
Tutorials
The regional forecast data feeds can be accessed via web services or via the JavaScript API. Here we describe how to access forecasts for a single region using both of these methods.
You would like to access forecasts for a given region
Via the web services
- Call the regional forecast site list web service to find the id of the region you would like a forecast for
- Call the regional forecast capabilities web service to check whether the data has been updated since it was last requested
- If so call the regional forecasts web service, specifying the id of the relevant region, to retrieve the new data in either XML or JSON format
Via the JavaScript API *
- Call the metoffice.forecast.region.getLocations method to find the id of the location you would like to see observations for
- Call the metoffice.forecast.region.getById method to retrieve the regional forecast for the relevant region
* Note that users of the JavaScript API do not have to call the capabilities method to check whether the data has been updated since it was last requested, as the API does this automatically.