Address search guide
Practical guide with examples: how to send requests, choose outputs and use
all service features. Each section includes a runnable curl example and
a sample response.
https://pump.elemroot.com/jgc_rest (key key=docs_3d4e64fa1755d7299cb78bf6, dataset
gl=ee_aid). Replace the key and dataset with your own values.
- Endpoint and methods
- Parameter reference
- First request
- Refining with postal code
- Output formats
- json2 / xml2 (flat)
- ads_liik_staatus
- Coordinate reference systems
- Bulk request
- Lookup by id (aidq)
- Cadastral identifier
- Multiple datasets
- Searching Estonian addresses
- Searching Latvian addresses
- Searching Lithuanian addresses
- Result count and accuracy
- Location bias (ll + spn)
- Autocomplete (ac)
- Skipping words (st)
- Extended data (xd)
- Rule sets (rs)
- XAL2 type replacement
- JSONP (callback)
- Which combination to use
- Error handling
Endpoint and methods
The service supports the GET and POST methods (POST with application/x-www-form-urlencoded). NB: with POST the key must be in the query string (the URL); a key given only in the form body is not seen by the key check and the response is 403.
| Method | URL | Parameters |
|---|---|---|
GET | /jgc_rest/geocode | in the query string |
POST | /jgc_rest/geocode | in the form body (key in the query string) |
Parameter reference
| Param | Meaning | Allowed values / example | Default |
|---|---|---|---|
q * | Input address, up to 200 characters (repeat = batch) | Muuseumi tee 2; with postal code Muuseumi tee 2, 75303 | — |
aidq | q is an address id (AADRESS_ID), not address text (boolean) | true / empty value | — |
gl * | Dataset (repeatable: several countries in one request) | ee, ee_aid, ee_kt, ee_aid_kt, lv, lt | — |
output | Output format: json2 is what returns AddressLines | json, json2, xml, xml2, kml, ads_liik_staatus | json |
key * | API key (without it: 403) | docs_3d4e64fa1755d7299cb78bf6 (demo) | — |
srs | Output coordinate system | EPSG:4326, EPSG:3301 (case-insensitive; aliases wgs84, l-est97): anything else returns 400 | EPSG:4326 |
maxcount | Max matches per address | integer 1…1000: larger returns 400; 0 returns an empty response; a non-numeric value is ignored (10 applies) | 10 |
st | Max skipped words (noisy input) | 0, 1, 2… | 0 |
ll | Preference centre: works only together with spn | 58.38,26.72 | — |
spn | Window size: works only together with ll | 0.2,0.4 | — |
ac | Autocomplete: expands the last input token (boolean) | true / empty value | — |
xd | Extended data: how the input was interpreted (boolean) | true / empty value | — |
rs | Rule set: reverse reverses the address string order (most specific first); A2A3 adds A3 children under an A2 match | reverse, A2A3: an unknown value returns 400 | — |
replaceType | Type code rename (repeatable, not comma-separated) | A5 street | — |
callback | JSONP callback | function name, e.g. cb | — |
rid | Request ID: goes to the log only | free string | — |
sid | Session ID: goes to the log only | free string | — |
Datasets (gl):
gl | Dataset |
|---|---|
ee | Estonia (the same data without the AADRESS_ID line) |
ee_aid | Estonia with the address ID (AADRESS_ID): recommended for Estonia |
ee_kt | Estonia; like ee, plus the KATASTRITUNNUS line |
ee_aid_kt | Estonia with the address ID and cadastral identifier (AADRESS_ID and KATASTRITUNNUS) |
lv | Latvia |
lt | Lithuania |
Repeat gl to search multiple datasets at once (e.g. &gl=ee_aid&gl=lv).
gl values.
- The reverse-geocoding combined value
ee_lt_lvis not valid here; on geocoding it returns400. For a Baltic search, repeat the parameter:&gl=ee_aid&gl=lv&gl=lt. - In rural Latvia the village and house name share one address part
(e.g.
Dzērbene Ciedras: village Dzērbene, house Ciedras). The search also tolerates spelling without diacritics (DzerbenefindsDzērbene). - The
AADRESS_IDin LV/LT responses is the national register code. In address selection (gazetteer) the same object carries a level prefix:7for a building,8for an apartment (101020361→7101020361); see IDs and fields in LV/LT responses. Estonian (ee_aid) IDs match the address selection IDs directly.
ac, aidq, xd:
parameter present empty (&ac) or &ac=true means true;
absent parameter means false.
NB: any other value counts as false; including
ac=1,
ac=yes, ac=on.
First request
Requestcurl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2&gl=ee_aid&output=json&key=docs_3d4e64fa1755d7299cb78bf6"
Response (json, truncated: first match shown)
[
{
"name": "Muuseumi tee 2",
"placemark": [
{
"address": "Eesti Vabariik, Tartu maakond, Tartu linn, Tartu linn, Muuseumi tee 2",
"AddressDetails": { "Accuracy": "8" },
"LatLonBox": {
"east": 26.756282629776482,
"south": 58.39077394011176,
"north": 58.40077393988824,
"west": 26.736282630223517
},
"point": { "coordinates": [26.74628263, 58.39577394] },
"relevance": 0.1004990025510281
}
]
}
]
The response is an array: one object per input address. Field name
echoes the input; placemark contains matches sorted by relevance (highest
relevance first). Coordinates are in [E, N] order
(for EPSG:4326: [longitude, latitude]).
ee_aid, json/xml output
AddressDetails contains only the
Accuracy field. Structured components (country, county, street, EHAK,
postal code, etc.) come from json2/xml2: see below.
Refining with postal code
The same street name may exist in several places in Estonia. To find the correct address in the right place, add a postal code (5 digits) to the input; the service detects it and filters matches to the correct region.
Request WITHOUT postal code: multiple locationscurl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2&gl=ee_aid&output=json2&maxcount=5&key=docs_3d4e64fa1755d7299cb78bf6"
Response (truncated: two different "Muuseumi tee 2")
Eesti Vabariik, Tartu maakond, Tartu linn, Tartu linn, Muuseumi tee 2 (postal code 60532)
Eesti Vabariik, Harju maakond, Rae vald, Lagedi alevik, Muuseumi tee 2 (postal code 75303)
Eesti Vabariik, Tartu maakond, Tartu linn, Tartu linn, Muuseumi tee 2/1 (postal code 60532)
Request with postal code 75303: exactly the correct address
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2,+75303&gl=ee_aid&output=json2&srs=EPSG:3301&key=docs_3d4e64fa1755d7299cb78bf6"
Response (json2, truncated)
[
{
"name": "Muuseumi tee 2, 75303",
"placemark": [
{
"address": "Eesti Vabariik, Harju maakond, Rae vald, Lagedi alevik, Muuseumi tee 2",
"AddressDetails": {
"AddressLines": [
{ "Type": "A0", "Value": "Eesti Vabariik" },
{ "Type": "A1", "Value": "Harju maakond" },
{ "Type": "A2", "Value": "Rae vald" },
{ "Type": "A3", "Value": "Lagedi alevik" },
{ "Type": "A5", "Value": "Muuseumi tee" },
{ "Type": "A7", "Value": "2" },
{ "Type": "A1_EHAK", "Value": "0037" },
{ "Type": "A2_EHAK", "Value": "0653" },
{ "Type": "A3_EHAK", "Value": "4043" },
{ "Type": "POSTCODE", "Value": "75303" },
{ "Type": "AADRESS_ID", "Value": "772374" },
{ "Type": "A_STAATUS_ID", "Value": "1" }
],
"Accuracy": "8"
},
"point": { "coordinates": [553474.2797853436, 6583771.550346661] },
"relevance": 0.09405935760739681
}
]
}
]
q=Muuseumi tee 2, 75303 (comma optional). The service
detects a 5-digit postal code and uses it to refine location. In the URL encode
spaces (+ or %20).
Output formats
Same request with different output values.
xml
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2&gl=ee_aid&output=xml&key=docs_3d4e64fa1755d7299cb78bf6"
Response (truncated: first match)
<?xml version='1.0' encoding='UTF-8'?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Response>
<name>Muuseumi tee 2</name>
<Placemark>
<address>Eesti Vabariik, Tartu maakond, Tartu linn, Tartu linn, Muuseumi tee 2</address>
<LatLonBox>
<north>58.40077393988824</north><south>58.39077394011176</south>
<east>26.756282629776482</east><west>26.736282630223517</west>
</LatLonBox>
<Point><coordinates>26.74628263,58.39577394</coordinates></Point>
<relevance>0.1004990025510281</relevance>
<AddressDetails Accuracy="8" />
</Placemark>
</Response>
</kml>
kml (Google Earth)
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2&gl=ee_aid&output=kml&key=docs_3d4e64fa1755d7299cb78bf6"
Same structure as xml, but Content-Type is application/vnd.google-earth.kml+xml, suitable for Google Earth / map apps directly.
json2 / xml2: flat structured address
json2 and xml2 return the address as a list
(AddressLines). Each line is a typed component
(Type, optional Subtype, Value).
Dataset ee_aid uses type codes A0, A1, …
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2&gl=ee_aid&output=json2&key=docs_3d4e64fa1755d7299cb78bf6"
Response (json2)
[
{
"name": "Muuseumi tee 2",
"placemark": [
{
"address": "Eesti Vabariik, Tartu maakond, Tartu linn, Tartu linn, Muuseumi tee 2",
"AddressDetails": {
"AddressLines": [
{ "Type": "A0", "Value": "Eesti Vabariik" },
{ "Type": "A1", "Value": "Tartu maakond" },
{ "Type": "A2", "Value": "Tartu linn" },
{ "Type": "A3", "Value": "Tartu linn" },
{ "Type": "A5", "Value": "Muuseumi tee" },
{ "Type": "A7", "Value": "2" },
{ "Type": "A1_EHAK", "Value": "0079" },
{ "Type": "A2_EHAK", "Value": "0793" },
{ "Type": "A3_EHAK", "Value": "8151" },
{ "Type": "POSTCODE", "Value": "60532" },
{ "Type": "AADRESS_ID", "Value": "3069760" },
{ "Type": "A_STAATUS_ID", "Value": "1" }
],
"Accuracy": "8"
},
"LatLonBox": { "east": 26.756282629776482, "south": 58.39077394011176,
"north": 58.40077393988824, "west": 26.736282630223517 },
"point": { "coordinates": [26.74628263, 58.39577394] },
"relevance": 0.1004990025510281
}
]
}
]
Type code meanings:
| Type | Meaning |
|---|---|
A0 | Country |
A1 / A1_EHAK | County / county EHAK code |
A2 / A2_EHAK | Municipality / municipality EHAK code |
A3 / A3_EHAK | Settlement unit / settlement EHAK code |
A4 | Small place (e.g. an allotment association; the house number can sit directly under it) |
A5 | Thoroughfare (street/road) |
A6 | Name (e.g. a farm name; an address without a number) |
A7 | Address number (house number) |
A8 | Apartment number |
POSTCODE | Postal code |
AADRESS_ID | Address ID |
A_STAATUS_ID | Address status ID |
KATASTRITUNNUS | Cadastral identifier (datasets ee_kt and ee_aid_kt; see Cadastral identifier) |
AADRESS_ID with this same
service: add aidq=true (see Address lookup by id). When you
need the whole address record together with its parent chain, use the
address selection (gazetteer) getDescription
endpoint.
XML equivalent (output=xml2) wraps lines in <AddressLines>:
<AddressDetails Accuracy="8">
<AddressLines>
<AddressLine Type="A0">Eesti Vabariik</AddressLine>
<AddressLine Type="A1">Tartu maakond</AddressLine>
<AddressLine Type="A2">Tartu linn</AddressLine>
<AddressLine Type="A3">Tartu linn</AddressLine>
<AddressLine Type="A5">Muuseumi tee</AddressLine>
<AddressLine Type="A7">2</AddressLine>
<AddressLine Type="A1_EHAK">0079</AddressLine>
<AddressLine Type="A2_EHAK">0793</AddressLine>
<AddressLine Type="A3_EHAK">8151</AddressLine>
<AddressLine Type="POSTCODE">60532</AddressLine>
<AddressLine Type="AADRESS_ID">3069760</AddressLine>
<AddressLine Type="A_STAATUS_ID">1</AddressLine>
</AddressLines>
</AddressDetails>
ads_liik_staatus (Estonian-named fields)
For the Estonian address dataset there is a separate XML format ads_liik_staatus,
returning the address as Estonian-named fields (EHAK codes, status, postal code, etc.):
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2&gl=ee_aid&output=ads_liik_staatus&key=docs_3d4e64fa1755d7299cb78bf6"
<?xml version='1.0' encoding='UTF-8'?>
<aadressideNimekiri>
<aadress>
<aadressSisse>Muuseumi tee 2</aadressSisse>
<vaste>
<aid>3069760</aid>
<maakondEhak>0079</maakondEhak>
<maakond>Tartu maakond</maakond>
<omavalitsusEhak>0793</omavalitsusEhak>
<omavalitsus>Tartu linn</omavalitsus>
<asustusyksusEhak>8151</asustusyksusEhak>
<asustusyksus>Tartu linn</asustusyksus>
<liikluspind>Muuseumi tee</liikluspind>
<aadressinumber>2</aadressinumber>
<sihtnumber>60532</sihtnumber>
<aadressValja>Eesti Vabariik, Tartu maakond, Tartu linn, Tartu linn, Muuseumi tee 2</aadressValja>
<abStaatusId>1</abStaatusId>
<vastavuseHeadus>Korras</vastavuseHeadus>
<koordinaadid>26.74628263,58.39577394</koordinaadid>
<relevantsus>0.1004990025510281</relevantsus>
<latLonBox>
<north>58.40077393988824</north><south>58.39077394011176</south>
<east>26.756282629776482</east><west>26.736282630223517</west>
</latLonBox>
</vaste>
</aadress>
</aadressideNimekiri>
Empty elements in the example (e.g. <korterinumber/>, <vaikekoht/>) are omitted for brevity. This format is available only on the Estonian datasets (ee, ee_aid).
Coordinate reference systems
Default EPSG:4326 (WGS84, degrees). For the Estonian projected system (metres)
use EPSG:3301 (L-EST97). The code is case-insensitive (epsg:3301 works)
and the aliases wgs84 / l-est97 are accepted too; any other value (bare
3301, EPSG:3857) returns 400. We recommend the canonical form.
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2&gl=ee_aid&srs=EPSG:3301&key=docs_3d4e64fa1755d7299cb78bf6"
Response (coordinates in metres, [Y, X])
"point": { "coordinates": [660545.9498807918, 6476102.220117778] },
"LatLonBox": {
"east": 661107.3382034153, "south": 6475521.90091788,
"north": 6476682.619832239, "west": 659984.3920757968
}
[longitude, latitude]. For L-EST97 [Y, X]: first is Y (east), second X (north); in the Estonian system the X axis points north.Bulk request
Multiple addresses at once: repeat q:
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2&q=Ülikooli+18&gl=ee_aid&maxcount=1&key=docs_3d4e64fa1755d7299cb78bf6"
Response (truncated: first match per address)
[
{
"name": "Muuseumi tee 2",
"placemark": [
{ "address": "Eesti Vabariik, Tartu maakond, Tartu linn, Tartu linn, Muuseumi tee 2",
"AddressDetails": { "Accuracy": "8" },
"point": { "coordinates": [26.74628263, 58.39577394] },
"relevance": 0.1004990025510281 }
]
},
{
"name": "Ülikooli 18",
"placemark": [
{ "address": "Eesti Vabariik, Tartu maakond, Tartu linn, Tartu linn, Ülikooli tänav 18",
"AddressDetails": { "Accuracy": "8" },
"point": { "coordinates": [26.71952943, 58.38076991] },
"relevance": 0.09787157650387346 }
]
}
]
Each input address gets its own object in the same order.
Address lookup by id (aidq)
If you have stored an address id (AADRESS_ID: the same number returned
in gl=ee_aid responses), you can look up its address directly with
aidq=true: every q value is then an id instead of address text.
The response is a regular geocoding response (all output formats and
srs/rs apply), so existing parsing works unchanged.
curl "https://pump.elemroot.com/jgc_rest/geocode?q=3069760&gl=ee_aid&aidq=true&output=json2&key=docs_3d4e64fa1755d7299cb78bf6"
Response (abbreviated)
[
{
"name": "3069760",
"placemark": [
{ "address": "Eesti Vabariik, Tartu maakond, Tartu linn, Tartu linn, Muuseumi tee 2",
"AddressDetails": { "AddressLines": [ …, { "Type": "AADRESS_ID", "Value": "3069760" }, … ] },
"point": { "coordinates": [26.74628263, 58.39577394] } }
]
}
]
- The response contains exactly the point whose
AADRESS_IDequals the requested id (normally 1 match). - An unknown or non-numeric id yields 0 results (
"name"present, noplacemark); not an error. qremains repeatable in id mode: several ids per request (see bulk).- Supported datasets:
ee,ee_aid,ee_kt,ee_aid_kt,lv,lt. For Estonia prefergl=ee_aidso the id is also visible in ordinary responses. For Latvia and Lithuania theAADRESS_IDis already present with plaingl=lv/gl=lt;lv_aidandlt_aiddo not exist and return400.
curl "https://pump.elemroot.com/jgc_rest/geocode?q=101020361&gl=lv&aidq=true&output=json2&key=docs_3d4e64fa1755d7299cb78bf6"
Response (abridged)
[
{
"name": "101020361",
"placemark": [
{ "address": "Latvija, Valmieras nov., Valmiera, Jumaras iela 195 k-1",
"AddressDetails": {
"AddressLines": [ …, { "Type": "A7", "Value": "195 k-1" },
{ "Type": "POSTCODE", "Value": "4201" },
{ "Type": "AADRESS_ID", "Value": "101020361" } ],
"Accuracy": "8" },
"point": { "coordinates": [25.390738, 57.520503] } }
]
}
]
Cadastral identifier
With the datasets ee_kt and ee_aid_kt every address gets an AddressLines
line KATASTRITUNNUS with the identifier of the cadastral parcel the address is on (format 79512:033:0039).
An apartment gets the cadastral identifier of its building. If an address has several parcels, they are in one
line separated by semicolons, and the parcel containing the address point comes first. Villages, streets and
administrative units have no cadastral identifier; the line is also omitted when the link to a parcel is not certain.
The line is returned in the json2 and xml2 formats. Other datasets are unchanged. The cadastral identifier is available for Estonian addresses only; the Latvian and Lithuanian datasets (lv, lt) do not have it.
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2,+Tartu+linn&gl=ee_aid_kt&output=json2&maxcount=1&key=docs_3d4e64fa1755d7299cb78bf6"
Response (abridged)
"AddressLines": [ …, {"Type": "POSTCODE", "Value": "60532"}, {"Type": "AADRESS_ID", "Value": "3069760"}, {"Type": "A_STAATUS_ID", "Value": "1"}, {"Type": "KATASTRITUNNUS", "Value": "79512:033:0039"} ]
Request by id (same line)
curl "https://pump.elemroot.com/jgc_rest/geocode?q=3069760&gl=ee_aid_kt&aidq=true&output=json2&key=docs_3d4e64fa1755d7299cb78bf6"
Also applies to /jgc_rest_lyh.
Multiple datasets
Search multiple datasets at once: repeat gl. Results are grouped by address and sorted by relevance.
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Pärnu+mnt+1&gl=ee_aid&gl=lv&key=docs_3d4e64fa1755d7299cb78bf6"
Searching Estonian addresses
The search handles both the official address and everyday spellings: the table below shows which forms return the same answer.
| What you search | Working forms | Example |
|---|---|---|
| Apartment | 1-1, 1/1, krt 1, also the longer dash 1–1 | Anne tn 1-1, Tartu |
| Named address without a street (farm etc.) | name and context in either order | Kuuse, Savalduma küla = Savalduma küla, Kuuse |
| Apartment under a named address | Kivimõisa-2 or Kivimõisa 2 | Oonurme küla, Kivimõisa 2 |
| Small place (allotment associations etc.) | abbreviation or full word: vkt = väikekoht, AÜ = aiandusühistu | Karla vkt 3 = Karla väikekoht 3 |
| Same name with several types | the type word narrows it down: park, mõis, tehnoküla etc. | Lucca park 2, Tabasalu (bare Lucca 2 returns Lucca tänav) |
| Street named with initials | also written together: AH Tammsaare = A. H. Tammsaare | AH Tammsaare 5, Tartu |
| Spelling without Estonian letters | y is read as ü | Pikk 1, Tyri finds Türi |
| Input with a country name | Eesti, EE, Estonia | EE, Tartu, Anne tn 1 |
| House number with a slash | 2/1 | Muuseumi tee 2/1 |
| Same street name in several places | add a postal code to the input | see refining with postal code |
What the punctuation means in an Estonian address:
- A hyphen separates the building and the apartment:
Anne tn 1-1is building 1, apartment 1; in the response the building is rowA7and the apartmentA8. The same applies to named addresses:Kivimõisa-2is apartment 2 of the Kivimõisa farm. - A slash in the house number means a parallel number of one building, not an
apartment:
Muuseumi tee 2/1is a separate building (A7=2/1). - A letter is part of the house number:
Anne tn 14a(A7=14a). - The search is lenient with input: an apartment is also found as
1/1orkrt 1; when the requested apartment does not exist, the building is returned.
Searching Latvian addresses
The Latvian address model differs from the Estonian one: the building name and number share one field, and the block (korpuss) sits inside it. Search handles every common spelling: the table below shows which forms return the same result.
| What you are looking for | Forms that work | Example |
|---|---|---|
| Building with a block | 195 k-1, 195 k1, 195k-1, 195 korpuss 1, 195 korp. 1 | Jumaras iela 195 k-1, Valmiera |
| Apartment | 7-1, 7 dz. 1; in a building with a block 195 k-1-11 | Gaujas iela 7 dz. 1, Valmiera |
| Named building (no street) | name and context in either order | Riņņi, Vecates pag. = Vecates pag., Riņņi |
| Administrative unit | abbreviation or full word | Vecates pag. = Vecates pagasts |
| Postal code | LV-4201 or 4201, before or after the address | Gaujas iela 7, LV-4201 |
- Diacritics are optional:
Rinni, Vecates pagastsfindsRiņņi. - In rural areas the village and the building name share one address part:
Dzērbene Ciedrasmeans the village Dzērbene and the building Ciedras. - A bare building name without context is found, but the answer is often ambiguous; there are many identically named holdings. Adding the village or the pagasts narrows it down.
- Fields in
AddressLines: streetA5, building number together with the blockA7, apartmentA8.A4andA6do not appear in Latvian responses. gl=lvresponses carryAADRESS_IDfor buildings, apartments and administrative units (not for streets); there is no separatelv_aiddataset.
Searching Lithuanian addresses
A Lithuanian address consists of the municipality (savivaldybė), the eldership (seniūnija, often absent in
cities), the settlement, the street and the house number; the block is part of the house number
(2A K1). The search accepts both the official postal form and everyday spellings; the table
below shows which forms return the same answer.
| What you search | Forms that work | Example |
|---|---|---|
| Settlement | nominative (Kaunas) or the official short form in the genitive (Kauno m., Ežeraičių k., Ežeraičių kaimas) | Ežeraičių g. 2, Ežeraičių k. |
| Official postal address | settlement, eldership and municipality as abbreviations | Ežeraičių g. 2, Ežeraičių k., Avižienių sen., Vilniaus r. sav. |
| Administrative unit | abbreviation or full word | Kauno m. sav. = Kauno miesto savivaldybė; Avižienių sen. = Avižienių seniūnija |
| House with a block | 2A K1, 2A k1, 2A K-1, 2A korp. 1, 2A korpusas 1 | Perkūno g. 2A K1, Rokiškis |
| Apartment | 4-2, 4 bt. 2, 4/2; in a block 15 K6-26 | Morkūnų g. 4 bt. 2, Sangailai |
| Village house without a street | settlement and number, context in either order | Lukštynė 4, Sužionių sen. = Sužionių seniūnija, Lukštynė 4 |
| Street type | abbreviation or full word | Neries krant. 16M = Neries krantinė 16M; Sodo 46 = Sodo g. 46 |
| Postal code | LT-85113 or 85113, before or after the address | Sodo g. 46, LT-85113 Naujoji Akmenė |
- Diacritics are optional:
Perkuno g. 2A K1, RokiskisfindsPerkūno g. 2A K1. 2A-1means apartment 1 in house 2A, not a block: a block is written2A K1.- The eldership comes back as line
A2; in cities without elderships the line is absent. - Administrative unit names are returned in the register's abbreviated form
(
Vilniaus miesto sav.,Kartenos sen.); both the abbreviation and the full word work as search terms. - Settlements are returned in the official register address form: towns in the nominative
(
Kaunas,Gelvonai), villages and farmsteads in the genitive with the type abbreviation (Ežeraičių k.,Lapkalnio vs.). Both forms work in queries:EžeraičiaifindsEžeraičių k.. This also distinguishes same-named settlements (townGelvonaivs villageGelvonų k.) directly in the result list. - Settlements with the same name in the same eldership (for example a village and a farmstead) give
several results; the type abbreviation (
Lapkalnio vs. 1) narrows it down. - Fields in
AddressLines: streetA5, house number including the blockA7, apartmentA8.A4andA6do not occur in Lithuanian responses. - A
gl=ltresponse carriesAADRESS_IDat every level: house and apartment (national register code) as well as municipality, eldership, settlement and street (register code); the same code works withaidq=true; there is no separatelt_aiddataset.
Result count and accuracy
By default up to 10 matches per address are returned. Limit with
maxcount:
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Tartu&gl=ee_aid&maxcount=3&key=docs_3d4e64fa1755d7299cb78bf6"
Matches are sorted by relevance. Each match includes:
| Field | Meaning |
|---|---|
relevance | Relevance score: higher is better. |
AddressDetails.Accuracy | Accuracy level (higher = more precise): see the value table below. |
Accuracy values:
| Accuracy | Level |
|---|---|
1 | Country |
2 | County |
3 | Municipality |
4 | Settlement unit or small place |
6 | Street (thoroughfare) |
8 | Building (address number or name) |
9 | Apartment |
These are the values that occur in the Estonian dataset; Latvia and Lithuania use
the same scale with their own administrative levels (a building is 8 there as well).
Location bias (ll + spn)
Restrict matches to a geographic window. ll is the centre
(lat,lon), spn the window size (spanLat,spanLon);
the window is ll ± spn/2.
ll alone or spn alone
does nothing: no window is created and the request behaves as if neither was given.
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Kesktee&gl=ee_aid&key=docs_3d4e64fa1755d7299cb78bf6"
# first match: Harju maakond, Tallinn, Pirita linnaosa, Kesktee
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Kesktee&gl=ee_aid&ll=58.38,26.72&spn=0.2,0.4&key=docs_3d4e64fa1755d7299cb78bf6"
# first match: Tartu maakond, Kastre vald, Haaslava küla, Kesktee
The window filters: matches outside it are not returned. To keep
them and re-rank yourself, omit the window and use a larger maxcount.
Autocomplete (ac)
For search-as-you-type enable ac: the engine expands the
last token of the input:
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseu&gl=ee_aid&output=json2&ac&maxcount=10&key=docs_3d4e64fa1755d7299cb78bf6"
Behaviour is level-based: the next level's continuations are offered:
- A street without a number → its houses;
a house number → that house's apartments. If
maxcountleaves room, the rest is filled with next-level rows:q=Pae tn 43→43, 43b, 43-1, 43-2 … - Word order does not matter:
Kannikese 33, Tartu linnandTartu linn, Kannikese 33return the same list. - Termination signal: a space or hyphen after the number
(
q=Tartu linn, Kannikese 33orq=Tartu linn, Kannikese 33-) limits the list to that house:33ais no longer offered.
relevance. Autocomplete
continuation rows (e.g. apartments under a house) come with
relevance: 0 and are full matches; a relevance > 0
filter would drop them.
Skipping words (st)
When the input has unknown or extra words, allow skipping them with
st (maximum skipped words):
curl "https://pump.elemroot.com/jgc_rest/geocode?q=ettevõte+OÜ+Muuseumi+tee+2&gl=ee_aid&st=2&key=docs_3d4e64fa1755d7299cb78bf6"
Higher st yields more matches but may reduce precision.
Extended data (xd)
xd=true adds an ExtendedData block to each match: how the input was
interpreted (matched words, recognised types, unknown tokens), input flat number, postal code, etc.
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2-1&gl=ee_aid&xd=true&st=1&key=docs_3d4e64fa1755d7299cb78bf6"
Response (ExtendedData section)
"ExtendedData": {
"recognizedTokens": [
{ "start": 15, "end": 16, "token": "1", "skipped": 0 }
],
"unrecognizedTokens": [],
"isCharsimApplied": false,
"isPostcodeSkipped": false,
"matchedTokens": [
{ "start": 0, "end": 12, "token": "Muuseumi tee", "skipped": 0 },
{ "start": 13, "end": 14, "token": "2", "skipped": 0 }
],
"skippedTokenCount": 0,
"inputFlatNumber": "1"
}
| Field | Meaning |
|---|---|
matchedTokens | Words matched as specific address values. |
recognizedTokens | Words whose type was recognised but were skipped. |
unrecognizedTokens | Unrecognised words. |
skippedTokenCount | How many words were skipped when finding a match (when st > 0). |
inputFlatNumber | Flat number detected from input (e.g. 1). |
isCharsimApplied | Whether fuzzy character matching was applied (typo tolerance). |
isPostcodeSkipped / inputPostcode | Whether postal code was skipped / input postal code. |
null), are omitted from the response. xd usage depends on the API key.Rule sets (rs)
Parameter rs selects the response rule set. Two supported values:
rs=reverse: the address string comes with its components in
reverse order (most specific first); the structured AddressLines and everything else stay
the same. Works on the _lyh service and on the LV/LT datasets too. Handy for direct display:
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2,+Tartu&gl=ee_aid&rs=reverse&maxcount=1&key=docs_3d4e64fa1755d7299cb78bf6"
Response (json, abridged)
"address": "Muuseumi tee 2, Tartu linn, Tartu linn, Tartu maakond, Eesti Vabariik"
Without rs: "Eesti Vabariik, Tartu maakond, Tartu linn, Tartu linn, Muuseumi tee 2". Same meaning as s=ADDRESS_reverse in reverse geocoding.
rs=A2A3: adds all A3-level sub-places under an A2-level (municipality) match (Estonian dataset only).
Useful for place-picker interfaces: a single request returns a municipality together with all of
its settlements, without separate catalogue requests. The row count is capped by maxcount (default 10):
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Saaremaa&gl=ee_aid&rs=A2A3&key=docs_3d4e64fa1755d7299cb78bf6"
The value is case-sensitive (REVERSE returns 400); an unknown rs value returns 400.
XAL2 type replacement (replaceType)
In json2/xml2 output you can rename component types.
Parameter form old new (space-separated pair), repeatable.
For example rename type A5 (thoroughfare) to street:
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2&gl=ee_aid&output=json2&replaceType=A5+street&key=docs_3d4e64fa1755d7299cb78bf6"
Response (changed line)
{ "Type": "street", "Value": "Muuseumi tee" }
400 Bad Request.JSONP (callback)
The service returns Access-Control-Allow-Origin: *; in a
modern browser plain fetch() is enough. JSONP remains for older clients.
For JSONP add callback: the response is wrapped in a function call:
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2&gl=ee_aid&callback=naita&key=docs_3d4e64fa1755d7299cb78bf6"
naita && naita([{"name":"Muuseumi tee 2","placemark":[{"address":"Eesti Vabariik, Tartu maakond, Tartu linn, Tartu linn, Muuseumi tee 2","AddressDetails":{"Accuracy":"8"},"point":{"coordinates":[26.74628263,58.39577394]},"relevance":0.1004990025510281}]}])
Content-Type is then application/javascript.
Which combination to use
Common tasks and the parameter combination for each.
| Task | Combination | Why |
|---|---|---|
| Structured address + address id | gl=ee_aid&output=json2 | json2 returns AddressLines, ee_aid adds AADRESS_ID |
| Coordinates only | output=json | default; smallest response, no components |
| Search-box autocomplete | ac&maxcount=10&output=json2 | expands the last input token |
| User is on a map: prefer nearby | ll=<lat,lon>&spn=<dLat,dLon> | both together; neither alone does anything |
| ID → address | aidq=true&gl=ee_aid&output=json2 | q is an AADRESS_ID; also gl=lv and gl=lt |
| Address with cadastral identifier | gl=ee_aid_kt&output=json2 | adds the AADRESS_ID and KATASTRITUNNUS lines; also works with aidq=true |
| A list of addresses in one request | q=A&q=B&q=C&maxcount=1 | each q gets its own result object; up to 1000 |
| Noisy input (company name first) | st=2 | allows up to 2 unknown words to be skipped |
| “Why did I get this match?” | xd=true | ExtendedData shows how the input was parsed |
| L-EST97 coordinates in metres | srs=EPSG:3301 | output is [Y, X]: easting first, northing second |
| Address fields with Estonian names | output=ads_liik_staatus | vaikekoht, liikluspind, korterinumber…; Estonia only |
| Municipality + all its settlements | rs=A2A3 | adds the A3 children under an A2 match |
Address most-specific-first (Muuseumi tee 2, Tartu linn, …) | rs=reverse | only the order of the address string changes; for display |
| Shorter address text | /jgc_rest_lyh/geocode | same JSON, shorter address string |
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseu&gl=ee_aid&output=json2&ac&maxcount=10&key=docs_3d4e64fa1755d7299cb78bf6"
Example: batch: three addresses in one request
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2&q=%C3%9Clikooli+18&q=Kannikese+33,+Tartu&gl=ee_aid&output=json2&maxcount=1&key=docs_3d4e64fa1755d7299cb78bf6"
The response contains three objects, in the same order as the input.
AddressLines comes from output=json2, not from gl: gl=ee_aid only adds one line (AADRESS_ID).
And reverse geocoding takes lat,lon as input, while the geocoding
response point.coordinates is [lon, lat].
Error handling
| Situation | Code | Message |
|---|---|---|
Unknown gl dataset | 400 | No dataset puudub |
Unknown output format | 400 | Unknown output format: zzz |
| Missing or wrong API key | 403 | {"error":"invalid_api_key"} (JSON) |
| Too many requests (demo key) | 429 | Too Many Requests |
Invalid replaceType rule | 400 | ... : bad replacement rule |
Unknown srs | 400 | Don't know how to convert coordinates ... |
maxcount above 1000 | 400 | Max result count too large: expected at most 1000, ... |
Unknown rs | 400 | ruleSetId not recognized: ... |
q longer than 200 characters | 400 | addresses[0] is too long: expected max 200 characters, ... |
| Internal error | 500 | error message |
curl -i "https://pump.elemroot.com/jgc_rest/geocode?q=Tartu&gl=puudub&key=docs_3d4e64fa1755d7299cb78bf6"
HTTP/1.1 400 Bad Request
Content-Type: text/html;charset=utf-8
<html><head><title>Apache Tomcat - Error report</title> ... </head>
<body> ... No dataset puudub ... </body></html>
The error body is an HTML error page containing the message (here "No dataset puudub").