Skip to main content
Returns the fare sector for a given neighborhood name. Useful for understanding which pricing tier applies before calling /calculate-fare.

Endpoint

GET /api/v2026/sector
Caching: Responses include Cache-Control: public, max-age=300.

Query parameters

barrio
string
required
The neighborhood name to look up. Matching is exact after normalizing accents and casing — "San Fernando", "san fernando", and "SAN FERNANDO" all resolve to the same result.

Response

200 — Sector found

success
boolean
required
Always true on a successful response.
timestamp
string
required
ISO 8601 UTC timestamp of the response.
data
object
required

Error responses

HTTP statusError codeCause
400MISSING_PARAMbarrio query parameter was not provided.
404BARRIO_NOT_FOUNDThe neighborhood was not found in any table.

Examples

curl "http://localhost:3000/api/v2026/sector?barrio=San%20Fernando"

Sample response — found

{
  "success": true,
  "timestamp": "2026-03-10T14:30:00.000Z",
  "data": {
    "barrio": "San Fernando",
    "sector": "primer sector",
    "fuente": "general"
  }
}

Sample response — not found

{
  "success": false,
  "timestamp": "2026-03-10T14:30:00.000Z",
  "error": {
    "code": "BARRIO_NOT_FOUND",
    "message": "Barrio \"BarrioFalso\" no encontrado"
  }
}

Build docs developers (and LLMs) love