Geocoding API

The API gives the coordinates and full address information of the given address string.

API URL

The request URL should match the following pattern:

https://api.kartes.lv/v3//geocoding?

By default, the response is given in JSON (JSONP and XML are also available).

The HTTP GET request method is used.

  • client_key: Your authorisation key.

Query parameters

The request consists of the following GET parameters:

Parameter Description Possible values
address Address string.
limit Maximum number of returned results. Up to 25 objects can be returned.
LVA Use it if the API should search only in Latvia.
result_data_type Output format. JSON is the default option.
  • json
  • jsonp
  • xml
callback Use it if you use result_data_type=jsonp.

Response parameters

The response consists of the following parameters.

Parameter Description
gid Unique ID.
valsts Country name.
admin_vien Administrative unit.
terit_vien Territorial unit.
apdz_vieta Populated place (city, town or village)
iela Street name.
maja House name or number.
index Postal code.
korpuss Building block number.
x x-coordinate in the TM Baltic93 CRS (EPSG:25884).
y y-coordinate in the TM Baltic93 CRS (EPSG:25884).
lat Latitude coordinate in the WGS-84 projection (EPSG:4326).
lon Longitude coordinate in the WGS-84 projection (EPSG:4326).
adrese Full address.

Examples

Input:

https://api.kartes.lv/v3//geocoding?address=Brīvības&limit=1

Response:

[
    {
        "gid":"986092",
        "valsts":"Latvija",
        "admin_vien":"Daugavpils novads",
        "terit_vien":"Kalkūnes pagasts",
        "apdz_vieta":"",
        "iela":"",
        "maja":"Brīvības",
        "index":"LV-5449",
        "korpuss":"",
        "x":"652299.94",
        "y":"6186490.52",
        "address_hash":"f538eaf5b9be8137195f3b2d8cf5d472",
        "lat":55.799987,
        "lon":26.4297,
        "adrese":"Brīvības, Kalkūnes pag., Daugavpils nov., Latvija"
    }
]