
How to use STAC¶
Install¶
pip install pystac-client
Connect and search¶
Open a connection to the eodc STAC API and search for items by collection, bounding box, and time range:
import pystac_client
stac_url = "https://stac.eodc.eu/api/v1"
eodc = pystac_client.Client.open(stac_url)
found = eodc.search(
collections=["SENTINEL1_GRD"],
bbox=[7.9, 48.9, 8, 49],
datetime="2021-07-01/2021-07-15"
)
for item in found.items():
print(item.id, item.datetime)
Step by step:
pystac_client.Client.open(stac_url)— connects to the eodc STAC API. No authentication required for public collections.eodc.search(collections=...)— filters by collection name. Browse available collections athttps://stac.eodc.eu/api/v1/collections.bbox— spatial filter as[west, south, east, north]in WGS84 decimal degrees.datetime— temporal filter as an ISO 8601 interval (start/end). Single dates are also accepted.found.items()— iterates over matching STAC items. Each item contains metadata and links to the actual data assets.
Next steps¶
Load assets into xarray using
odc-stac— see the Load Data with Xarray notebook.See the Data Discovery notebook for a full worked example of searching and browsing collections.
Browse available collections:
https://stac.eodc.eu/api/v1/collections