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.

Live examples. The requests and responses below were made against https://pump.elemroot.com/jgc_rest (key key=docs_382d376eaaa6d004b7b93b7d, dataset gl=ee_aid). Replace the key and dataset with your own values.
Contents

Endpoint and methods

Uses 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.

MethodURLParameters
GET/jgc_rest/geocodein the query string

Parameter reference

ParamMeaningAllowed values / exampleDefault
q *Input address, up to 200 characters (repeat = batch)Muuseumi tee 2; with postal code Muuseumi tee 2, 75303—
aidqq is an address id (AADRESS_ID), not address text (boolean)true / empty value—
gl *Dataset (repeatable: countries are merged)ee, ee_aid, lv, lt—
outputOutput format: json2 is what returns AddressLinesjson, json2, xml, xml2, kml, ads_liik_staatusjson
key *API key (without it: 403)docs_382d376eaaa6d004b7b93b7d (demo)—
srsOutput coordinate systemEPSG:4326, EPSG:3301 (case-insensitive; aliases wgs84, l-est97): anything else returns 400EPSG:4326
maxcountMax matches per addressinteger 1…1000: larger returns 400; 0 returns an empty response; non-numeric is ignored (10)10
stMax skipped words (noisy input)0, 1, 2…0
llPreference centre: works only together with spn58.38,26.72—
spnWindow size: works only together with ll0.2,0.4—
acAutocomplete: expands the last input token (boolean)true / empty value—
xdExtended data: how the input was interpreted (boolean)true / empty value—
rsRule set: reverse reverses the address string order (most specific first); A2A3 adds A3 children under an A2 matchreverse, A2A3: an unknown value returns 400—
replaceTypeType code rename (repeatable, not comma-separated)A5 street—
callbackJSONP callbackfunction name, e.g. cb—
ridRequest ID: goes to the log onlyfree string—
sidSession ID: goes to the log onlyfree string—

Datasets (gl):

glDataset
eeEstonia (simpler dataset; json returns only Accuracy)
ee_aidEstonian full dataset (AADRESS_ID, EHAK codes, AddressLines): recommended for Estonia
lvLatvia
ltLithuania

Repeat gl to search multiple datasets at once (e.g. &gl=ee_aid&gl=lv).

NB about geocoder gl values.
Boolean convention. Flags 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

Request
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2&gl=ee_aid&output=json&key=docs_382d376eaaa6d004b7b93b7d"
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]).

Dataset-specific. For dataset 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 locations
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2&gl=ee_aid&output=json2&maxcount=5&key=docs_382d376eaaa6d004b7b93b7d"
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_382d376eaaa6d004b7b93b7d"
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
      }
    ]
  }
]
How to provide. Add the postal code to the input address, e.g. q=Muuseumi tee 2, 75303 (comma optional). The postal code engine detects a 5-digit 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_382d376eaaa6d004b7b93b7d"
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_382d376eaaa6d004b7b93b7d"

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, …

Request
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2&gl=ee_aid&output=json2&key=docs_382d376eaaa6d004b7b93b7d"
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:

TypeMeaning
A0Country
A1 / A1_EHAKCounty / county EHAK code
A2 / A2_EHAKMunicipality / municipality EHAK code
A3 / A3_EHAKSettlement unit / settlement EHAK code
A4Small place (e.g. an allotment association; the house number can sit directly under it)
A5Thoroughfare (street/road)
A6Name (e.g. a farm name; an address without a number)
A7Address number (house number)
A8Apartment number
POSTCODEPostal code
AADRESS_IDAddress ID
A_STAATUS_IDAddress status ID
Lookup by ID. You can query by 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 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="POSTCODE">60532</AddressLine>
  </AddressLines>
</AddressDetails>

ads_liik_staatus (address type and status)

