Introduction
This is the API endpoint and description for all terminaison in the banoc API
This documentation aims to provide all the information you need to work with our API.
Authenticating requests
This API is not authenticated.
Endpoints
Coordinates Geocoding
This method make a reverse geocode, so take longitude and latitude from query string and return the geocode available with the level
Example request:
curl --request GET \
--get "https://dev.api.banoc.coeurduweb.com/api/geocode/coordinates?latitude=4.015296&longitude=11.557123&level=155" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://dev.api.banoc.coeurduweb.com/api/geocode/coordinates"
);
const params = {
"latitude": "4.015296",
"longitude": "11.557123",
"level": "155",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"data": [
{
"gid": 1683577603,
"jurisd_local_id": 20904,
"l": 130,
"code_b32nvu": "FQS3",
"geom": "0103000020787F000001000000050000000000000070EC274100000000581D1B4100000000B0EC274100000000581D1B4100000000B0EC274100000000D81D1B410000000070EC274100000000D81D1B410000000070EC274100000000581D1B41",
"centroide": {
"type": "Point",
"coordinates": {
"lat": 11.557123313,
"lon": 4.015295585
}
},
"polygon": {
"type": "Polygon",
"coordinates": [
[
{
"lat": 11.556978868,
"lon": 4.015151433
},
{
"lat": 11.557266857,
"lon": 4.015150528
},
{
"lat": 11.557267758,
"lon": 4.015439738
},
{
"lat": 11.556979768,
"lon": 4.015440642
},
{
"lat": 11.556978868,
"lon": 4.015151433
}
]
]
}
}
]
}
Example response (404):
{
"message": "The geocode for latitude : 4.015296 and longitude : 11.557123 not found",
"error": "NOT_FOUND_GEOCODE",
"status": 404
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Multipoint geocodes
This endpoint is used to make a request with an array of points The return values is an array of the geocode.
Example request:
curl --request POST \
"https://dev.api.banoc.coeurduweb.com/api/geocode/multi-coordinates" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"points\": [
{
\"longitude\": 11.557123,
\"latitude\": 4.015296
},
{
\"longitude\": -74.006,
\"latitude\": 40.7128
}
],
\"level\": 155
}"
const url = new URL(
"https://dev.api.banoc.coeurduweb.com/api/geocode/multi-coordinates"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"points": [
{
"longitude": 11.557123,
"latitude": 4.015296
},
{
"longitude": -74.006,
"latitude": 40.7128
}
],
"level": 155
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": [
{
"point" : {
"longitude": 11.557123,
"latitude": 4.015296
}
"geocode" : {
"jurisd_local_id": 20904,
"code_b32nvu": "FQS3",
"l": 130,
"polygon": {
"type": "Polygon",
"coordinates": [
[
{
"lon": "11.557095",
"lat": "4.052170"
},
{
"lon": "11.557096",
"lat": "4.052459"
},
{
"lon": "11.557384",
"lat": "4.052459"
},
{
"lon": "11.557383",
"lat": "4.052169"
},
{
"lon": "11.557095",
"lat": "4.052170"
}
]
]
},
"centroide": {
"type": "Point",
"coordinates": {
"lon": "11.557240",
"lat": "4.052314"
}
},
"city": {
"jurisd_local_id": 20904,
"city": "Soa",
"iso_label": "CM-SOA",
"lon": "11.55",
"lat": "3.95",
"country_id": 1,
"created_at": "2024-10-03T14:59:54.000000Z",
"updated_at": "2024-10-03T14:59:54.000000Z"
}
}
}
]
}
Example response (404):
{
"data": [
{
"point" : {
"longitude": 11.557123,
"latitude": 4.015296
}
"geocode" : 404
}
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Geocoding from Banoc Code
This method make a search with banoc code, full or short and the jurisd_local_id that we need to check the city of the banoc code
Example request:
curl --request GET \
--get "https://dev.api.banoc.coeurduweb.com/api/geocode/code/FQS3/20904" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://dev.api.banoc.coeurduweb.com/api/geocode/code/FQS3/20904"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"data": [
{
"jurisd_local_id": 20904,
"code_b32nvu": "FQS3",
"l": 130,
"polygon": {
"type": "Polygon",
"coordinates": [
[
{
"lon": "11.557095",
"lat": "4.052170"
},
{
"lon": "11.557096",
"lat": "4.052459"
},
{
"lon": "11.557384",
"lat": "4.052459"
},
{
"lon": "11.557383",
"lat": "4.052169"
},
{
"lon": "11.557095",
"lat": "4.052170"
}
]
]
},
"centroide": {
"type": "Point",
"coordinates": {
"lon": "11.557240",
"lat": "4.052314"
}
},
"city": {
"jurisd_local_id": 20904,
"city": "Soa",
"iso_label": "CM-SOA",
"lon": "11.55",
"lat": "3.95",
"country_id": 1,
"created_at": "2024-10-03T14:59:54.000000Z",
"updated_at": "2024-10-03T14:59:54.000000Z"
}
}
]
}
Example response (404):
{
"message": "The geocode from code "FQS3" is not found",
"error": "NOT_FOUND_GEOCODE",
"status": 404
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
All occurence
API for returning all possible results, from BANOC Code, Nominatim or City lists
Example request:
curl --request GET \
--get "https://dev.api.banoc.coeurduweb.com/api/geocode/all?q=SOA&format=city%2Cbanoc&jurisd_local_id=20904" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://dev.api.banoc.coeurduweb.com/api/geocode/all"
);
const params = {
"q": "SOA",
"format": "city,banoc",
"jurisd_local_id": "20904",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"cities": [
{
"jurisd_local_id": 20904,
"city": "Soa",
"iso_label": "CM-SOA",
"lon": "11.55",
"lat": "3.95",
"country_id": 1,
"created_at": "2024-10-03T14:59:54.000000Z",
"updated_at": "2024-10-03T14:59:54.000000Z",
"l": 80,
"country": {
"id": 1,
"name": "Cameroun",
"created_at": "2024-09-06T13:58:23.000000Z",
"updated_at": "2024-09-06T13:58:23.000000Z"
}
}
],
"banoc_codes": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.