OpenAPI Specification¶
The complete OpenAPI 3.0 specification for STAC Server defines all endpoints, schemas, and extensions.
Viewing the Specification¶
-
Source File
View or download the raw OpenAPI YAML file.
-
Swagger Editor
Interactive viewer with validation and try-it-out features.
-
Redoc Viewer
Clean, responsive API documentation interface.
-
Generate Clients
Use OpenAPI generators to create client libraries.
Specification Highlights¶
The STAC Server OpenAPI specification defines:
- 40+ endpoints covering all STAC API operations
- Complete schemas for STAC Collections, Items, and search parameters
- Extension support for Transaction, Query, Filter, Sort, Fields, and Aggregation
- Error responses following RFC 7807 Problem Details
- Examples for all request and response types
Using the Specification¶
Generate API Clients¶
Use OpenAPI Generator to create client libraries:
# Install OpenAPI Generator
npm install @openapitools/openapi-generator-cli -g
# Generate Python client
openapi-generator-cli generate \
-i https://raw.githubusercontent.com/stac-utils/stac-server/main/src/lambdas/api/openapi.yaml \
-g python \
-o ./stac-client-python
# Generate TypeScript client
openapi-generator-cli generate \
-i https://raw.githubusercontent.com/stac-utils/stac-server/main/src/lambdas/api/openapi.yaml \
-g typescript-fetch \
-o ./stac-client-ts
Validate API Responses¶
Use the specification to validate API responses:
# Install spectral
npm install -g @stoplight/spectral-cli
# Validate API responses
spectral lint openapi.yaml
API Testing¶
Use the specification with testing tools:
# Dredd API testing
npm install -g dredd
dredd openapi.yaml http://localhost:3000
# Postman collection generation
npx openapi-to-postmanv2 \
-s openapi.yaml \
-o stac-server.postman_collection.json
Local Interactive Documentation¶
When running a STAC Server instance, the /api endpoint provides an interactive Redoc interface:
This interface allows you to:
- Browse all endpoints with complete schemas
- View request/response examples
- Test API calls directly from the browser
- Download the OpenAPI specification
Specification Conformance¶
The specification implements:
- OpenAPI 3.0.3 format
- STAC API v1.0.0 endpoints
- OGC API - Features compatibility
- GeoJSON response formats
- CQL2 query language (Filter extension)
Next Steps¶
- Reference > API Overview - Human-readable API documentation
- Guides > Usage - Practical examples and tutorials
- External > STAC API Spec - Official specification