Geocoding Address Requests
Detailed documentation on how to perform geocoding address requests using Cercalia’s Suggest API.
Geocoding Address Requests
To obtain the exact coordinates of a specific address (including house number), you need to use the parameters returned from the selected candidate in the suggestions response and make a geocoding request with these parameters:
Request Parameters
Parameter | Description | Example |
---|---|---|
cmd | Fixed value cand | cand |
adr | Street name (including house number) | avinguda diagonal 200 |
ctn | Locality | barcelona |
pcode | Postal code | 08018 |
ctryc | Country code (ISO 3 characters) | ESP |
detcand | Fixed value 1 | 1 |
priorityfilter | Fixed value 1 | 1 |
Example Request:
https://lb.cercalia.com/services/json?key=YOUR_API_KEY&cmd=cand&adr=avinguda diagonal 200&ctn=barcelona&ctryc=ESP&detcand=1&priorityfilter=1
Response
The service returns a JSON object containing the geocoded address with its exact coordinates.
Example Response:
{
"cercalia": {
"cmd": "cand",
"version": "1",
"candidates": {
"num": "1",
"pos": "0",
"total": "1",
"candidate": {
"desc": "Avinguda Diagonal, 200 (Barcelona)",
"name": "Avinguda Diagonal",
"source": "cercalia",
"ge": {
"id": "ESP080193000092155",
"name": "Avinguda Diagonal",
"prefix": "Avinguda",
"sname": "Diagonal",
"type": "adr1",
"name": "Avinguda Diagonal, 200",
"housenumber": "200",
"postalcode": {
"country_id": "ESP",
"id": "08018"
},
"city": {
"id": "ESP17240008430951",
"value": "Barcelona"
},
"municipality": {
"id": "ESP080193",
"value": "Barcelona"
},
"subregion": {
"id": "ESP08",
"value": "Barcelona"
},
"region": {
"id": "ESPCAT",
"value": "Catalunya"
},
"country": {
"id": "ESP",
"value": "Spain"
},
"coord": {
"x": "2.165638",
"y": "41.387917"
}
}
}
},
"server": "http://cercalia-tomcat-lbs-instance3:8080"
}
}
Note: Replace YOUR_API_KEY with your actual API key provided by Cercalia.
For more detailed information, refer to the Cercalia Suggest API Documentation.