API.download()
Download of SLR data and SLR product from EDC. The EDC archive can be found at EDC Website.
Code-Examples:
It downloads the file /archive/data/npt_crd_v2/lageos1/2025/lageos1_202502.np2 to the directory /tmp/lageos1/ and stores a log_file to /tmp/lageos1.log.
import edcapi
# Initialize Class
edc_api = edcapi.API()
# edc_api = edcapi.API(api_key="19E3C4D5DA26234AB8E72A5618349765A1875531E52F64F0102ED3B0251E4D40")
# Downlaod single file from EDC
response = edc_api.download(
'/archive/data/npt_crd_v2/lageos1/2025/lageos1_202502.np2'
output_path='/tmp/lageos1/',
log_path='/tmp/lageos1.log',
)
Terminal output:
2025-12-15 09:19:49 INFO [API.py:83] API-Key: 19E3C4D5DA26234AB8E72A5618349765A1875531E52F64F0102ED3B0251E4D40
2025-12-15 09:19:49 INFO [API.py:179] Found 1 files to download!
2025-12-15 09:19:49 INFO [API.py:222] /tmp/lageos1/lageos1_202502.np2 -> Download successful!
2025-12-15 09:19:49 INFO [API.py:243] 1 file(s) downloaded!
2025-12-15 09:19:49 INFO [API.py:244] 0 file(s) failed!
2025-12-15 09:19:49 INFO [API.py:245] 0 file(s) up-to-date!
2025-12-15 09:19:49 INFO [API.py:247] Log-File: /tmp/lageos1.log
Log file /tmp/lageos1.log:
2025-12-15 09:19:49.513514 /tmp/lageos1/lageos1_202502.np2 NEW
It downloads all the monthly files from the directory /archive/data/npt_crd_v2/lageos1/ that fulfil the regular expression ^.*_[0-9]{6}.np2$. All files are downloaded recursively into the /tmp/lageos1/ directory. Only files that do not exist locally or differ from the file on the server are downloaded.
import edcapi
api_key = "19E3C4D5DA26234AB8E72A5618349765A1875531E52F64F0102ED3B0251E4D40"
# Initialize Class
edc_api = edcapi.API()
# edc_api = edcapi.API(api_key=api_key)
# Download directory file from EDC
response = edc_api.download('/archive/data/npt_crd_v2/lageos1/',
output_path='/tmp/lageos1/',
update_only=True,
preserve_timestamp=True,
file_pattern="^.*_[0-9]{6}.np2$",
)
Terminal output:
2025-12-11 09:14:13 INFO [API.py:82] Username: admin
2025-12-11 09:14:13 INFO [API.py:83] API-Key: A1875531E52F64F0119E3C4D5DA26234AB8E72A56183D3B0251E4D404976502E
2025-12-11 09:14:14 INFO [API.py:184] Found 41 files to download!
2025-12-11 09:14:14 INFO [API.py:227] /tmp/lageos1/2022/lageos1_202208.np2 -> Download successful!
2025-12-11 09:14:14 INFO [API.py:227] /tmp/lageos1/2022/lageos1_202210.np2 -> Download successful!
2025-12-11 09:14:14 INFO [API.py:227] /tmp/lageos1/2022/lageos1_202209.np2 -> Download successful!
...
2025-12-11 09:15:04 INFO [API.py:227] /tmp/lageos1/2025/lageos1_202510.np2 -> Download successful!
2025-12-11 09:15:04 INFO [API.py:227] /tmp/lageos1/2025/lageos1_202512.np2 -> Download successful!
cURL command:
It downloads the file /archive/data/npt_crd_v2/lageos1/2025/lageos1_202502.np2 to the directory /tmp/lageos1/.
curl -X POST https://edc.dgfi.tum.de/api/v3/download/
-H "Authorization: ApiKey A1875531E52F64F0119E3C4D5DA26234AB8E72A56183D3B0251E4D404976502E"
-d "path_url=/archive/data/npt_crd_v2/lageos1/2025/lageos1_202502.np2"
-o "/tmp/lageos1/lageos1_202502.np2"
Terminal output:
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed
100 1484k 100 1484k 100 65 27.1M 1215 --:--:-- --:--:-- --:--:-- 27.3M