SpatioTemporal Asset Catalog (STAC) API Support

Versions

pycsw supports SpatioTemporal Asset Catalog API version v1.0.0 by default.

pycsw implements provides STAC support in the following manner:

  • a pycsw repository is equivalent to a STAC collection

  • pycsw metadata records are equivalent to STAC items

The STAC specification is designed with the same principles as OGC API - Records.

Implementation

The following design patterns are put forth for STAC support:

Collections

  • any pycsw record that is ingested as a STAC Collection will appear on /stac/collections as a collection

Filtering

STAC API filtering is realized by OGC Common Query Language (CQL2) via HTTP GET and POST. For GET requests, the filter= query parameter can be used. For POST requests, a JSON payload with a filter property expressing the CQL2 can be used.

Transactions

STAC Transactions are supported as per the following STAC API specifications:

Request Examples

# landing page
http://localhost:8000/stac

# collections
http://localhost:8000/stac/collections

# collection queries
# query parameters can be combined (exclusive/AND)

# landing page
http://localhost:8000/stac
# OpenAPI
http://localhost:8000/stac/openapi
# collections
http://localhost:8000/stac/collections
# collections query, full text search
http://localhost:8000/stac/collections?q=sentinel
# collections query, spatial query
http://localhost:8000/stac/collections?bbox=-142,42,-52,84
# collections query, full text search and spatial query
http://localhost:8000/stac/collections?q=sentinel,bbox=-142,42,-52,84
# collections query, limiting results
http://localhost:8000/stac/collections?limit=2
# collections query, spatial query
# single collection
http://localhost:8000/stac/collections/metadata:main
# collection queryables, all records
http://localhost:8000/stac/queryables
# collection query, all records
http://localhost:8000/stac/search
# collection query, full text search
http://localhost:8000/stac/search?q=lorem
# collection query, spatial query
http://localhost:8000/stac/search?bbox=-142,42,-52,84
# collection query, temporal query
http://localhost:8000/stac/search?datetime=2001-10-30/2007-10-30
# collection query, temporal query, before
http://localhost:8000/stac/search?datetime=../2007-10-30
# collection query, temporal query, after
http://localhost:8000/stac/search?datetime=2007-10-30/..
# collection query, property query
http://localhost:8000/stac/search?title=Lorem%20ipsum
# collection query, CQL filter
http://localhost:8000/stac/search?filter=title like "%lorem%"
# collection query, limiting results
http://localhost:8000/stac/search?limit=1
# collection filter query, limiting results
http://localhost:8000/stac/search?limit=1&collections=landsat
# collection ids filter query, limiting results
http://localhost:8000/stac/search?limit=1&ids=id1,id2
# collection query, paging
http://localhost:8000/stac/search?limit=10&offset=10
# collection query, paging and sorting (default ascending)
http://localhost:8000/stac/search?limit=10&offset=10&sortby=title
# collection query, paging and sorting (descending)
http://localhost:8000/stac/search?limit=10&offset=10&sortby=-title
# collection item as GeoJSON
http://localhost:8000/stac/collections/metadata:main/items/{itemId}

# CQL2 JSON (as curl commands)

# search by creation date
curl --location --request POST 'http://localhost:8000/stac/search' \
    --header 'Content-Type: application/query-cql-json' \
    --data-raw '{
        "filter-lang": "cql2-json",
        "filter": {
            "op": "<=",
            "args": [
                {
                    "property": "date_creation"
                },
                "2025-12-15"
            ]
        }
    }'

# search by creation date
curl --location --request POST 'http://localhost:8000/stac/search' \
    --header 'Content-Type: application/query-cql-json' \
    --data-raw '{
      "filter-lang": "cql2-json",
      "filter": {
          "op": "and",
          "args": [
              {
                  "op": "in",
                  "args": [
                      {
                          "property": "parentidentifier"
                      },
                      [
                          "sentinel-2-l2a"
                      ]
                  ]
              }
          ]
      }
  }'