--- id: stac-fastapi-pgstac version: "6.3.1" license: MIT license_treatment: permissive maintenance: active --- # stac-fastapi-pgstac — An implementation of STAC API based on the FastAPI framework and using the pgstac backend. License: permissive · Maintenance: active · Downloads: 80.1K/mo ## What it is and what it does stac-fastapi-pgstac is a FastAPI application that wraps PgSTAC, a PostgreSQL-backed STAC (SpatioTemporal Asset Catalog) database engine. It validates incoming HTTP requests against the STAC API specification, delegates search and retrieval operations to PgSTAC's procedural SQL functions, and enriches responses with standardized STAC links. The package stores all collection and item records as JSONB fields in PostgreSQL, preserving custom fields transparently. The package is designed for deployments that need a standards-compliant HTTP interface to large geospatial metadata catalogs. It supports the STAC Sort Extension (with optimized datetime sorting), optional API-level or database-level result hydration, and the Multi-Tenant Catalogs Extension for hierarchical catalog structures with directed acyclic graph support. Runtime dependencies include asyncpg for async database access, pydantic for validation, and orjson for fast JSON serialization. Use it for: - Expose a searchable STAC API endpoint over HTTP for a PostgreSQL-backed geospatial metadata catalog - Build a multi-tenant geospatial data platform with hierarchical catalogs and poly-hierarchy link navigation - Integrate STAC search into a larger FastAPI application using stac-fastapi-pgstac as a backend module - Serve large spatiotemporal asset collections with optimized datetime-based sorting and filtering - Deploy a STAC API with custom JSON fields preserved transparently through JSONB storage ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a FastAPI-based HTTP interface to PgSTAC, a PostgreSQL backend for STAC API, enabling search and retrieval of geospatial collection and item metadata. Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and is MIT-licensed. Install it if you need a production-ready STAC API server backed by PostgreSQL. Prerequisite: you must provision a PgSTAC database schema and have PostgreSQL with PostGIS available; the package itself is the HTTP layer, not a standalone database. ## Install pip install stac-fastapi-pgstac uv add stac-fastapi-pgstac poetry add stac-fastapi-pgstac ## Installing stac-fastapi-pgstac Before you install: Low install friction with a pure-Python wheel. Active maintenance with a recent release 51 days ago and a commit history through August 2026. Requires 14 runtime dependencies including asyncpg, pydantic, and stac-fastapi ecosystem packages. License in practice: MIT license (permissive) allows commercial and private use with minimal restrictions, making it suitable for both open and proprietary deployments. Quickstart: # Install pip install stac-fastapi-pgstac # Minimal usage (requires PgSTAC database configured) from stac_fastapi_pgstac.app import StacApi from stac_fastapi_pgstac.config import Settings settings = Settings() app = StacApi.build(settings=settings) Requires a running PostgreSQL database with PgSTAC schema installed and pypgstac package available; Python >=3.11 Verify before relying: - Whether PgSTAC database schema and pypgstac package are automatically provisioned or require separate setup - Performance characteristics for repositories with millions of records beyond datetime sorting - Whether Docker Compose is required for local development or if PostgreSQL/PostGIS can be configured standalone ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 80.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags stac api fastapi backend, spatiotemporal catalog search, pgstac http interface, geospatial metadata api, stac item search server, postgresql stac catalog, fastapi stac implementation, stac-catalog, geospatial-api, postgresql-backend [View on SkillFed](https://skillfed.io/packages/stac-fastapi-pgstac) · [View on PyPI](https://pypi.org/project/stac-fastapi-pgstac/)