Authentication
Public endpoint limits depend on the deployment. Check response headers for the active limit. API keys use the public tier. Research and paid tiers are not available. Send keys using an X-API-Key header.
curl -H "X-API-Key: your_key" https://slopesense-olive.vercel.app/api/v1/alerts/activeRate Limits
Rate-limit response headers describe the active deployment. Headers X-RateLimit-Remaining and X-RateLimit-Reset are included in every response.
Error Codes
Standard HTTP status codes are returned alongside a JSON payload containing a detailed message.
FPI & Risk
/PublicHealth check. Returns API status, version, last model run timestamp, and active alert count.
curl /api//v1/riskPublicGet FPI score for a specific lat/lon coordinate. Uses nearest 0.1° grid cell.
| Name | Type | Description |
|---|---|---|
| lat | float | Latitude (−90 to 90) |
| lon | float | Longitude (−180 to 180) |
| hours_ahead | int | Forecast horizon: 0, 24, or 48 hours |
curl "/api/v1/risk?lat=11.58&lon=76.08&hours_ahead=24"/v1/districts/{state_code}PublicAll districts in a state with current FPI summary. Filter by min_fpi.
| Name | Type | Description |
|---|---|---|
| state_code | str | Two-letter state code (e.g., KL, UK, SK) |
| min_fpi | float | Minimum FPI score filter (0.0–1.0) |
Source observations
/v1/source-observationsPublicLatest stored weather-model snapshot per representative point, with source, fetch time and stale flag. Open-Meteo model values, not measurements, not risk scores, not warnings.
/v1/source-observations/{point_code}/historyPublicStored snapshots for one point, newest first, as fetched. No interpolation.
| Name | Type | Description |
|---|---|---|
| hours | int | Window in hours, 1-168 (default 48) |
Alerts
/v1/alerts/activePublicGet all currently active alerts. Filter by tier, state, or minimum FPI score.
| Name | Type | Description |
|---|---|---|
| min_fpi | float | Minimum FPI threshold |
| tier | str | WATCH | WARNING | EMERGENCY |
| state | str | Two-letter state code |
/v1/alerts/{alert_id}PublicFull detail for a specific alert including signal breakdown.
GeoJSON & CAP
/v1/geojson/fpiPublicGeoJSON FeatureCollection of FPI scores for MapLibre heatmap rendering. Supports bbox viewport filtering.
| Name | Type | Description |
|---|---|---|
| state | str | Filter by state code |
| min_fpi | float | Minimum FPI |
| bbox | str | minLon,minLat,maxLon,maxLat viewport filter |
/v1/cap/feedPublicCAP v1.2 XML alert feed. Compatible with NDMA Sachet app and all CAP consumers.
| Name | Type | Description |
|---|---|---|
| state | str | Filter by state |
| min_fpi | float | Default 0.65 (WARNING threshold) |
curl "/api/v1/cap/feed?state=KL&min_fpi=0.65"Reports & Audit
/v1/districts/{district_code}/report.pdfPublicOfficial NDMA-style PDF report for a district. Includes FPI table, signal breakdown, and recommended actions.
/v1/historical/{date}/{district_code}PublicHistorical FPI time-series for a district on a given date. Supports GeoJSON output.
| Name | Type | Description |
|---|---|---|
| date | str | YYYY-MM-DD |
| district_code | str | District code (e.g., WYD) |
| format | str | json | geojson |
/v1/retrospectivePublicRetrospective validation summary for all 6 historical India landslide events.
Contacts & Webhooks
/v1/contacts/registerAPI KeyRegister for WhatsApp alert delivery. Supports DDMA officers, Aapda Mitra volunteers, and Gram Pradhans.
curl -X POST /api/v1/contacts/register \
-H "Content-Type: application/json" \
-d '{"name":"Test","role":"district_collector","whatsapp_number":"+919876543210","state_code":"KL","language":"ml","min_tier":"WARNING"}'/v1/webhooks/whatsappSignedWhatsApp webhook receiver. Handles delivery receipts and "NO EVENT" false alarm feedback from field officers.
/ws/livePublicWebSocket endpoint for live FPI updates on the dashboard. Sends init state on connect, then pushes on each model run.
// JavaScript
const ws = new WebSocket("wss://YOUR-API-HOST/ws/live");
ws.onmessage = (e) => console.log(JSON.parse(e.data));