Base URL
The API is versioned under the/api/v2026/ prefix.
| Environment | Base URL |
|---|---|
| Local | http://localhost:3000 |
| Deployed (QA / Staging / Production) | AWS API Gateway URL (generated by SAM per environment) |
/qa, /staging, /production) is stripped automatically before the request reaches Express, so routes behave identically across all environments.
Authentication
No authentication is required. The API is public with no rate limiting.Request format
All endpoints accept and return JSON.- Set
Content-Type: application/jsonon everyPOSTrequest. GETendpoints do not require a request body or content-type header.
Endpoints
| Method | Path | Description | Cached |
|---|---|---|---|
POST | /api/v2026/calculate-fare | Calculate the fare for a trip | No |
GET | /api/v2026/zones | Sectors with colors for map display | Yes |
GET | /api/v2026/sector | Look up the sector for a neighborhood | Yes |
GET | /api/v2026/barrios | Neighborhoods grouped by sector (general + terminal) | Yes |
GET | /api/v2026/rutas-especiales | Routes with a fixed special fare | Yes |
GET | /health | Health check | No |
Caching
GET endpoints respond with:
CACHE_TTL environment variable.
Response envelope
Every response — success or error — is wrapped in a standard envelope.Success
Always
true for successful responses.ISO 8601 UTC timestamp of when the request was processed (e.g.
"2026-03-10T14:30:00.000Z").UUID v4 that uniquely identifies this request. Use it when reporting issues.
The response payload. Shape varies by endpoint.
Example
Error
Always
false for error responses.ISO 8601 UTC timestamp of when the error occurred.
UUID v4 identifying the failed request.
Interactive API documentation with a built-in request playground is available at
/docs (Swagger UI). It reflects the OpenAPI 3.0 specification bundled with the server.