Versions Compared

Key

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

...

  • Overview tab. This gives a description of the selected dataset and metadata information (e.g. spatial details, file format, variables, etc).
  • Documentation tab. This provides links to detailed documentation about the dataset.
  • Download data tab. This is a Download data web form. Using this web interface, you can:
    • make selections as per your requirements
    • submit your request online (you will need to login if not already logged in)  
      (warning) Tip: . Upon submitting the download form, you will be prompted to accept the data licence (if you have not yet accepted it)!
    • display the API script which corresponds to your selection, by clicking on the "Show API request" button. We strongly suggest to use this feature to build your CDS API request.
Note

Please note that whether you are downloading the data through the web interface or through the CDS API, you must accept the data licence

...

.

At this stage, you can test that CDS API is working for you simply by using the basic API request script generated by the ADS Download data web form. Copy this script to a file on your local system and run it using the version of python you installed the CDS API into.

Note

Please don't use your CDS userID and key in your ADS .cdsapirc file. 

If you have more than one CDS API key and therefore have to pass credentials in explicitly (see above) you can use the following method:

Code Block
languagepy
    import cdsapi
    import yaml

    with open('/path/to/ads/cdsapirc', 'r') as f:
            credentials = yaml.safe_load(f)

    c = cdsapi.Client(url=credentials['url'], key=credentials['key'])

    c.retrieve("dataset-short-name", 
               {... sub-selection request ...}, 
               "target-file")

If you are encountering difficulties retrieving the data using your basic API script, please have a look at the following page: Common Error Messages for CDS API Requests or contact the User Support with a copy of your API script and any error messages that you may have received.

...