Skip to content

REST API

The rpi-seism API is a FastAPI application that sits in front of the SDS archive and SQLite bookmark store. It exposes two routers — /archive and /bookmarks — consumed by the Angular web dashboard and any external tooling.


EnvironmentURL
Local developmenthttp://localhost:8000
Production (same host as dashboard)http://<pi-hostname>:8000

/archive

Read waveforms, browse the SDS day-file index, download raw MiniSEED files, and export to multiple formats. Archive →

/bookmarks

Persist, query, update, and delete named time-window bookmarks backed by SQLite. Bookmarks →


The API reads config.yml at startup via the shared rpi-seism-common settings model. The SDS root and station.xml paths are derived from the RPI_SEISM_PATH environment variable (default /usr_data).

Terminal window
# Override data path (e.g. for Docker)
export RPI_SEISM_PATH=/mnt/seism-data
fastapi run app.main:app
$RPI_SEISM_PATH/
├── config.yml ← settings loaded at startup
├── station.xml ← instrument response (auto-generated by daemon)
├── archive/ ← SDS tree consumed by /archive
│ └── YEAR/NET/STA/CHAN.D/...
└── data/
└── database.db ← SQLite bookmark store

All origins are allowed in the default configuration (allow_origins=["*"]). Tighten this to your dashboard’s origin in production.


GET /archive/health

Returns JSON confirming the SDS root and station.xml paths resolve correctly — useful for container readiness probes.

{
"status": "ok",
"sds_root": "/usr_data/archive",
"sds_exists": true,
"station_xml": "/usr_data/station.xml",
"xml_exists": true,
"network": "XX",
"station": "RPI3"
}