All videos

ENPNOVA Pixel · ·

stac-fastapi Tutorial: Build a STAC API in Python

Learn how to build and run a STAC API in Python with stac-fastapi.

Notes

Learn how to build and run a STAC API in Python with stac-fastapi. This tutorial covers how the framework is put together (StacApi, the core client, request models and settings), the core endpoints, every extension that ships with it (Filter/CQL2, Sort, Fields, Query, Collection Search, Aggregation), and writing data safely with transactions. Then we run stac-fastapi-pgstac hands-on: configure it, load the Joplin demo data, and query it from Python with pystac-client. We finish with customization, performance and operations, a pgstac vs Elasticsearch/OpenSearch comparison, and the breaking changes to watch for when upgrading. Based on stac-fastapi 7.1.0, stac-fastapi-pgstac 7.2.0 and pgstac 0.10.0.