For the Estonian address dataset there is a separate XML format ads_liik_staatus, returning the address as Estonian-named fields (EHAK codes, types, 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_382d376eaaa6d004b7b93b7d"
<?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 when the server allows it for the dataset.

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.

Request (L-EST97)
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2&gl=ee_aid&srs=EPSG:3301&key=docs_382d376eaaa6d004b7b93b7d"
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
}
Order. For degrees [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:

Request
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2&q=Ülikooli+18&gl=ee_aid&maxcount=1&key=docs_382d376eaaa6d004b7b93b7d"
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.

Request
curl "https://pump.elemroot.com/jgc_rest/geocode?q=3069760&gl=ee_aid&aidq=true&output=json2&key=docs_382d376eaaa6d004b7b93b7d"
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] } }
    ]
  }
]
Request (Latvia)
curl "https://pump.elemroot.com/jgc_rest/geocode?q=101020361&gl=lv&aidq=true&output=json2&key=docs_382d376eaaa6d004b7b93b7d"
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] } }
    ]
  }
]

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_382d376eaaa6d004b7b93b7d"

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 searchWorking formsExample
Apartment1-1, 1/1, krt 1, also the typographic dash 1–1Anne tn 1-1, Tartu
Named address without a street (farm etc.)name and context in either orderKuuse, Savalduma küla = Savalduma küla, Kuuse
Apartment under a named addressKivimõisa-2 or Kivimõisa 2Oonurme küla, Kivimõisa 2
Small place (allotment associations etc.)abbreviation or full word: vkt = väikekoht, AÜ = aiandusühistuKarla vkt 3 = Karla väikekoht 3
Same name with several typesthe 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 initialsalso written together: AH Tammsaare = A. H. TammsaareAH Tammsaare 5, Tartu
Spelling without Estonian lettersy is read as üPikk 1, Tyri finds Türi
Input with a country nameEesti, EE, EstoniaEE, Tartu, Anne tn 1
House number with a slash2/1Muuseumi tee 2/1
Same street name in several placesadd a postal code to the inputsee refining with postal code

What the punctuation means in an Estonian address:

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 forForms that workExample
Building with a block195 k-1, 195 k1, 195k-1, 195 korpuss 1, 195 korp. 1Jumaras iela 195 k-1, Valmiera
Apartment7-1, 7 dz. 1; in a building with a block 195 k-1-11Gaujas iela 7 dz. 1, Valmiera
Named building (no street)name and context in either orderRiņņi, Vecates pag. = Vecates pag., Riņņi
Administrative unitabbreviation or full wordVecates pag. = Vecates pagasts
Postal codeLV-4201 or 4201, before or after the addressGaujas iela 7, LV-4201

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 searchForms that workExample
Settlementnominative (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 addresssettlement, eldership and municipality as abbreviationsEžeraičių g. 2, Ežeraičių k., Avižienių sen., Vilniaus r. sav.
Administrative unitabbreviation or full wordKauno m. sav. = Kauno miesto savivaldybė; Avižienių sen. = Avižienių seniūnija
House with a block2A K1, 2A k1, 2A K-1, 2A korp. 1, 2A korpusas 1Perkūno g. 2A K1, Rokiškis
Apartment4-2, 4 bt. 2, 4/2; in a block 15 K6-26Morkūnų g. 4 bt. 2, Sangailai
Village house without a streetsettlement and number, context in either orderLukštynė 4, Sužionių sen. = Sužionių seniūnija, Lukštynė 4
Street typeabbreviation or full wordNeries krant. 16M = Neries krantinė 16M; Sodo 46 = Sodo g. 46
Postal codeLT-85113 or 85113, before or after the addressSodo g. 46, LT-85113 Naujoji Akmenė

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_382d376eaaa6d004b7b93b7d"

Matches are sorted by relevance. Each match includes:

FieldMeaning
relevanceRelevance score: higher is better.
AddressDetails.AccuracyAccuracy level (higher = more precise): see the value table below.

Accuracy values:

AccuracyLevel
1Country
2County
3Municipality
4Settlement unit or small place
6Street (thoroughfare)
8Building (address number or name)
9Apartment

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.

Both are required. ll alone or spn alone does nothing: no window is created and the request behaves as if neither was given.
Request: same name, two regions
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Kesktee&gl=ee_aid&key=docs_382d376eaaa6d004b7b93b7d"
# 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_382d376eaaa6d004b7b93b7d"
# 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_382d376eaaa6d004b7b93b7d"

Behaviour is level-based: the next level's continuations are offered:

Do not filter by 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_382d376eaaa6d004b7b93b7d"

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.

Request
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2-1&gl=ee_aid&xd=true&st=1&key=docs_382d376eaaa6d004b7b93b7d"
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"
}
FieldMeaning
matchedTokensWords matched as specific address values.
recognizedTokensWords whose type was recognised but were skipped.
unrecognizedTokensUnrecognised words.
skippedTokenCountHow many words were skipped when finding a match (when st > 0).
inputFlatNumberFlat number detected from input (e.g. 1).
isCharsimAppliedWhether fuzzy character matching was applied (typo tolerance).
isPostcodeSkipped / inputPostcodeWhether postal code was skipped / input postal code.
Note. Fields with empty values (null), are omitted from the response. xd usage depends on the API key.

