Skip to content

Geography

Regions, departments, districts and communes, with their parents and children.

Try it from this page

The "Try" button calls the API from your browser. Without a key, the call counts against the anonymous quota (100 calls per day and per IP address); with a key in the Authorization field, the quota rises to 1,000. The key stays in your browser. Get a key
GET
/v1/geographie

Query Parameters

page?integer
Formatint64
Range1 <= value
Default1
per_page?integer
Formatint64
Range1 <= value <= 100
Default20
level?string

Value in

  • "region"
  • "departement"
  • "arrondissement"
  • "ville"
  • "commune"
parent_id?string
q?string

Ignores accents and case; "thies" finds Thiès.

Length1 <= length

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/geographie"
{  "data": [    {      "id": "string",      "lat": 0,      "level": "string",      "lon": 0,      "name": "string",      "name_source": "string",      "parent_id": "string",      "population_2023": 0,      "search_key": "string"    }  ],  "meta": {    "attribution": "string",    "licence": "string",    "source": "string",    "verified_on": "string",    "version": "string"  },  "pagination": {    "page": 0,    "per_page": 0,    "total": 0,    "total_pages": 0  }}
GET
/v1/geographie/distance

Query Parameters

from*string

Place identifier or "latitude,longitude".

Length1 <= length
to*string

Place identifier or "latitude,longitude".

Length1 <= length

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/geographie/distance?from=reg_om6lpn2l&to=14.7910%2C-16.9359"
{  "avertissements": [    "string"  ],  "description": "string",  "distance_km": 0.1,  "distance_m": 0,  "from": {    "entree": "string",    "lat": 0.1,    "lieu": {      "contexte": "Dakar Plateau, Dakar, Dakar",      "coordonnees": {        "lat": 0.1,        "lon": 0.1,        "precision": "region"      },      "id": "string",      "level": "region",      "name": "string",      "name_source": "string",      "parent_id": "string",      "population_2023": 0    },    "lon": 0.1,    "precision": "string"  },  "methode": "vol_oiseau",  "to": {    "entree": "string",    "lat": 0.1,    "lieu": {      "contexte": "Dakar Plateau, Dakar, Dakar",      "coordonnees": {        "lat": 0.1,        "lon": 0.1,        "precision": "region"      },      "id": "string",      "level": "region",      "name": "string",      "name_source": "string",      "parent_id": "string",      "population_2023": 0    },    "lon": 0.1,    "precision": "string"  }}
GET
/v1/geographie/rattacher

Query Parameters

lat*number
Formatdouble
Range12.3 <= value <= 16.7
lon*number
Formatdouble
Range-17.6 <= value <= -11.3

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/geographie/rattacher?lat=14.6928&lon=-17.4467"
{  "arrondissement": {    "id": "string",    "lat": 0,    "level": "string",    "lon": 0,    "name": "string",    "name_source": "string",    "parent_id": "string",    "population_2023": 0,    "search_key": "string"  },  "avertissements": [    "string"  ],  "commune": {    "id": "string",    "lat": 0,    "level": "string",    "lon": 0,    "name": "string",    "name_source": "string",    "parent_id": "string",    "population_2023": 0,    "search_key": "string"  },  "departement": {    "id": "string",    "lat": 0,    "level": "string",    "lon": 0,    "name": "string",    "name_source": "string",    "parent_id": "string",    "population_2023": 0,    "search_key": "string"  },  "distance_centroide_km": 0,  "lat": 0.1,  "lon": 0.1,  "methode": "contour",  "precision": "string",  "region": {    "id": "string",    "lat": 0,    "level": "string",    "lon": 0,    "name": "string",    "name_source": "string",    "parent_id": "string",    "population_2023": 0,    "search_key": "string"  },  "sources": [    {      "licence": "string",      "official": true,      "title": "string",      "url": "string"    }  ]}
GET
/v1/geographie/{id}

Path Parameters

id*string

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/geographie/string"
{  "ancestors": [    {      "id": "string",      "lat": 0,      "level": "string",      "lon": 0,      "name": "string",      "name_source": "string",      "parent_id": "string",      "population_2023": 0,      "search_key": "string"    }  ],  "children": [    {      "id": "string",      "lat": 0,      "level": "string",      "lon": 0,      "name": "string",      "name_source": "string",      "parent_id": "string",      "population_2023": 0,      "search_key": "string"    }  ],  "id": "string",  "lat": 0,  "level": "string",  "lon": 0,  "name": "string",  "name_source": "string",  "parent_id": "string",  "population_2023": 0,  "search_key": "string"}