-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
Saman Tabatabaeian edited this page Feb 17, 2026
·
1 revision
AstroLens exposes a REST API via FastAPI. Start it with:
uvicorn api.main:app --port 8000Interactive docs available at http://localhost:8000/docs (Swagger UI).
| Endpoint | Method | Response |
|---|---|---|
/health |
GET | {"status":"ok","version":"1.1.0","ml_model_loaded":true} |
/device |
GET | {"device_type":"mps","device_name":"Apple M4"} |
/stats |
GET | {"total_images":10000,"anomalies":500,"analyzed":9500} |
| Endpoint | Method | Parameters | Description |
|---|---|---|---|
/images |
GET |
skip, limit, anomaly_only
|
List images |
/images/{id} |
GET | -- | Image details |
/images/{id}/file |
GET | -- | Serve image file |
/images |
POST |
file (multipart) |
Upload image |
/images/{id} |
PATCH |
class_label, ood_score, is_anomaly
|
Update |
/images/{id} |
DELETE | -- | Delete |
| Endpoint | Method | Description |
|---|---|---|
/analysis/classify/{id} |
POST | ViT classification |
/analysis/anomaly/{id} |
POST | OOD detection |
/analysis/similar/{id} |
POST | Find similar images |
/analysis/full/{id} |
POST | Full pipeline (classify + anomaly + similar) |
| Endpoint | Method | Parameters | Description |
|---|---|---|---|
/candidates |
GET |
skip, limit
|
Anomalies sorted by OOD score |
| Endpoint | Method | Description |
|---|---|---|
/crossref/{id} |
POST | Cross-reference against SIMBAD/NED/VizieR |
/crossref/summary |
GET | Counts of known/unknown/verified |
/crossref/batch |
POST | Batch cross-reference all anomalies |
/crossref/{id}/verify |
POST | Mark true_positive/false_positive |
| Endpoint | Method | Description |
|---|---|---|
/api/streaming-state |
GET | Live streaming discovery status and metrics |
| Format | Extension | Use Case |
|---|---|---|
| CSV | .csv |
Spreadsheets, pandas, R |
| JSON | .json |
Programmatic access |
| HTML | .html |
Visual report |
| VOTable | .vot |
Astronomical tools (TOPCAT, Aladin, DS9) |