# Retrieve external data

**URL:** <https://forum.ecmwf.int/t/retrieve-external-data/1784>\
**Category:** Other - Software and tools\
**Tags:** c3s, toolbox\
**Created:** [20 June 2022 08:04 UTC](https://forum.ecmwf.int/t/retrieve-external-data/1784 "2022-06-20T08:04:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antonio\_Perez](https://forum.ecmwf.int/user_avatar/forum.ecmwf.int/antonio_perez/32/76_2.png) [@Antonio\_Perez](https://forum.ecmwf.int/u/Antonio_Perez)\
**Post date:** [20 June 2022 08:04 UTC](https://forum.ecmwf.int/t/retrieve-external-data/1784/1 "2022-06-20T08:04:05Z")

</div>

Hi,&nbsp;

I have seen there is a toolbox function for this purpose: [https://cds.climate.copernicus.eu/toolbox/doc/tools/cdstoolbox.cdm.external\_retrieve.html#cdstoolbox.cdm.external\_retrieve](https://cds.climate.copernicus.eu/toolbox/doc/tools/cdstoolbox.cdm.external_retrieve.html#cdstoolbox.cdm.external_retrieve)

However, It does not seem to work with: url="[https://www.unidata.ucar.edu/software/netcdf/examples/sresa1b\_ncar\_ccsm3-example.nc](https://www.unidata.ucar.edu/software/netcdf/examples/sresa1b_ncar_ccsm3-example.nc)" which is the same you are using in documentation examples like: [How to call a service with the CDS API](https://confluence.ecmwf.int/pages/viewpage.action?pageId=146654123)

The app:

```
import cdstoolbox as ct

@ct.application(title='Download data')
@ct.output.download()
def download_application():
    data = ct.cdm.external_retrieve(
        url="[https://www.unidata.ucar.edu/software/netcdf/examples/sresa1b\_ncar\_ccsm3-example.nc](https://www.unidata.ucar.edu/software/netcdf/examples/sresa1b_ncar_ccsm3-example.nc)",
        obs=False
    )
    print(data)
    return data
```

The error:&nbsp;

```
Traceback (most recent call last):
  File "/opt/cdstoolbox/cdscompute/cdscompute/cdshandlers/services/handler.py", line 59, in handle_request
    result = cached(context.method, proc, context, context.args, context.kwargs)
  File "/opt/cdstoolbox/cdscompute/cdscompute/caching.py", line 108, in cached
    result = proc(context, *context.args, **context.kwargs)
  File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 124, in __call__
    return p(*args, **kwargs)
  File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 60, in __call__
    return self.proc(context, *args, **kwargs)
  File "/home/cds/cdsservices/services/cdm/external_retrieve.py", line 42, in external_retrieve
    raise ValueError("URL is not allowed")
ValueError: URL is not allowed
```

Could you provide a working example of this functionality?

Thank you beforehand,

Antonio Pérez

---

<div class="post-metadata">

**Author:** ![Kevin\_Marsh](https://forum.ecmwf.int/user_avatar/forum.ecmwf.int/kevin_marsh/32/368_2.png) [@Kevin\_Marsh](https://forum.ecmwf.int/u/Kevin_Marsh)\
**Post date:** [8 August 2022 10:00 UTC](https://forum.ecmwf.int/t/retrieve-external-data/1784/2 "2022-08-08T10:00:34Z")

</div>

Hi Antonio,

Currently this functionality is normally restricted to 'internal' CDS developers only i.e. users cannot access arbitrary external files from the Toolbox,

Thanks

Kevin
