HTTPError: 404 Client Error: Not Found for url

Hi, I am trying to use the following code for download cams data:

#!/usr/bin/python3.9

import cdsapi

dataset = "cams-europe-air-quality-forecasts"
request = {
    "variable": [
        "particulate_matter_10um",
    ],
    "model": ["ensemble"],
    "level": ["0"],
    "date": ["2024-10-15/2024-10-15"],
    "type": ["forecast"],
    "time": ["00:00"],
    "leadtime_hour": [
         "0",
         "1",
         "2",
    ],
    "data_format": "netcdf_zip"
}
target = 'trial_output.ncdf'

client = cdsapi.Client()
client.retrieve(dataset, request, target)

My ~/.cdsapirc file is following (key corresponds to the one displayed at Climate Data Store after logging):

url: https://cds.climate.copernicus.eu/api
key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

When running the script from commandline, I recieve this error:

...
File "/usr/local/lib/python3.9/site-packages/cads_api_client/processing.py", line 86, in cads_raise_for_status
    raise requests.HTTPError(message, response=response)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://cds.climate.copernicus.eu/api/retrieve/v1/jobs/job_id?log=True&request=True
job not found
job job_id not found

However, I can see under my CAMS account that the request with corresponding job_id (e.g. c5dfc58e-7319-4c57-9be6-822e95552c29) was created and available for download a bit later. How can I make cdsapi to wait with download until the request is fulfilled?

Hi, you are requesting a dataset which is on the ADS, but you are using your CDS credentials in the .cdsapirc file, so the dataset is ‘not found’.
They are separate systems, so you need to use your ADS details from Atmosphere Data Store in your .cdsapirc file in this case.

( Its also a good idea to try a small download from the ADS web interface beforehand to make sure you have agreed to the relevant licences )

Thank you Kevin. I set correct url in ~/.cdsapirc (https://ads.atmosphere.copernicus.eu/api) and now it works.

1 Like