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

ParameterDescriptionExample
cmdFixed value candcand
adrStreet name (including house number)avinguda diagonal 200
ctnLocalitybarcelona
pcodePostal code08018
ctrycCountry code (ISO 3 characters)ESP
detcandFixed value 11
priorityfilterFixed value 11

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"
  }
}
Last modified December 19, 2024: feat: markdown api http all (d8c23c1)