Prerequisites
- You need to have a CDS or ADS account. If you don't have an account, please self register at the CDS registration page or the ADS registration, whichever is appropriate.
- You need Python
- Optional: you are recommended to set up a virtual environment.
Python 3 comes up with this feature. For Python 2, you may want to use Virtualenv. This is out of the scope of this knowledge base article.
Step-by-step guide
- Login to CDS (or Login to ADS)
- Copy a 2 line code, which shows a url and your own uid:API key details as follows:
- For CDS users, Go to this page and copy the 2 line code displayed in the black box in the "Install the CDS API key" section.
- For ADS users, Go to this page and copy the 2 line code displayed in the black box in the "Install the CDS API key" section.
Create your key file in your home directory in your Terminal window as follows:
Code Block |
---|
touch ~/.cdsapirc |
- Edit your key file and paste the two lines you copied in Step 2 above to your .cdsapirc key file.
Install the CDS API client using pip, by running the following command in your Terminal window:
Code Block |
---|
pip install cdsapi |
- Once the CDS API client is installed, it can be used to request data from the datasets listed in the CDS and ADS catalogues. It is necessary to agree to the Terms of Use of every datasets that you intend to download. Attached to each dataset download form, the 'Show API request' button displays the python code to be used.
Info |
---|
If you are getting connection issues, we recommend that in the first instance you check your proxy settings with your local IT team. |
Related articles
Content by Label |
---|
showLabels | false |
---|
max | 5 |
---|
spaces | CKB |
---|
showSpace | false |
---|
sort | modified |
---|
reverse | true |
---|
type | page |
---|
cql | label = "cds" and type = "page" and space = "CKB" |
---|
labels | cds |
---|
|