Discover data and services

HDA service allows to discover DEDL collections and services. We show how to do it sending a few HTTP requests to the API, using Python code.

We start off by importing the relevant modules for HTTP requests and json handling.

from typing import Union
import requests
import json
import urllib.parse
from IPython.display import JSON

And defining the relevant constants, holding the URL strings for the different endpoints.

# Core API
HDA_API_URL = "https://hda.data.destination-earth.eu"
SERVICES_URL = f"{HDA_API_URL}/services"
SERVICE_BY_ID_URL = f"{SERVICES_URL}/{SERVICE_ID}"

# STAC API
## Core
STAC_API_URL = f"{HDA_API_URL}/stac"

## Collections
COLLECTIONS_URL = f"{STAC_API_URL}/collections"

Discover DEDL services

The /services endpoint will return the list of the DEDL services available for users of the platform.

print(SERVICES_URL)
JSON(requests.get(SERVICES_URL).json())
../../../_images/hda_services.PNG

Through the /services endpoint is also possible discover services related to a certain topic:

JSON(requests.get(SERVICES_URL,params = {"q": "dask"}).json())
../../../_images/hda_dask.PNG

Discover DEDL data collections

The /collection endpoint will allow to discover data collections related to a certain topic. It is also possible discover collections specifying the data provider or the time interval. Below an example where an open time interval is specified, in this way we discover collections with data starting from a certain datetime.

response = requests.get(COLLECTIONS_URL,params = {"q": "ozone,methane,fire","provider":"eumetsat","datetime":'2024-01-01T00:00:00Z/..'})
JSON(response.json(), expanded=False)
../../../_images/hda_collections.PNG

The notebook to discover DEDL data and services is available here: HDA tutorial