Met Office DataHub
This API allows you to retrieve orders for Atmospheric Model Data otherwise known as ‘Gridded’ data. The API described here contains a definition for all…
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
This API allows you to retrieve orders for Atmospheric Model Data otherwise
known as ‘Gridded’ data. The API described here contains a definition for all
requests as well as examples of how to write your code to interface with our
gateway to retrieve your data.
When you call this API you will need your API key and
can begin by making a call to /1.0.0/orders (this will give you all of your
Order IDs).
API Usage is typically done in 4 Steps
- Call GET /1.0.0/orders - to programmatically get each order's "orderId"
field
- Call GET /1.0.0/orders/{orderId}/latest - to get a list of "fileId"
entries (these represent all the files available for this order)
- Call GET /1.0.0/orders/{orderId}/latest/{fileId} - to get more detailed
information about each file if required
- Call GET /1.0.0/orders/{orderId}/latest/{fileId}/data - with an Accept
header of application/x-grib to get access to a specific GRIB file
There are additional end points to query the runs available:
- Call GET /1.0.0/runs - to get each available run
- Call GET /1.0.0/runs/{modelId} - to get each available run for a
particular model
Using your application, you can go through multiple
orders and then retrieve the files for each.
Please be aware that the files could be delivered by redirecting your
client, so your client should follow any HTTP 302 redirects it gets to allow
it to download the file. Please note the file ID will need to be URL encoded.
This is done in Curl by adding -L or --location (in programming languages,
you will need to visit the new URL to get your file).
If there are any errors or issues, each endpoint will provide an appropriate
HTTP response and may provide a JSON body providing you with further helpful
information, so please do not forget to check for errors.
If you are testing before development or downloading using scripts with a
tool like Curl you can view errors using --verbose. If you do not do this it
could just appear that you are getting "nothing back".
Endpoints 6
- GETList all orders visible to current user.
/ordersThis gets an object detailing the active orders that have been configured using the Atmospheric Weather Data Configuration Tool for your Organsation. - GETProvide a list of the latest available data files for the specified order.
/orders/:orderId/latestProvide a list of available files for the order created in the Atmospheric Weather Data Tool. This contains metadata such as fileId, the runs, the region… - GETProvide the details of a specific file that can be obtained for the latest available data.
/orders/:orderId/latest/:fileIdProvides metadata about a specific fileId. For example you can find out what the file will contain including the surface identifier, the region it covers, the… - GETGets the actual data for a specific file that can be obtained for the latest available data.
/orders/:orderId/latest/:fileId/dataThis endpoint provides the binary file data for a given file ID. Please note that the data will be returned from an alternative URL instead of directly. This… - GETList all runs
/runsTODO - GETList all runs for specific model
/runs/:modelIdTODO
API details
- Base URL
https://datahub.metoffice.gov.uk- Authentication
- An API key in the apikey header
- Operations
- 6 operations on 6 pathsGET 6
- Response formats
application/jsonapplication/x-grib- Description format
- OpenAPI 3.0.1, API version
2.1.0 - Links
- OpenAPI document · Support
How to test the Met Office DataHub in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the Met Office DataHub collection, without the publisher's secrets.
- Add your credentialsThis API uses an API key in the apikey header. Add yours in the collection's variables or an environment; the requests already reference it.
- Send a requestPick an endpoint, for example “List all orders visible to current user.” (GET /orders), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the Met Office DataHub?
This API allows you to retrieve orders for Atmospheric Model Data otherwise known as ‘Gridded’ data. The API described here contains a definition for all… It is listed under Maps & location and has 6 endpoints.
Who publishes the Met Office DataHub?
It is listed from Met Office's public API description (an OpenAPI document), not published by Met Office on Swastik Codes. Anyone who controls metoffice.gov.uk can claim the profile by adding a DNS TXT record.
What is the base URL of the Met Office DataHub?
Requests go to https://datahub.metoffice.gov.uk. Endpoint paths are added to this base URL.
How do I authenticate with the Met Office DataHub?
With an API key in the apikey header.
How many endpoints does the Met Office DataHub have?
6 operations on 6 paths (6 GET).
Is forking the Met Office DataHub free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.