The UKCP Application Programming Interface (API)

Going beyond the GUI: the web API

One way of making web-functionality available is to create a graphical user interface (GUI). This allows a user with a web browser to click through pages and forms in order to make requests to a service. For a tool such as UKCP, with potentially millions of outputs, the GUI approach becomes limiting when the user wants to request a large number of outputs. Equally, if the user might wish to automate requests to the service - which is very hard to achieve through a web browser.

Introduction the web API approach

An alternative interface to the web GUI is the Application Programming Interface (API). This provides a "programmatic" interface rather than a visual interface. An API can be called by a remote computer, opening up the possibility of applications, models and programmes talking to it directly.

You might consider using the web API if:
  • you need to make a large number of requests (such as requesting and output for every location and every variable)
  • you are running a computer model that requires UKCP data as an input
  • you are building an application that needs dynamic access to UKCP data/plots

Ready to get started

For more information see our API Getting Started page.

Your API key

Your home page shows the API key attached to your account. You will need to add it to each URL when you make requests directly to the WPS API.

What does the API look like?

The easiest way to demonstrate the API is to give an example. All you need to do is build a URL with the appropriate components to define your request. Note that every time you complete a WPS request through the web GUI you are shown the URL that can be used to regenerate that request. In fact, you can even select that request and paste it into your browser in order to re-run it (provided you are logged in).

Here is an example request URL, some white space has been added to make it more legible:

							https://ukclimateprojections-ui.metoffice.gov.uk/wps/Execute?
    Request=Execute&
    Identifier=LS1_CDF_PDF_01&
    Format=text/xml&
    Inform=true&
    Store=false&
    Status=false&
    DataInputs=
        Area=point|245333.38|778933.24;
        Baseline=b8100;
        Collection=land-prob;
        ColourMode=c;
        DataFormat=csv;
        FontSize=m;
        ImageFormat=png;
        ImageSize=1200;
        LegendPosition=7;
        PlotType=PDF_PLOT;
        Scenario=sres-a1b;
        TemporalAverage=jul;
        TimeSlice=2050-2069;
        TimeSliceDuration=20y;
        Variable=tasAnom;
        &ApiKey=<YOUR_API_KEY>