![stac-logo](../_static/services/stac_logo.png) # 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: ```python 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:** 1. `pystac_client.Client.open(stac_url)` — connects to the eodc STAC API. No authentication required for public collections. 2. `eodc.search(collections=...)` — filters by collection name. Browse available collections at `https://stac.eodc.eu/api/v1/collections`. 3. `bbox` — spatial filter as `[west, south, east, north]` in WGS84 decimal degrees. 4. `datetime` — temporal filter as an ISO 8601 interval (`start/end`). Single dates are also accepted. 5. `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](../notebooks/stac-xarray) notebook. - See the [Data Discovery](../notebooks/stac-discovery) notebook for a full worked example of searching and browsing collections. - Browse available collections: `https://stac.eodc.eu/api/v1/collections`