Skip to content

List Costa Rica provincia/cantón/distrito location codes

GET
/v1/catalogs/locations
curl --request GET \
--url https://api.emite.cr/v1/catalogs/locations

Hacienda's official provincia → cantón → distrito hierarchy (location codification v4.4), the catalog behind cascading address pickers. Codes come in the exact shape a location expects (a company's or a contact's address): provincia 1 digit, cantón and distrito 2 digits. Barrios are not included: barrio is free text in v4.4. Public (no credentials) and cacheable for a day; it changes only when Hacienda republishes the codification.

Media typeapplication/json
object
provincias
required

Costa Rica's seven provincias, each with its cantones and their distritos, as Hacienda's location codification (v4.4) defines them. The codes only make sense together: a cantón code is unique within its provincia, and a distrito code within its cantón. Barrios are not listed: barrio is free text in v4.4.

Array<object>
object
code
required

Provincia code, 1 digit (1 San José to 7 Limón): the value for location.provincia (<Ubicacion><Provincia> in the XML).

string
name
required

Official name of the provincia.

string
cantones
required

The cantones of this provincia.

Array<object>
object
code
required

Cantón code, 2 digits, unique within its provincia: the value for location.canton (<Ubicacion><Canton> in the XML).

string
name
required

Official name of the cantón.

string
distritos
required

The distritos of this cantón.

Array<object>
object
code
required

Distrito code, 2 digits, unique within its cantón: the value for location.distrito (<Ubicacion><Distrito> in the XML).

string
name
required

Official name of the distrito.

string
Example
{
"provincias": [
{
"code": "1",
"name": "San José",
"cantones": [
{
"code": "01",
"name": "San José",
"distritos": [
{
"code": "01",
"name": "Carmen"
}
]
}
]
}
]
}