Rule sets (rs)

Parameter rs selects a server 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:

Request
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2,+Tartu&gl=ee_aid&rs=reverse&maxcount=1&key=docs_382d376eaaa6d004b7b93b7d"
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_382d376eaaa6d004b7b93b7d"

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:

Request
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2&gl=ee_aid&output=json2&replaceType=A5+street&key=docs_382d376eaaa6d004b7b93b7d"
Response (changed line)
{ "Type": "street", "Value": "Muuseumi tee" }
NB. Invalid rule (not exactly two space-separated parts) returns 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_382d376eaaa6d004b7b93b7d"
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. Every row is verified live.

TaskCombinationWhy
Structured address + address idgl=ee_aid&output=json2json2 returns AddressLines, ee_aid adds AADRESS_ID
Coordinates onlyoutput=jsondefault; smallest response, no components
Search-box autocompleteac&maxcount=10&output=json2expands the last input token
User is on a map: prefer nearbyll=<lat,lon>&spn=<dLat,dLon>both together; neither alone does anything
ID → addressaidq=true&gl=ee_aid&output=json2q is an AADRESS_ID; also gl=lv and gl=lt
A list of addresses in one requestq=A&q=B&q=C&maxcount=1each q gets its own result object; up to 1000
Noisy input (company name first)st=2allows up to 2 unknown words to be skipped
“Why did I get this match?”xd=trueExtendedData shows how the input was parsed
L-EST97 coordinates in metressrs=EPSG:3301output is [Y, X]: easting first, northing second
Address fields with Estonian namesoutput=ads_liik_staatusvaikekoht, liikluspind, korterinumber…; Estonia only
Municipality + all its settlementsrs=A2A3adds the A3 children under an A2 match
Address most-specific-first (Muuseumi tee 2, Tartu linn, …)rs=reverseonly the order of the address string changes; for display
Shorter address text/jgc_rest_lyh/geocodesame JSON, shorter address string
Example: search-box autocomplete
curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseu&gl=ee_aid&output=json2&ac&maxcount=10&key=docs_382d376eaaa6d004b7b93b7d"
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_382d376eaaa6d004b7b93b7d"

The response contains three objects, in the same order as the input.

The two most common surprises. 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

SituationCodeMessage
Unknown gl dataset400No dataset puudub
Unknown output format400Unknown output format: zzz
Missing or wrong API key403gateway error page (HTML)
Too many requests (demo key)429Too Many Requests
Invalid replaceType rule400... : bad replacement rule
Internal error500error message
Example: unknown dataset
curl -i "https://pump.elemroot.com/jgc_rest/geocode?q=Tartu&gl=puudub&key=docs_382d376eaaa6d004b7b93b7d"

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 a Tomcat HTML error page containing the message (here "No dataset puudub").


API reference (Swagger UI) → Interactive try-it-out for every parameter. OpenAPI spec (YAML file) → Machine-readable API description for tooling. Note: opens as a raw YAML file.