Cant Acess API, Error 404

I am doing some easy trials to access the API and I have errors everywhere, I would really appreciate some help.

This is my code and the error:

from pathlib import Path
import cdsapi, datetime as dt

1) Escribimos el .cdsapirc sin espacios extras ni BOM

rc = Path(r"C:\Users\Vicente Collado.cdsapirc")
rc.write_text(
“url: https://cds.climate.copernicus.eu/api\n
“key: UID:TOKEN\n”,
encoding=“utf-8”,
)

2) Cliente - ahora debería salir “Using key authentication with URL …”

c = cdsapi.Client(quiet=False)

3) Solicitud mínima de prueba (solo 1 hora de un día)

c.retrieve(
“reanalysis-era5-land”,
{
“product_type”: “reanalysis”,
“variable”: “2m_temperature”,
“year”: “2024”,
“month”: “01”,
“day”: “01”,
“time”: “00:00”,
“format”: “netcdf”,
},
“test_era5.nc”,
)
print(“¡Petición lanzada!”, dt.datetime.now())
2025-07-01 12:09:59,777 INFO Sending request to

https://cds.climate.copernicus.eu/api/resources/reanalysis-era5-land
Traceback (most recent call last):
File “C:\Users\Vicente Collado\Desktop\Master Thesis\XGBoost.venv\Lib\site-packages\cdsapi\api.py”, line 459, in _api
result.raise_for_status()
~~~~~~~~~~~~~~~~~~~~~~~^^
File “C:\Users\Vicente Collado\Desktop\Master Thesis\XGBoost.venv\Lib\site-packages\requests\models.py”, line 1026, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://cds.climate.copernicus.eu/api/resources/reanalysis-era5-land
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “”, line 16, in
File “C:\Users\Vicente Collado\Desktop\Master Thesis\XGBoost.venv\Lib\site-packages\cdsapi\api.py”, line 381, in retrieve
result = self._api(“%s/resources/%s” % (self.url, name), request, “POST”)
File “C:\Users\Vicente Collado\Desktop\Master Thesis\XGBoost.venv\Lib\site-packages\cdsapi\api.py”, line 481, in _api
raise Exception(error)
Exception: Climate Data Store API endpoint not found
It seems you are trying to access an API endpoint that does not exist.
It is possible that you are pointing to an outdated API endpoint which has been removed/renamed.
If you are using the standard cdsapi Python library, please ensure that:

Hi @Vicente_Collado_Torres ,
As indicated in the error message you received, "please ensure that your .cdsapirc file is correctly configured ", in particular “key” should be set to your API key WITHOUT the <UID>: prefix.
You can see the content of your .cdsapirc file by logging onto the CDS and then go to the API page - copy and paste the details displayed in the first black box :slight_smile: