Hello !
With the help of @Koen_Hufkens and by activating the debug when using the python package cdsapi
I was able to find the exact URL to call but I got 500 internal server error response. Here is all I found if it can help someone :
Python script with debug activated
import cdsapi
dataset = "cams-europe-air-quality-forecasts-optimised-at-observation-sites"
request = {
'variable': ['particulate_matter_10um', 'particulate_matter_2.5um'],
'country': ['france'],
'type': ['mos_optimised'],
'leadtime_hour': ['0-23'],
'year': ['2024'],
'month': ['01'],
'day': ['18']
}
client = cdsapi.Client(debug=True)
client.retrieve(dataset, request).download()
Result in logs to see the URL working
2024-08-29 14:01:20,750 DEBUG CDSAPI {'url': 'http://ads-beta.atmosphere.copernicus.eu/api', 'key': '<YOUR-TOKEN>, 'quiet': False, 'timeout': 60, 'sleep_max': 120, 'retry_max': 500}
2024-08-29 14:01:20,750 DEBUG POST http://ads-beta.atmosphere.copernicus.eu/api/retrieve/v1/processes/cams-europe-air-quality-forecasts-optimised-at-observation-sites/execute {'variable': ['particulate_matter_10um', 'particulate_matter_2.5um'], 'country': ['france'], 'type': ['mos_optimised'], 'leadtime_hour': ['0-23'], 'year': ['2024'], 'month': ['01'], 'day': ['18']}
2024-08-29 14:01:21,275 DEBUG REPLY {"processID":"cams-europe-air-quality-forecasts-optimised-at-observation-sites","type":"process","jobID":"e3633244-04b3-40c7-9fb0-5843912877ce","status":"accepted","created":"2024-08-29T12:01:21.258084","updated":"2024-08-29T12:01:21.258084","links":[{"href":"https://ads-beta.atmosphere.copernicus.eu/api/retrieve/v1/processes/cams-europe-air-quality-forecasts-optimised-at-observation-sites/execute","rel":"self"},{"href":"https://ads-beta.atmosphere.copernicus.eu/api/retrieve/v1/jobs/e3633244-04b3-40c7-9fb0-5843912877ce","rel":"monitor","type":"application/json","title":"job status info"}],"metadata":{"datasetMetadata":{"messages":[]}}}
2024-08-29 14:01:21,275 INFO Request ID is e3633244-04b3-40c7-9fb0-5843912877ce
2024-08-29 14:01:21,275 DEBUG GET https://ads-beta.atmosphere.copernicus.eu/api/retrieve/v1/jobs/e3633244-04b3-40c7-9fb0-5843912877ce
2024-08-29 14:01:21,341 DEBUG REPLY {"processID":"cams-europe-air-quality-forecasts-optimised-at-observation-sites","type":"process","jobID":"e3633244-04b3-40c7-9fb0-5843912877ce","status":"accepted","created":"2024-08-29T12:01:21.258084","updated":"2024-08-29T12:01:21.258084","links":[{"href":"https://ads-beta.atmosphere.copernicus.eu/api/retrieve/v1/jobs/e3633244-04b3-40c7-9fb0-5843912877ce","rel":"self","type":"application/json"}],"metadata":{"log":[]}}
2024-08-29 14:01:21,342 INFO status has been updated to accepted
2024-08-29 14:01:21,342 DEBUG result not ready, waiting for 1.5 seconds
2024-08-29 14:01:22,843 DEBUG GET https://ads-beta.atmosphere.copernicus.eu/api/retrieve/v1/jobs/e3633244-04b3-40c7-9fb0-5843912877ce
2024-08-29 14:01:22,913 DEBUG REPLY {"processID":"cams-europe-air-quality-forecasts-optimised-at-observation-sites","type":"process","jobID":"e3633244-04b3-40c7-9fb0-5843912877ce","status":"successful","created":"2024-08-29T12:01:21.258084","started":"2024-08-29T12:01:21.873506","finished":"2024-08-29T12:01:22.658882","updated":"2024-08-29T12:01:22.658882","links":[{"href":"https://ads-beta.atmosphere.copernicus.eu/api/retrieve/v1/jobs/e3633244-04b3-40c7-9fb0-5843912877ce","rel":"self","type":"application/json"},{"href":"https://ads-beta.atmosphere.copernicus.eu/api/retrieve/v1/jobs/e3633244-04b3-40c7-9fb0-5843912877ce/results","rel":"results"}],"metadata":{"log":[]}}
2024-08-29 14:01:22,913 INFO status has been updated to successful
2024-08-29 14:01:22,913 DEBUG GET https://ads-beta.atmosphere.copernicus.eu/api/retrieve/v1/jobs/e3633244-04b3-40c7-9fb0-5843912877ce
2024-08-29 14:01:22,999 DEBUG REPLY {"processID":"cams-europe-air-quality-forecasts-optimised-at-observation-sites","type":"process","jobID":"e3633244-04b3-40c7-9fb0-5843912877ce","status":"successful","created":"2024-08-29T12:01:21.258084","started":"2024-08-29T12:01:21.873506","finished":"2024-08-29T12:01:22.658882","updated":"2024-08-29T12:01:22.658882","links":[{"href":"https://ads-beta.atmosphere.copernicus.eu/api/retrieve/v1/jobs/e3633244-04b3-40c7-9fb0-5843912877ce","rel":"self","type":"application/json"},{"href":"https://ads-beta.atmosphere.copernicus.eu/api/retrieve/v1/jobs/e3633244-04b3-40c7-9fb0-5843912877ce/results","rel":"results"}],"metadata":{"log":[]}}
2024-08-29 14:01:23,000 DEBUG GET https://ads-beta.atmosphere.copernicus.eu/api/retrieve/v1/jobs/e3633244-04b3-40c7-9fb0-5843912877ce
2024-08-29 14:01:23,087 DEBUG REPLY {"processID":"cams-europe-air-quality-forecasts-optimised-at-observation-sites","type":"process","jobID":"e3633244-04b3-40c7-9fb0-5843912877ce","status":"successful","created":"2024-08-29T12:01:21.258084","started":"2024-08-29T12:01:21.873506","finished":"2024-08-29T12:01:22.658882","updated":"2024-08-29T12:01:22.658882","links":[{"href":"https://ads-beta.atmosphere.copernicus.eu/api/retrieve/v1/jobs/e3633244-04b3-40c7-9fb0-5843912877ce","rel":"self","type":"application/json"},{"href":"https://ads-beta.atmosphere.copernicus.eu/api/retrieve/v1/jobs/e3633244-04b3-40c7-9fb0-5843912877ce/results","rel":"results"}]}
2024-08-29 14:01:23,088 DEBUG GET https://ads-beta.atmosphere.copernicus.eu/api/retrieve/v1/jobs/e3633244-04b3-40c7-9fb0-5843912877ce/results {}
2024-08-29 14:01:23,173 DEBUG REPLY {"asset":{"value":{"type":"application/zip","href":"https://object-store.os-api.cci2.ecmwf.int:443/cci2-prod-cache/aef65f98a90d0e8a737fe9838fd90009.zip","file:checksum":"83fe39b361e52f656cf7b9fa0c572692","file:size":27939,"file:local_path":"s3://cci2-prod-cache/aef65f98a90d0e8a737fe9838fd90009.zip"}}}
Curl command tried to validated URL and header
curl --request POST \
--url https://ads-beta.atmosphere.copernicus.eu/api/retrieve/v1/processes/cams-europe-air-quality-forecasts-optimised-at-observation-sites/execute \
--header 'PRIVATE-TOKEN: <YOUR-TOKEN>' \
--header 'content-type: application/json' \
--data '{
"variable": ["particulate_matter_10um", "particulate_matter_2.5um"],
"country": ["france"],
"type": ["mos_optimised"],
"leadtime_hour": ["0-23"],
"year": ["2024"],
"month": ["08"],
"day": ["04"]
}'
But response is 500 code and this body :
{
"type": "internal server error",
"title": "internal server error",
"trace_id": "e20b4d4f-d766-4997-abaa-126553168236"
}
I suppose some header is missing but if we could have a documentation it would solve all this easily.