Aller au contenu

Géographie

Régions, départements, arrondissements et communes, avec leurs parents et enfants.

Essayer depuis cette page

Le bouton « Essayer » appelle l'API depuis votre navigateur. Sans clé, l'appel compte dans le quota anonyme (100 appels par jour et par adresse IP) ; avec une clé dans le champ Authorization, le quota passe à 1 000. La clé reste dans votre navigateur. Obtenir une clé
GET
/v1/geographie

Paramètres de requête

page?integer
Formatint64
Plage1 <= value
Par défaut1
per_page?integer
Formatint64
Plage1 <= value <= 100
Par défaut20
level?string

Valeurs possibles

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

Sans accents ni casse ; « thies » trouve Thiès.

Longueur1 <= length

Corps de la réponse

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

Paramètres de requête

from*string

Identifiant de lieu ou « latitude,longitude ».

Longueur1 <= length
to*string

Identifiant de lieu ou « latitude,longitude ».

Longueur1 <= length

Corps de la réponse

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

Paramètres de requête

lat*number
Formatdouble
Plage12.3 <= value <= 16.7
lon*number
Formatdouble
Plage-17.6 <= value <= -11.3

Corps de la réponse

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"    }  ]}

Un lieu avec ses ancêtres et ses enfants

GET
/v1/geographie/{id}

Paramètres de chemin

id*string

Corps de la réponse

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"}