Status & Reload

Status

GET /api/status

Returns engine health and map defaults only — no GTFS data (those moved to GET /api/gtfs/status). No authentication required. Used as the Docker healthcheck.

Response

{
  "status": "ok",
  "dependencies": {
    "valhalla": "ok"
  },
  "map": {
    "center": [48.8566, 2.3522],
    "zoom": 11,
    "bounds": [[48.1, 1.4], [49.3, 3.6]]
  }
}

status is "ok" when all dependencies are healthy, "degraded" otherwise.

GTFS Status

GET /api/gtfs/status

Returns GTFS data statistics and the last load timestamp.

Response

{
  "loaded_at": "2026-03-15T08:00:00Z",
  "gtfs": {
    "agencies": 64,
    "routes": 2011,
    "stops": 53705,
    "trips": 390650,
    "stop_times": 8367732,
    "calendars": 744,
    "calendar_dates": 1150,
    "transfers": 201582
  },
  "raptor": {
    "patterns": 10061,
    "services": 777
  }
}

GTFS Validation

GET /api/gtfs/validate

Runs 19 automated data quality checks on the loaded GTFS data and returns issues grouped by severity.

Validation Categories

CategoryChecks
Referential IntegrityOrphaned stop_times (missing trip/stop), orphaned trips (missing route), orphaned routes (missing agency)
CalendarActive services exist for today, no expired calendars
CoordinatesValid lat/lon ranges, no zeros, within bounds
TransfersValid transfer types, referenced stops exist
PathwaysValid pathway types, referenced stops exist
DisplayMissing route colors, missing route names

Response

{
  "summary": {
    "errors": 2,
    "warnings": 5,
    "infos": 3,
    "total_checks": 19
  },
  "issues": [
    {
      "severity": "error",
      "category": "referential_integrity",
      "message": "stop_times reference non-existent trip_id",
      "count": 12,
      "samples": ["trip_001", "trip_002", "trip_003"]
    }
  ]
}

Each issue includes up to 5 sample IDs for diagnosing the problem. The frontend displays an interactive validation report.

Reload

POST /api/gtfs/reload

Triggers a hot-reload of GTFS data. The server remains fully available during the reload.

Authentication

Requires the API key configured in config.yaml:

curl -X POST http://localhost:8080/api/gtfs/reload \
  -H "Authorization: Bearer your-secret-key"

If api_key is empty in the config, this endpoint returns 403 Forbidden.

How It Works

  1. The request is accepted and returns 200 OK immediately
  2. A background thread downloads and parses new GTFS data
  3. A fresh RAPTOR index is built from the new data
  4. The new index is swapped in atomically via ArcSwap
  5. In-flight requests continue using the old index until they complete

Use Cases

  • Scheduled updates: Call via cron when new GTFS data is published
  • CI/CD: Trigger after deploying new data files
  • Manual: Reload after editing GTFS files during development