Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


The Web API provides a way to access ECMWF's data archives in batch from outside ECMWF (users working at ECMWF or through ecgate should use their normal local MARS access). See A brief guide to the See ECMWF Web API Home for more information, including how to set up the service by installing an ECMWF key. Metview versions from 4.4.3 onwards have support for this service (but version 4.4.7 is recommended). See the Releases page for download.


First, ensure that you have access to this service by following the steps in the page linked to above Access ECMWF Public Datasets. Ensure that you have set up your ~/.ecmwfapirc key and that you are registered for the datasets you wish to access. If you can retrieve some data using a sample script provided there, then you are 90% of the way to accessing the service from within Metview. It is not required to install the Python client libraries, but it can help with testing the service before trying it with Metview.

Second, ensure that your Metview installation was built with Mars Web Access enabled. When configuring with CMake (Metview version 4.5.x), Mars Web Access will be automatically enabled if the curl development library is found on the system. When configuring with autotools (Metview version 4.4.x), the option is --enable-mars-web-access and is enabled by default. The only reason for disabling this option is if your system does not have the curl development library (libcurl) installed.


It is beyond the scope of the Metview documentation to give detailed assistance on formulating MARS requests. Please see the MARS Web API page: A guide for new users Brief request syntax. However, here are some examples to help get things started.

Users who have started Metview for the first time with version 4.4.x onwards should already have some example icons and a macro in their Getting Started folder. The icons are also available for separate download - untar these into a Metview folder to start exploring them.

Note that in Metview versions prior to 4.5.5, it was necessary to add an additional parameter to the request:

Code Block
 DATABASE = Data Server

This is no longer necessary, as Metview will automatically use the Web API if no local MARS connection is available.

Example retrieval for TIGGE data (icon parameters)


Code Block
  DATASET = tigge,
  TYPE = PF,
  DATE = 20071001,
  STEP = 12,
  GRID = 1.5/1.5,
  DATABASE = Data Server

Example retrieval for core archive data (icon parameters)

Code Block
    PARAM      = T,
    DATE       = -2,
    GRID       = 1/1,
    DATABASE   = Web API

Example retrieval for ERA Interim data (Macro language code)


Code Block
# Metview Macro

#  **************************** LICENSE START ***********************************
#  Copyright 2014 ECMWF. This software is distributed under the terms
#  of the Apache License version 2.0. In applying this license, ECMWF does not
#  waive the privileges and immunities granted to it by virtue of its status as
#  an Intergovernmental Organization or submit itself to any jurisdiction.
#  ***************************** LICENSE END ************************************

data = retrieve
    dataset  : "interim",
    class    : "ei",
    type     : "fc",
    levtype  : "sfc",
    param    : 235,
    date     : 20130501,
    step     : 12,
    grid     : [1.5,1.5],
    database : "Data Server"


Creating a Mars Retrieval icon