For developers

API documentation

An HTTP API for standardizing addresses in Kazakhstan. It takes a free-form address in Russian or Kazakh — with typos, abbreviations and extra words — and returns the “region → city → street → building” hierarchy with KATO, RCO and RCA codes, postal codes and coordinates from the state address register.

Base URL
https://api.qaida.io
Authentication
X-Api-Key: <your key>
Format
JSON, UTF-8
Get an API key
Getting started

What you can get

Everything the API returns, in one table. Items marked “soon” are in development and documented ahead of time. Fields marked “extra access” are opened on request; without it the value comes as the string "*****".

DataFieldHow to get it
Address
The address as one line in Russian and Kazakhfull_path_rus, full_path_kaz/parse
Region, district, city, rural district, village, street, building — each level separatelyhierarchy/parse
KATO code of the administrative unitcato/parse
RCO of the street and the administrative unitrco/parse
RCA of the buildingrca/parse
New postcodepostcode/parse
Old postcodeoldPostcode/parse
extra access Cadastral number of the buildingcadastre_number/parse
extra access Cadastral number of the land plot the building stands onland_cadastre_number/parse
Building coordinatespoint/parse
Apartment or office from the inputmatch.requested_unit/parse
Match quality
Whether the apartment or office from the input is in the Address Registermatch.unit_status/parse, see Apartment and office
How deep the address was foundmatch.level/parse
Match type: exact, alternative spelling, corrected, ambiguous, partialmatch.type/parse
Corrections: typos, house number substitution, former city namematch.corrections/parse
What from the input was not foundmatch.unmatched/parse
The city in the input contradicts the given onescope_conflictscope parameter
Ways to search
Suggestions as the user typessuggestions/suggest, /suggest/compact
Apartments of a house in suggestionskind: "apartment"units=true on /suggest and /suggest/compact
A street without a city: houses across the countrysearch/parse and /suggest by default — the extended parameter; /parse/extended, /suggest/extended
Search only inside a region or cityscopescope parameter, /parse/region, /parse/city
Up to 100 addresses in one requestitems/parse/batch
Address by new or old postcode, or by RCAresults/lookup
Buildings near a point and the distance to themdistance_m, shared_point/nearby
Extra data
soon Region boundarygeometryinclude=region_polygon
soon City or village boundarygeometryinclude=city_polygon
soon Building footprintgeometryinclude=building_polygon
extra access Housing sale price per m²market.sale_m2include=prices
extra access Housing rent price per m²market.rent_m2include=prices
Year builtyear_builtinclude=building_info
extra access Floor countfloorsinclude=building_info
Residential complex namecomplex_nameinclude=building_info
extra access Number of flats in the buildingflats_countinclude=building_info
extra access Number of non-residential premises in the buildingnon_residential_countinclude=building_info
Apartment or office from the input, per the Address Register: kind and numbertype: "apartment" node in hierarchyinclude=apartment
extra access RCA of the apartment or officerca in the unit nodeinclude=apartment
Drop unneeded fields: RCA, KATO, postcodes and more—exclude=rca,cato

Quick start

One request, one address. The key goes in a header and the address in the q parameter. Cyrillic in a query string must be URL-encoded: curl has --data-urlencode for that, and HTTP libraries do it when you pass parameters as a separate dictionary.

curl -G https://api.qaida.io/parse \
  -H "X-Api-Key: $QAIDA_API_KEY" \
  --data-urlencode "q=астана кабанбай батыра 11/5" \
  -d top_k=1

The response lists candidates, best first. Each one has the node hierarchy, a ready-made address line in both languages, a coordinate and an assessment of how closely the input matched. The full response to this request is under GET /parse.

OpenAPI 3.1 description, for importing into Postman and generating clients: qaida.io/openapi.json.

API key

  • Keys are issued in the cabinet after you sign up.
  • Send the key in the X-Api-Key header on every request except /demo/*. It is 48 characters: digits and lowercase Latin letters a–f. Send exactly one such header; keys in URL parameters are not accepted.
  • The /demo/parse, /demo/suggest, /demo/lookup, /demo/nearby endpoints and the /demo/parse/extended, /demo/suggest/extended variants serve the sandbox on qaida.io. They need no key, are limited per IP and are not meant for integration. They have no include, exclude or units parameters. The response is reduced: KATO, RCO and postcodes are returned, while the RCA and cadastre numbers come as the string "*****"; there are no internal identifiers. /demo/parse shows an apartment or office from the input the same way as include=apartment — as the last hierarchy node, with its RCA masked; demo suggestions have no apartments.
  • A missing, malformed or revoked key returns 401.
  • Rotate or revoke your main key in the cabinet profile. Additional keys are issued and revoked on request at qaida@tenzor-ai.com. A revoked key stops working within a minute.
  • POST /parse/batch requires separate batch access. Without it the request gets 403. Ask for it at the same address.
A server key is for the server only
Call the API from your backend. Browser requests from other domains are blocked by CORS, and a key in client code is visible to every visitor. If your users type addresses in your app, proxy the requests through your server. For a map and an address field on a web page there is a browser key bound to the website — see Map on your website.

Request and response format

  • GET parameters go in the query string, UTF-8 and URL-encoded. A POST body is JSON with Content-Type: application/json.
  • Responses are UTF-8 JSON and are not cached: Cache-Control: no-store.
  • An address string is 1 to 200 characters.
  • point is a [lon, lat] pair: longitude first, as in GeoJSON. Without a coordinate it is [null, null].
  • Coordinates are stored to about one metre. Digits beyond the fifth decimal place are storage noise, not extra precision.
  • An empty results or suggestions list is a normal 200 response meaning the address was not found. It is not an error.

Register codes in responses

CodeFieldShapeMeaning
KATOcato9 digits, 750000000Classifier of administrative-territorial units: region, city, district, village
RCOrco13 digitsAddress-register object code: an administrative unit or a street
RCArca15 digitsAddress-register code of a building
Unit RCArca in the unit node16 digitsAddress-register code of an apartment or office, with extra access. See Apartment and office
New postcodepostcodeZ05T9X8Building postcode: letter, two digits, letter, digit, letter, digit
Old postcodeoldPostcode"010000"Six-digit post-office code. Sent as a string so the leading zero is kept

KATO, RCO and RCA are JSON numbers. All of them are below 2^53 and safe to read in JavaScript, but store them as strings or 64-bit integers.

Limits

Request rates are limited per account, not per IP address: all your servers and all users of your service share one allowance. Parsing (/parse, /parse/extended, the level endpoints, /lookup, /nearby), suggestions (every /suggest) and batch processing are counted separately.

When the allowance runs out, the server returns 429 with a Retry-After header saying how many seconds to wait. The allowance refills gradually, so short bursts get through while a sustained stream above the limit does not.

  • One /parse/batch request holds at most 100 addresses.
  • A request body is at most 256 KB.
  • Under overload the server answers 503 with Retry-After: 1 right away instead of queueing the request. Service status is on the Status page.
  • For your account’s limits or an increase, write to qaida@tenzor-ai.com.

Errors

An error body is an object with a detail field, usually a string. For invalid query parameters detail is a list, where each item names the field (loc) and the reason (msg).

422 response to top_k=50
{
  "detail": [
    {
      "type": "less_than_equal",
      "loc": ["query", "top_k"],
      "msg": "Input should be less than or equal to 10"
    }
  ]
}
CodeWhendetailWhat to do
401No key, malformed key, revoked keyMissing or invalid API keyCheck the X-Api-Key header
403/parse/batch without batch accessBatch access is not enabled for this accountRequest access
404/lookup: the code is not in the register or the building has no streetкод не найден в реестре, код есть в реестре, но дом не привязан к улицеDo not retry
408The POST body did not arrive within 5 secondsRequest body timeoutCheck the connection
413The request body is over 256 KBRequest body too largeSplit the batch
422A parameter is out of range or a required one is missingA list of errors, see the example aboveFix the request
422scope was not recognized or is the wrong levelнеизвестная область поиска, «…» — это …; ручка принимает …See The scope parameter
422/lookup: the string does not look like a codeстрока не похожа ни на почтовый индекс, ни на РКАFix the request
422More than 100 addresses in a batchbatch too large: max 100 addressesSplit the batch
429The limit is exhaustedRate limit exceededWait Retry-After seconds
503The server is overloaded or key checks are temporarily unavailableServer busy, retry shortly, Authentication temporarily unavailableRetry after Retry-After

Only 429 and 503 are worth retrying. Every other code comes back unchanged on a retry. Some detail messages are in Russian, as shown.

Address parsing
GET

/parse

API key

Full standardization of one address: hierarchy, codes, postcodes and coordinate. Returns up to top_k candidates, best first.

Parameters

ParameterTypeDefaultDescription
qrequiredstring—Free-form address, 1–200 characters
top_kinteger3How many candidates to return, 1–10
scopestring—Search only inside one administrative unit: name, KATO code or UID. See The scope parameter
extendedbooleantrueSearch the street across the whole country when the regular parse gives no confirmed address. false — the regular parse only. Has no effect together with scope. See The extended parameter
unitsbooleantruefalse — do not check the apartment or office against the Address Register: match has no unit_status, a number after the house number is not read as an apartment, and include=apartment adds no unit. The number from the input stays in match.requested_unit. See Apartment and office
includestring—Extra data, comma-separated: prices, building details, the apartment or office from the input; geometry currently returns null. See The include parameter
excludestring—Fields you do not need, comma-separated: rca, cato, postcodes and more. See The exclude parameter

Request

curl -G https://api.qaida.io/parse \
  -H "X-Api-Key: $QAIDA_API_KEY" \
  --data-urlencode "q=астана кабанбай батыра 11/5" \
  -d top_k=1

Response

FieldTypeDescription
querystringThe query string as sent
resultsarrayCandidates, best first; an empty list when nothing is found. See Result object
scopeobject | nullHow the service understood scope; null when it was not sent
scope_conflictboolean | nulltrue when the query names a city outside scope; null without the parameter
searchobject | nullHow the country-wide search took part in the answer; null when the answer is a regular parse. See The extended parameter
200 response
{
  "query": "астана кабанбай батыра 11/5",
  "results": [
    {
      "hierarchy": [
        {
          "type": "ats",
          "kind": "country",
          "name_kz": "Қазақстан",
          "name_ru": "Казахстан",
          "type_kz": "Республикасы",
          "type_ru": "Республика",
          "rco": null,
          "cato": null
        },
        {
          "type": "ats",
          "kind": "city",
          "name_kz": "Астана",
          "name_ru": "Астана",
          "type_kz": "Республикалық маңызы бар қаласы",
          "type_ru": "Город республиканского значения",
          "rco": 3000000008716,
          "cato": 710000000
        },
        {
          "type": "ats",
          "kind": "region",
          "name_kz": "Астана",
          "name_ru": "Астана",
          "type_kz": "Республикалық маңызы бар қаласы",
          "type_ru": "Город республиканского значения",
          "rco": 3000000008716,
          "cato": 710000000
        },
        {
          "type": "geo",
          "kind": "street",
          "name_kz": "Қабанбай Батыр",
          "name_ru": "Қабанбай Батыр",
          "type_kz": "Даңғылы",
          "type_ru": "Проспект",
          "rco": 4000000237184,
          "cato": null
        },
        {
          "type": "building",
          "kind": "main",
          "number": "11/5",
          "rca": 202100297954282,
          "type_kz": "Ғимарат",
          "type_ru": "Здание",
          "cadastre_number": null,
          "postcode": "Z05T9X8",
          "oldPostcode": "010000"
        }
      ],
      "full_path_rus": "Республика Казахстан, город республиканского значения Астана, проспект Қабанбай Батыр, здание 11/5",
      "full_path_kaz": "Қазақстан республикасы, Астана республикалық маңызы бар қаласы, Қабанбай Батыр даңғылы, 11/5 ғимарат",
      "point": [71.41329956054688, 51.14006042480469],
      "match": {
        "level": "house",
        "type": "alias",
        "ambiguous": false,
        "unmatched": [],
        "corrections": []
      }
    }
  ],
  "scope": null,
  "scope_conflict": null,
  "search": null
}

When only part of the address is found

  • No such house number. The result stops at the street: match.type = "partial", and unmatched lists the missing number. The service never substitutes the nearest number.
  • The number is written differently in the register. When “102” exists only as “102/41”, or “12/6” as “building 12, block 6”, the service substitutes the register record: match.type = "corrected" with a kind: "house" pair in corrections. A neighbouring number is never substituted.
  • Part of the line was not read. An extra number after the house, “блок 4”, an entrance without a comma: the answer may reach the building, but match.type = "partial" and the leftover is in unmatched.
  • A street without a locality. “абая 10” fits hundreds of streets across the country. By default the service searches for such a street country-wide and returns houses from different cities, but the city in that answer is its own choice. So match.type = "partial" even though unmatched is empty, and the search block shows how the string was read. To get a confirmed address, add the city to the string or pass it in scope. With extended=false there is no country-wide search and results is empty. See The extended parameter.
  • An apartment or office. For “туран 46а кв 12” the answer stops at the building: the address line and point belong to the house. The number from the input comes in match.requested_unit, and match.unit_status tells whether the house has such a unit in the Address Register. The unit itself — kind, number and RCA — is added by include=apartment, see Apartment and office.
  • A number right after the house number. “туран 46а 12” without “кв”: if the register has no corpus 12 and no house 46А/12, but the house has apartment 12, the number is read as the apartment — match.type = "corrected", and corrections has a pair with kind: "unit". If the register has no such apartment, the answer is the house with match.type = "partial" and the number in unmatched.
match for “алматы абылай хана 93”: house 93 is not in the register
{
  "level": "street",
  "type": "partial",
  "ambiguous": false,
  "unmatched": ["house:93"],
  "corrections": []
}
GET

/parse/region and /parse/city

API key

The same as /parse, but scope is required and matched only among units of its level. Use these when the region or city is a separate column in your data.

  • /parse/region accepts 20 top-level units: 17 regions and three cities of national significance — Almaty, Astana and Shymkent. No region sits above these cities, so they fill the “region” column themselves.
  • /parse/city accepts cities of national, regional and district significance.

Separate endpoints exist because a name alone is ambiguous. “Абай” is both a region and a city in the Karaganda Region. “Алматы” is both a city and the Kazakh name of the Almaty Region. /parse picks between them by a general rule, while a level endpoint only looks among its own units.

Parameters

ParameterTypeDefaultDescription
qrequiredstring—Address, 1–200 characters. No need to repeat the region or city in it
scoperequiredstring—A region (for /region) or a city (for /city): name, KATO code or UID
top_kinteger3How many candidates to return, 1–10
unitsbooleantruefalse — do not check the apartment or office against the Address Register: match has no unit_status, a number after the house number is not read as an apartment, and include=apartment adds no unit. The number from the input stays in match.requested_unit. See Apartment and office
includestring—Extra data, comma-separated: prices, building details, the apartment or office from the input; geometry currently returns null. See The include parameter
excludestring—Fields you do not need, comma-separated: rca, cato, postcodes and more. See The exclude parameter

Request

curl -G https://api.qaida.io/parse/region \
  -H "X-Api-Key: $QAIDA_API_KEY" \
  --data-urlencode "q=каргалы алатау 77" \
  --data-urlencode "scope=алматинская" \
  -d top_k=1
200 response · hierarchy collapsed
{
  "query": "каргалы алатау 77",
  "results": [
    {
      "hierarchy": [ … ],
      "full_path_rus": "Республика Казахстан, область Алматинская, район Жамбылский, сельский округ Каргалинский, село Каргалы, улица Алатау, дом 77",
      "full_path_kaz": "Қазақстан республикасы, Алматы облысы, Жамбыл ауданы, Қарғалы ауылдық округі, Қарғалы ауылы, Алатау көшесі, 77 үй",
      "point": [76.41905212402344, 43.165287017822266],
      "match": {
        "level": "house",
        "type": "exact",
        "ambiguous": false,
        "unmatched": [],
        "corrections": []
      }
    }
  ],
  "scope": {
    "uid": 4,
    "kato": 190000000,
    "name_ru": "Алматинская",
    "name_kz": "Алматы",
    "type_ru": "Область",
    "type_kz": "Облысы",
    "matched_by": "name"
  },
  "scope_conflict": false,
  "search": null
}

The response format is the same as for /parse. The type of the unit the service used is in scope.type_ru. These endpoints have no extended parameter: the country-wide search never runs, and search in the response is always null.

A value of the wrong level

If the value exists but belongs to another level, the 422 response says what it actually is. Usually that means columns were swapped in the source data.

/parse/city with scope=алматинская → 422
{
  "detail": "«Алматинская» — это область; ручка принимает город республиканского, областного или районного значения (91 единица)"
}
/parse/region with scope=каргалы → 422
{
  "detail": "«Каргалы» — это село; ручка принимает область или город республиканского значения (20 единиц верхнего уровня)"
}
One exception
On /parse/region the Kazakh “Алматы” resolves to the city of Almaty, because the city and the Almaty Region share the Kazakh name. For the region pass the Russian “Алматинская” or KATO 190000000.
GET

/parse/extended

API key

A parse where a street without a locality is always searched across the whole country. “достык 8” returns house 8 on Dostyk streets of different cities — each with its full hierarchy, best first.

This is not the same as the extended parameter of /parse. /parse first parses the string the regular way and searches country-wide only when that gives no confirmed address; a house in a city chosen by the service comes from it with match.type = "partial". Here the country-wide search always reads the string, with no regular parse first, and the answer type is not lowered: the same house may come as exact or ambiguous.

The search block explains how the string was read. If a city, district or region is named in the string, the search stays inside it (“алматы жандосова 2” → Almaty). The scope parameter outranks the string, as everywhere: with it this is a regular parse within the unit, and search.mode is context.

Parameters

ParameterTypeDefaultDescription
qrequiredstring—Address, 1–200 characters. The locality may be omitted
top_kinteger3How many candidates to return, 1–10. Without a city it makes sense to ask for more: candidates from different cities are equals
scopestring—Search only inside one administrative unit, as in /parse. See The scope parameter
unitsbooleantruefalse — do not check the apartment or office against the Address Register: match has no unit_status, a number after the house number is not read as an apartment, and include=apartment adds no unit. The number from the input stays in match.requested_unit. See Apartment and office
includestring—Extra data, comma-separated. See The include parameter
excludestring—Fields you do not need, comma-separated. See The exclude parameter

Request

curl -G https://api.qaida.io/parse/extended \
  -H "X-Api-Key: $QAIDA_API_KEY" \
  --data-urlencode "q=достык 8" \
  -d top_k=3

Response

The format is the same as for /parse, but the search block is present in every response and has no role, superseded or engine_type fields. When several addresses fit equally well, their match.type is "ambiguous".

FieldTypeDescription
search.modestringstreets — the street was searched across the country; scope — inside the unit named in the string; unit — the unit has no street with these words, the answer is the unit itself; units — unit suggestions; context — the scope parameter was passed, a regular parse
search.streets, search.localitiesinteger | nullHow many streets matched by name and in how many localities they are
search.completebooleanfalse — some candidates were not checked because of a limit, the list may be incomplete
search.droppedstring[]Words of the string that did not make it into the street name of the answer: in no name at all, or dropped when relaxing
search.placestring | nullThe city, district or region named in the string
search.hypothesisstring | nullThe winning reading: H0 — a street across the country, H1 — without one word, S0…S2 — inside the named unit, U — the unit itself
results[].match.locality_relationstringOnly when a place is named: same — the candidate is in it, descendant — in a part of it, none — outside it
200 response · hierarchy collapsed
{
  "query": "достык 8",
  "results": [
    {
      "hierarchy": [ … ],
      "full_path_rus": "Республика Казахстан, город республиканского значения Астана, улица Достық, дом 8",
      "full_path_kaz": "Қазақстан республикасы, Астана республикалық маңызы бар қаласы, Достық көшесі, 8 үй",
      "point": [71.42141723632812, 51.12685012817383],
      "match": {
        "level": "house",
        "type": "ambiguous",
        "ambiguous": true,
        "unmatched": [],
        "corrections": []
      }
    },
    {
      "hierarchy": [ … ],
      "full_path_rus": "Республика Казахстан, город республиканского значения Шымкент, жилой массив Достык, улица Достык, дом 8",
      "full_path_kaz": "Қазақстан республикасы, Шымкент республикалық маңызы бар қаласы, Достық тұрғын үй алабы, Достық көшесі, 8 үй",
      "point": [69.73550415039062, 42.36028289794922],
      "match": {
        "level": "house",
        "type": "ambiguous",
        "ambiguous": true,
        "unmatched": [],
        "corrections": []
      }
    },
    {
      "hierarchy": [ … ],
      "full_path_rus": "Республика Казахстан, город республиканского значения Алматы, микрорайон Шугыла, микрорайон Достық, дом 8",
      "full_path_kaz": "Қазақстан республикасы, Алматы республикалық маңызы бар қаласы, Шұғыла шағын ауданы, Достық шағын ауданы, 8 үй",
      "point": [76.83915710449219, 43.27186965942383],
      "match": {
        "level": "house",
        "type": "ambiguous",
        "ambiguous": true,
        "unmatched": [],
        "corrections": []
      }
    }
  ],
  "scope": null,
  "scope_conflict": null,
  "search": {
    "mode": "streets",
    "streets": 929,
    "localities": 853,
    "complete": true,
    "dropped": [],
    "place": null,
    "hypothesis": "H0"
  }
}

A city in the string

The named unit keeps the search inside itself, while scope in the response stays null: the parameter was not passed. A fallback reading, where the city words turned out to be part of a street name, may come below the main one with locality_relation: "none".

200 response · “алматы жандосова 2”, hierarchy collapsed
{
  "query": "алматы жандосова 2",
  "results": [
    {
      "hierarchy": [ … ],
      "full_path_rus": "Республика Казахстан, город республиканского значения Алматы, улица Жандосова, дом 2",
      "full_path_kaz": "Қазақстан республикасы, Алматы республикалық маңызы бар қаласы, Жандосов көшесі, 2 үй",
      "point": [76.9127426147461, 43.23651123046875],
      "match": {
        "level": "house",
        "type": "ambiguous",
        "ambiguous": true,
        "unmatched": [],
        "corrections": [],
        "locality_relation": "same"
      }
    },
    {
      "hierarchy": [ … ],
      "full_path_rus": "Республика Казахстан, город республиканского значения Алматы, микрорайон Таусамалы, улица С Жандосов, дом 2",
      "full_path_kaz": "Қазақстан республикасы, Алматы республикалық маңызы бар қаласы, Таусамалы шағын ауданы, С Жандосов көшесі, 2 үй",
      "point": [76.81779479980469, 43.183414459228516],
      "match": {
        "level": "house",
        "type": "ambiguous",
        "ambiguous": true,
        "unmatched": [],
        "corrections": [],
        "locality_relation": "same"
      }
    }
  ],
  "scope": null,
  "scope_conflict": null,
  "search": {
    "mode": "scope",
    "streets": 6,
    "localities": 1,
    "complete": true,
    "dropped": [],
    "place": "Алматы",
    "hypothesis": "S0"
  }
}

When there is no street

When the string holds only a locality, or the locality has no street with these words, the answer is the unit itself: search.mode = "unit" and match.level is its level.

200 response · “талдыкорган”, hierarchy collapsed
{
  "query": "талдыкорган",
  "results": [
    {
      "hierarchy": [ … ],
      "full_path_rus": "Республика Казахстан, область Жетісу, город областного значения Талдыкорган",
      "full_path_kaz": "Қазақстан республикасы, Жетісу облысы, Талдықорған облыстық маңызы бар қаласы",
      "point": [null, null],
      "match": {
        "level": "city",
        "type": "exact",
        "ambiguous": false,
        "unmatched": [],
        "corrections": [],
        "locality_relation": "same"
      }
    }
  ],
  "scope": null,
  "scope_conflict": null,
  "search": {
    "mode": "unit",
    "streets": 0,
    "localities": 0,
    "complete": true,
    "dropped": [],
    "place": "Талдыкорган",
    "hypothesis": "U"
  }
}
POST

/parse/batch

Key + batch access

Parse up to 100 addresses in one request. For exports and address-database cleanup.

A batch answers differently from /parse by default
Every string of a batch goes through the regular parse, like /parse with extended=false: the country-wide search never runs and the response has no search block. So a string without a city gets a different answer: in a batch without scope, “достык 89б” is the village of Dostyk and “абая 135” is an empty results, while /parse by default returns a house in Almaty for both. To get matching answers, pass the city in scope or call /parse with extended=false.

Request body

ParameterTypeDefaultDescription
addressesrequiredstring[]—1 to 100 addresses, each 1–200 characters
top_kinteger1Candidates per address, 1–10. Defaults to one, not three as in /parse
scopestring—One administrative unit for every address in the batch
unitsbooleantrueAs in /parse, for the whole batch. See Apartment and office
includestring[]—Extra data as a list of strings, shared by the whole batch. See The include parameter
excludestring[]—Unneeded fields as a list of strings, shared by the whole batch. See The exclude parameter

Request

curl https://api.qaida.io/parse/batch \
  -H "X-Api-Key: $QAIDA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"addresses": ["достык 89б", "астана кабанбай батыра 11/5"], "scope": "алматы"}'

Response

FieldTypeDescription
countintegerNumber of addresses
itemsarrayOne item per address, in order: address, results and scope_conflict
scopeobject | nullHow scope was understood, shared by the batch
200 response · hierarchy collapsed
{
  "count": 2,
  "items": [
    {
      "address": "достык 89б",
      "results": [
        {
          "hierarchy": [ … ],
          "full_path_rus": "Республика Казахстан, город республиканского значения Алматы, проспект Достык, дом 89Б",
          "full_path_kaz": "Қазақстан республикасы, Алматы республикалық маңызы бар қаласы, Достық даңғылы, 89Б үй",
          "point": [76.95661163330078, 43.238582611083984],
          "match": {
            "level": "house",
            "type": "exact",
            "ambiguous": false,
            "unmatched": [],
            "corrections": []
          }
        }
      ],
      "scope_conflict": false
    },
    {
      "address": "астана кабанбай батыра 11/5",
      "results": [
        {
          "hierarchy": [ … ],
          "full_path_rus": "Республика Казахстан, город республиканского значения Алматы, улица Кабанбай батыра",
          "full_path_kaz": "Қазақстан республикасы, Алматы республикалық маңызы бар қаласы, КАБАНБАЙ БАТЫР көшесі",
          "point": [null, null],
          "match": {
            "level": "street",
            "type": "partial",
            "ambiguous": false,
            "unmatched": ["house:11/5"],
            "corrections": []
          }
        }
      ],
      "scope_conflict": true
    }
  ],
  "scope": {
    "uid": 1,
    "kato": 750000000,
    "name_ru": "Алматы",
    "name_kz": "Алматы",
    "type_ru": "Город республиканского значения",
    "type_kz": "Республикалық маңызы бар қаласы",
    "matched_by": "name"
  }
}

The second address names another city, so its answer comes from Almaty — the unit in scope — and is flagged scope_conflict: true. The flag is set per address. An address that cannot be parsed gets an empty results, and the rest of the batch is processed as usual.

Suggestions
GET

/suggest

API key

Suggestions while an address is typed: localities, streets and houses that continue the input.

Parameters

ParameterTypeDefaultDescription
qrequiredstring—The typed part of the address, 1–200 characters
limitinteger10How many suggestions to return, 1–20
scopestring—Suggest only inside one administrative unit
extendedbooleantrueSuggest streets and houses across the whole country when there are no regular suggestions or the first of them is neither a street nor a house. false — regular suggestions only. Has no effect together with scope. See The extended parameter
unitsbooleanfalsetrue — suggest apartments of the house from the Address Register. See Apartments in suggestions

Request

curl -G https://api.qaida.io/suggest \
  -H "X-Api-Key: $QAIDA_API_KEY" \
  --data-urlencode "q=алматы абылай х" \
  -d limit=3
200 response
{
  "query": "алматы абылай х",
  "suggestions": [
    {
      "kind": "street",
      "uid": 156094,
      "text_ru": "Республика Казахстан, город республиканского значения Алматы, проспект Абылай хана",
      "text_kz": "Қазақстан республикасы, Алматы республикалық маңызы бар қаласы, Абылай хан даңғылы",
      "point": [null, null]
    },
    {
      "kind": "street",
      "uid": 71334,
      "text_ru": "Республика Казахстан, город республиканского значения Алматы, микрорайон Мадениет, улица Абылай хан",
      "text_kz": "Қазақстан республикасы, Алматы республикалық маңызы бар қаласы, Мәдениет шағын ауданы, Абылай хан көшесі",
      "point": [null, null]
    },
    {
      "kind": "street",
      "uid": 8725,
      "text_ru": "Республика Казахстан, область Алматинская, район Карасайский, город районного значения Каскелен, улица Абылай Хан",
      "text_kz": "Қазақстан республикасы, Алматы облысы, Қарасай ауданы, Қаскелең аудандық маңызы бар қаласы, Абылай Хан көшесі",
      "point": [null, null]
    }
  ],
  "scope": null,
  "search": null
}

Besides the suggestions, the response carries the scope and search blocks. In the example the city is named in the input, the suggestions are regular, and search is null. When the input names no locality, streets and houses from across the country join the list, and search shows how: see The extended parameter.

Suggestion fields

FieldTypeDescription
kindstringWhat is suggested, see the table below
uidinteger | nullInternal object identifier. null for kind = "address" and "apartment"
text_ru, text_kzstringThe full address line in Russian and Kazakh
point[lon, lat]House coordinate. Usually [null, null] for streets and localities
kindWhat it is
regionRegion or city of national significance
cityCity
districtDistrict of a region or of a city
areaRural district, microdistrict, housing estate and other areas
localityVillage or settlement
streetStreet, avenue, lane
houseHouse or building
addressThe input already resolves to a specific address
apartmentApartment of a house; only with units=true

Suggestions carry no register codes, postcodes or hierarchy. Once the user picks one, get the full structure from /parse.

GET

/suggest/compact

API key

The same suggestions as /suggest, with short labels for an input field.

The q, limit, scope, extended and units parameters are the same, and so are the suggestions and their order. Only text_ru and text_kz differ: they drop “Республика Казахстан”, and long types of three or more words get short names — “город Алматы” instead of “город республиканского значения Алматы”, “район” instead of “район в городе”. Types of one or two words (“область”, “сельский округ”, “улица”) stay as they are.

Request

curl -G https://api.qaida.io/suggest/compact \
  -H "X-Api-Key: $QAIDA_API_KEY" \
  --data-urlencode "q=алматы абылай х" \
  -d limit=3
200 response
{
  "query": "алматы абылай х",
  "suggestions": [
    {
      "kind": "street",
      "uid": 156094,
      "text_ru": "город Алматы, проспект Абылай хана",
      "text_kz": "Алматы қаласы, Абылай хан даңғылы",
      "point": [null, null]
    },
    {
      "kind": "street",
      "uid": 71334,
      "text_ru": "город Алматы, микрорайон Мадениет, улица Абылай хан",
      "text_kz": "Алматы қаласы, Мәдениет шағын ауданы, Абылай хан көшесі",
      "point": [null, null]
    },
    {
      "kind": "street",
      "uid": 8725,
      "text_ru": "область Алматинская, район Карасайский, город Каскелен, улица Абылай Хан",
      "text_kz": "Алматы облысы, Қарасай ауданы, Қаскелең қаласы, Абылай Хан көшесі",
      "point": [null, null]
    }
  ],
  "scope": null,
  "search": null
}

Apartments in suggestions

With units=true, /suggest and /suggest/compact suggest down to the apartment, with numbers from the Address Register.

  • Typing an apartment. The input ends with “кв”, “квартира” or “пәтер”, possibly followed by the start of a number: “…туран 46а кв 1”. The list holds the apartments of that house whose number starts with what was typed, with kind: "apartment".
  • The address is complete. The input ends with a space or a comma, and the first suggestion is the address itself: “…туран 46а ”. The first apartments of the house follow it.
200 response · /suggest, “астана проспект туран 46а кв 1”, limit=3, units=true
{
  "query": "астана проспект туран 46а кв 1",
  "suggestions": [
    {
      "kind": "apartment",
      "uid": null,
      "text_ru": "Республика Казахстан, город республиканского значения Астана, проспект Тұран, дом 46А, квартира 1",
      "text_kz": "Қазақстан республикасы, Астана республикалық маңызы бар қаласы, Тұран даңғылы, 46А үй, пәтер 1",
      "point": [71.40022277832031, 51.11112976074219]
    },
    {
      "kind": "apartment",
      "uid": null,
      "text_ru": "Республика Казахстан, город республиканского значения Астана, проспект Тұран, дом 46А, квартира 10",
      "text_kz": "Қазақстан республикасы, Астана республикалық маңызы бар қаласы, Тұран даңғылы, 46А үй, пәтер 10",
      "point": [71.40022277832031, 51.11112976074219]
    },
    {
      "kind": "apartment",
      "uid": null,
      "text_ru": "Республика Казахстан, город республиканского значения Астана, проспект Тұран, дом 46А, квартира 11",
      "text_kz": "Қазақстан республикасы, Астана республикалық маңызы бар қаласы, Тұран даңғылы, 46А үй, пәтер 11",
      "point": [71.40022277832031, 51.11112976074219]
    }
  ],
  "scope": null,
  "search": null
}
  • Apartments are suggested only for a house the input names unambiguously: its parse type is neither partial nor ambiguous. If the house is ambiguous or has no apartments in the register, the suggestions are the same as without units.
  • Only residential units are suggested — apartments and rooms. Offices and non-residential premises are not.
  • An apartment suggestion has uid set to null and the house point. In /suggest/compact the label is short, like the other suggestions.
  • Parse the chosen apartment with /parse and include=apartment: the unit comes as the last hierarchy node, see Apartment and office.
GET

/suggest/region and /suggest/city

API key

The same as /suggest, but scope is required and matched only among units of its level — as with /parse/region and /parse/city.

The main use: the city is chosen in a separate form field and the user types only the street. Suggestions come only from that city, even when its name is not in the input. These endpoints have no extended parameter: the country-wide search never runs, and search in the response is always null. There is no units parameter either: only /suggest and /suggest/compact suggest apartments.

Parameters

ParameterTypeDefaultDescription
qrequiredstring—The typed part of the address, 1–200 characters
scoperequiredstring—A region (for /region) or a city (for /city): name, KATO code or UID
limitinteger10How many suggestions to return, 1–20

Request

curl -G https://api.qaida.io/suggest/city \
  -H "X-Api-Key: $QAIDA_API_KEY" \
  --data-urlencode "q=торайг" \
  --data-urlencode "scope=экибастуз" \
  -d limit=3
200 response
{
  "query": "торайг",
  "suggestions": [
    {
      "kind": "street",
      "uid": 12960,
      "text_ru": "Республика Казахстан, область Павлодарская, город областного значения Экибастуз, улица С Торайгырова",
      "text_kz": "Қазақстан республикасы, Павлодар облысы, Екібастұз облыстық маңызы бар қаласы, С Торайғыров көшесі",
      "point": [null, null]
    }
  ],
  "scope": {
    "uid": 66,
    "kato": 552210000,
    "name_ru": "Экибастуз",
    "name_kz": "Екібастұз",
    "type_ru": "Город областного значения",
    "type_kz": "Облыстық маңызы бар қаласы",
    "matched_by": "name"
  },
  "search": null
}
GET

/suggest/extended and /suggest/compact/extended

API key

Suggestions where a street without a locality is always searched across the whole country — as in /parse/extended.

This is not the same as the extended parameter of /suggest: there country-wide suggestions appear only when there are no regular suggestions or the first of them is neither a street nor a house, while here the country-wide search always reads the input. The q, limit and scope parameters are the same as in /suggest. “дост” brings streets of different cities, “достык 8” brings house 8 on those streets. A city named in the string keeps the suggestions inside it; with the scope parameter these are regular suggestions within the unit. Every response carries the search block, the same as in /parse/extended. /suggest/compact/extended differs only by the short labels, like /suggest/compact.

Parameters

ParameterTypeDefaultDescription
qrequiredstring—The typed part of the address, 1–200 characters. The locality may be omitted
limitinteger10How many suggestions to return, 1–20
scopestring—Suggest only inside one administrative unit

Request

curl -G https://api.qaida.io/suggest/extended \
  -H "X-Api-Key: $QAIDA_API_KEY" \
  --data-urlencode "q=достык 8" \
  -d limit=3
200 response
{
  "query": "достык 8",
  "suggestions": [
    {
      "kind": "house",
      "uid": 2824283,
      "text_ru": "Республика Казахстан, город республиканского значения Астана, улица Достық, дом 8",
      "text_kz": "Қазақстан республикасы, Астана республикалық маңызы бар қаласы, Достық көшесі, 8 үй",
      "point": [71.42141723632812, 51.12685012817383]
    },
    {
      "kind": "house",
      "uid": 2157681,
      "text_ru": "Республика Казахстан, город республиканского значения Шымкент, жилой массив Достык, улица Достык, дом 8",
      "text_kz": "Қазақстан республикасы, Шымкент республикалық маңызы бар қаласы, Достық тұрғын үй алабы, Достық көшесі, 8 үй",
      "point": [69.73550415039062, 42.36028289794922]
    },
    {
      "kind": "house",
      "uid": 3970024,
      "text_ru": "Республика Казахстан, город республиканского значения Алматы, микрорайон Шугыла, микрорайон Достық, дом 8",
      "text_kz": "Қазақстан республикасы, Алматы республикалық маңызы бар қаласы, Шұғыла шағын ауданы, Достық шағын ауданы, 8 үй",
      "point": [76.83915710449219, 43.27186965942383]
    }
  ],
  "scope": null,
  "search": {
    "mode": "streets",
    "streets": 929,
    "localities": 853,
    "complete": true,
    "dropped": [],
    "place": null,
    "hypothesis": "H0"
  }
}

Input ending with a space is read the same way as in /parse/extended: the first suggestion for “достык 8 ” matches the first result of parsing “достык 8”.

Reverse lookup and service
GET

/lookup

API key

An address from a register code: a new or old postcode, or an RCA. The kind of code is detected from the string itself.

Parameters

ParameterTypeDefaultDescription
qrequiredstring—A code in one of the formats below. Case and surrounding spaces do not matter
includestring—Extra data, comma-separated: prices and building details; geometry currently returns null. See The include parameter
excludestring—Fields you do not need, comma-separated: rca, cato, postcodes and more. See The exclude parameter
CodeFormatExampleReturns
New postcodeA00A0A0Z05T9X8A building. Almost always one, occasionally two
RCA15 digits202100297954282A building
Old postcode4–6 digits050010The locality most buildings with this code belong to. An old postcode cannot identify a building

Request

curl -G https://api.qaida.io/lookup \
  -H "X-Api-Key: $QAIDA_API_KEY" \
  -d q=Z05T9X8

Response

FieldTypeDescription
querystringThe query string
matched_bystringpostcode, rca or old_postcode
house_countintegerHow many buildings in the register carry this code. 1 for a new postcode or RCA, thousands for an old postcode
resultsarrayResult objects. match is null here: there was no string to parse
200 response · hierarchy collapsed
{
  "query": "Z05T9X8",
  "matched_by": "postcode",
  "house_count": 1,
  "results": [
    {
      "hierarchy": [ … ],
      "full_path_rus": "Республика Казахстан, город республиканского значения Астана, проспект Қабанбай Батыр, здание 11/5",
      "full_path_kaz": "Қазақстан республикасы, Астана республикалық маңызы бар қаласы, Қабанбай Батыр даңғылы, 11/5 ғимарат",
      "point": [71.41329956054688, 51.14006042480469],
      "match": null
    }
  ]
}
Old postcode 050010 → Almaty, 8,651 buildings
{
  "query": "050010",
  "matched_by": "old_postcode",
  "house_count": 8651,
  "results": [
    {
      "hierarchy": [ … ],
      "full_path_rus": "Республика Казахстан, город республиканского значения Алматы",
      "full_path_kaz": "Қазақстан республикасы, Алматы республикалық маңызы бар қаласы",
      "point": [null, null],
      "match": null
    }
  ]
}
GET

/nearby

API key

Buildings near a point, nearest first.

Parameters

ParameterTypeDefaultDescription
latrequirednumber—Latitude
lonrequirednumber—Longitude
limitinteger5How many buildings to return, 1–20
radius_mnumber500Search radius in metres. Values up to 50,000 are accepted, but the search never goes beyond 1,000 m
includestring—Extra data, comma-separated: prices and building details; geometry currently returns null. See The include parameter
excludestring—Fields you do not need, comma-separated: rca, cato, postcodes and more. See The exclude parameter

Points outside Kazakhstan — outside latitudes 40–56° and longitudes 46–88° — return an empty results.

Request

curl -G https://api.qaida.io/nearby \
  -H "X-Api-Key: $QAIDA_API_KEY" \
  -d lat=51.14006 \
  -d lon=71.4133 \
  -d limit=2 \
  -d radius_m=100

Response

The response holds the query point query (fields lat and lon) and a results list. Each result is a result object with two extra fields:

FieldTypeDescription
distance_mnumberDistance from the query point in metres, to 0.1
shared_pointintegerHow many buildings the register places at exactly this point
200 response · hierarchy collapsed
{
  "query": {
    "lat": 51.14006042480469,
    "lon": 71.41329956054688
  },
  "results": [
    {
      "hierarchy": [ … ],
      "full_path_rus": "Республика Казахстан, город республиканского значения Астана, проспект Қабанбай Батыр, здание 11/5",
      "full_path_kaz": "Қазақстан республикасы, Астана республикалық маңызы бар қаласы, Қабанбай Батыр даңғылы, 11/5 ғимарат",
      "point": [71.41329956054688, 51.14006042480469],
      "match": null,
      "distance_m": 0.0,
      "shared_point": 1
    },
    {
      "hierarchy": [ … ],
      "full_path_rus": "Республика Казахстан, город республиканского значения Астана, проспект Қабанбай Батыр, здание 11/4",
      "full_path_kaz": "Қазақстан республикасы, Астана республикалық маңызы бар қаласы, Қабанбай Батыр даңғылы, 11/4 ғимарат",
      "point": [71.41276550292969, 51.140602111816406],
      "match": null,
      "distance_m": 70.9,
      "shared_point": 1
    }
  ]
}
Map on your website

Map on your website: JS API

The qaida-maps.js script draws a map of Kazakhstan right on your web page: an address field with suggestions and a point on the map, branches, any markers. It is built on MapLibre GL JS and our basemap from OpenStreetMap data.

  • The key is a browser key. It is bound to the addresses of your websites and works only on them. A server key is not accepted on a page. A browser key is issued on request at qaida@tenzor-ai.com: send the website addresses with the scheme, for example https://shop.kz. For development you can add http://localhost:3000 to the list. A key holds up to 20 websites, each written in full, without wildcards: https://shop.kz and https://www.shop.kz are different websites.
  • The key is visible in the page code, and that is expected. Binding to websites keeps other websites from opening the map with your key in a browser, but a request made outside a browser can name any website. That is why a browser key gives only the map, suggestions and address points, not the whole API, and each visitor’s requests are limited. If you notice someone else using your quota, write to us: we will reissue the key, and the old one stops working within a minute.
  • Loading the map is free. Only address parsing and suggestions use the quota, see What uses the quota.
  • Coordinates are always [longitude, latitude], as in API responses and in MapLibre.
Minimal page: a map of Astana
<div id="map" style="height: 400px"></div>

<script src="https://maps.qaida.io/js/v1/qaida-maps.js"></script>
<script>
  qaida.ready.then(() => {
    const map = new qaida.Map('map', { key: 'YOUR_BROWSER_KEY', center: [71.43, 51.13], zoom: 11 });
  });
</script>

The loader at a permanent address fetches the map bundle — about 700 KB on first load together with fonts and the visible part of the map, then the code and fonts come from the browser cache — and sets qaida.ready. Make all calls after it. Map updates arrive on their own and nothing needs to change on your website.

The map opens in the “Nature” theme, as on the Qaida map website. For dark websites there is a night theme: new qaida.Map('map', { key, theme: 'night' }).

Night theme: the center of Astana

From zoom 16 the map shows house numbers from the Qaida registry — for houses whose point is on the building or its plot. Turn them off with houseNumbers: false.

Address field with a point on the map

A visitor types an address and picks a suggestion. A marker appears on the map, and your code receives the address from the registry and its coordinate. This is how delivery, listing or application addresses are filled in.

<label for="address">Адрес доставки</label>
<input id="address" placeholder="Город, улица, дом">
<div id="map" style="height: 400px"></div>

<script src="https://maps.qaida.io/js/v1/qaida-maps.js"></script>
<script>
  qaida.ready.then(() => {
    const map = new qaida.Map('map', { key: 'YOUR_BROWSER_KEY', city: 'almaty' });
    const input = new qaida.AddressInput('address', { map });   // search only in Almaty

    input.on('select', (address) => {
      // address.text  — the address from the registry
      // address.point — [longitude, latitude]; null if a street or a city was chosen
      // address.level — house, street, city, …
      console.log(address);
    });
  });
</script>
Address field and map: the address “город Алматы, проспект Абая, дом 10” is chosen, a marker stands on the building
  • Suggestions are requested from the third character, after a 250 ms pause. Repeated input is served from the page memory. Each suggestion request is one request from the suggestion quota.
  • Only a building has a point. If the visitor picked a street or a city, address.point is null and no marker is placed: ask for the house number.
  • The search can be limited to a city: new qaida.Map('map', { key, city: 'almaty' }) — the map opens on Almaty, and suggestions and parsing search only there. The list of cities is in the reference.

Without an input field of your own, an address is put on the map with one call. It is one parse from the quota:

map.geocode('Астана, Мангилик Ел 8')
  .then((address) => map.setMarker(address))
  .catch((error) => console.log(error.code, error.message));

Branches and markers

A list of points with a title and a card. The map view fits all the markers by itself.

<div id="map" style="height: 400px"></div>

<script src="https://maps.qaida.io/js/v1/qaida-maps.js"></script>
<script>
  qaida.ready.then(async () => {
    const map = new qaida.Map('map', { key: 'YOUR_BROWSER_KEY' });

    const { added, failed } = await map.addMarkers([
      { point: [76.9466, 43.2421], title: 'Филиал на Абая', text: 'Пн–Пт 9:00–18:00' },
      { point: [76.9431, 43.2556], title: 'Филиал на Толе би', text: 'Ежедневно 10:00–22:00' },
      { address: 'Алматы, Достык 89', title: 'Склад' },
    ]);

    map.on('markerclick', (branch) => console.log(branch.title));
  });
</script>
Three branches in Almaty, the card “Филиал на Абая” is open
  • A marker is set by a point coordinate or by an address. Markers by coordinates are free. An address is parsed every time the page opens and uses a parse. The same previously found address from the same website within 10 minutes does not use the quota. For a permanent list, get the coordinates once via /parse with your server key and keep them on your side.
  • The title and the text are shown as text: HTML in them is not interpreted.
  • addMarkers returns { added, failed }: how many markers were placed and which could not be placed, with the reason.
  • A new addMarkers call replaces the previous markers. To remove them all — map.clearMarkers().

Many points

From 51 markers the map groups them into clusters with a count. A click on a cluster zooms in.

<div id="map" style="height: 400px"></div>

<script src="https://maps.qaida.io/js/v1/qaida-maps.js"></script>
<script>
  qaida.ready.then(async () => {
    const map = new qaida.Map('map', { key: 'YOUR_BROWSER_KEY' });

    // points from your server: [{ point: [longitude, latitude], title, text }, …]
    const points = await fetch('/api/points').then((response) => response.json());
    await map.addMarkers(points);
  });
</script>
210 points in Almaty grouped into clusters

Route

A route between two points or addresses: by car, with live traffic, or on foot. The line is drawn on the map and the view fits it.

<div id="map" style="height: 400px"></div>

<script src="https://maps.qaida.io/js/v1/qaida-maps.js"></script>
<script>
  qaida.ready.then(async () => {
    const map = new qaida.Map('map', { key: 'YOUR_BROWSER_KEY', city: 'almaty' });

    // from and to: [longitude, latitude] or an address; mode: 'drive' (default, live traffic) or 'walk'
    const route = await map.route('Алматы, Абая 10', [76.9431, 43.2556], { mode: 'drive' });
    console.log(Math.round(route.distance / 100) / 10, 'km,', Math.round(route.duration / 60), 'min');
  });
</script>
  • mode — drive (by car, the default) or walk (on foot). The answer is { distance, duration, delay, geometry }: length in meters, time in seconds, traffic delay in seconds (0 on foot) and a GeoJSON line.
  • A point is [lon, lat]. Instead of a point you can pass an address: it is parsed as in geocode. Both points must be in Kazakhstan, no more than 30 km apart in a straight line on foot and 1500 km by car.
  • Routes are built by Geoapify (on foot) and TomTom (by car). Their credit is added to the map data credit and must not be removed.
  • A new route call replaces the previous route. To remove the route — map.clearRoute().

JS API reference

new qaida.Map(container, options)

The container is an element id or the element itself. The element must have a height.

ParameterTypeDefaultDescription
keyrequiredstring—Browser API key
center[lon, lat][71.43, 51.13]Map center
zoomnumber11Zoom, from 3 to 18
langstringruLanguage of labels and messages: ru or kk
cooperativeGesturesbooleanfalsetrue — the map zooms with the wheel only with Ctrl or Cmd held, on a phone — with two fingers. Useful when the map sits in the middle of a long page
houseNumbersbooleantrueHouse numbers from the Qaida registry from zoom 16. false — no numbers
themestringnatureMap theme: nature — “Nature”, as on the Qaida map website, or night
citystring—City: the map opens on it, suggestions and parsing search only there. Values — below
scopestring—The same search limit without the map frame: any scope value — region, city, KATO code

Cities for city: astana — Astana, almaty — Almaty, shymkent — Shymkent, karaganda — Karaganda, aktobe — Aktobe, taraz — Taraz, pavlodar — Pavlodar, oskemen — Oskemen (Ust-Kamenogorsk), semey — Semey, atyrau — Atyrau, kostanay — Kostanay, kyzylorda — Kyzylorda, oral — Oral (Uralsk), petropavl — Petropavl, aktau — Aktau, turkistan — Turkistan, kokshetau — Kokshetau, taldykorgan — Taldykorgan, zhezkazgan — Zhezkazgan, konaev — Konaev. The list is also in the script itself — qaida.cities.

Method or propertyWhat it does
map.readyPromise: the map has loaded. On an error it rejects with error.code, see Map errors
map.geocode(address)Parses the address and returns { text, point, level }. One parse from the quota, even if no building is found. The same previously found address from the same website within 10 minutes does not use the quota. On an error the promise rejects with error.code
map.setMarker(value, { fly })One marker: [lon, lat], { point, title, text, zoom } or a geocode result. The previous marker is removed. fly: false — no flight to the marker
map.addMarkers(list, { fit })Markers from a list, see Branches and markers. fit: false — keep the map view
map.clearMarkers()Removes the list markers
map.route(from, to, { mode, fit })A route, see Route. fit: false — keep the map view
map.clearRoute()Removes the route
map.on(event, handler)Subscribes to an event; map.off unsubscribes
map.remove()Removes the map from the page
map.maplibreThe MapLibre GL JS map object — for your own layers and handlers. Do not remove the OpenStreetMap and OpenMapTiles attribution: the data terms require it
EventWhenPayload
loadThe map has loadedThe map itself
errorThe map failed to loadAn error with a code field
markerclickA click on a markerThe addMarkers list item or the setMarker marker
routeA route is builtThe route answer

new qaida.AddressInput(field, options)

The field is the id of an <input> element or the element itself. The suggestion list appears below it, or above it when there is little room below. The field and the list are marked up for screen readers (WAI-ARIA combobox); the field’s <label for> also labels the list.

ParameterTypeDefaultDescription
mapqaida.Map—The map where the marker of the chosen address is placed
keystringmap keyNeeded only if no map is passed
langstringmap languageru or kk
scopestringmap citySearch within a region or a city, as scope. By default — the map’s city or scope
limitinteger7How many suggestions to show, 1–10
minCharsinteger3From which character suggestions are requested
EventPayload
select{ text, point, kind, level }. kind is the suggestion type, as in /suggest. level is house for a building, for the rest — the same as kind. point is null if the choice is not a building
errorAn error with a code field

input.remove() detaches the suggestions from the field. qaida.version is the script version, qaida.maplibregl is the MapLibre GL JS module.

What uses the quota

ActionWhat it uses
Loading the map, markers by coordinates, zooming and panningNothing
A suggestion request while typingOne request from the suggestion quota
geocode, a marker by addressOne parse from the quota, even if no building is found. The same previously found address from the same website within 10 minutes does not use the quota
routeOne parse from the quota per route. An address instead of a point — one more parse

The quota is the same as your account’s API quota, see Limits.

So that one visitor cannot use up the quota of the whole website, requests are limited by the visitor’s IP address. Per minute: suggestions — 60 and no more than 5 per second, parses — 15, routes — 6, map loads — 60. Per day from one IP address with one key: suggestions — 1000, parses — 200, routes — 30. Suggestions for the whole website — up to 30 per second. Beyond that the visitor gets a limit error. Addresses in addMarkers are parsed two at a time, and on a limit the script waits and retries by itself. For a list of more than 15 addresses pass points. The limits are approximate: a short burst of requests may go slightly above them.

A browser key has its own daily cap: half of the account’s daily limit, or two average days of a package, but no less than 1000 suggestions and 100 parses. A route counts as a parse. When the key uses 80% of the cap, or requests in an hour become five times the usual, an email is sent to the account address. If these are your visitors, write to support@qaida.io and the cap will be raised.

Website requirements

  • A browser with WebGL 2: recent versions of Chrome, Edge, Firefox and Safari.
  • The page is opened from a server, not from a file: otherwise the browser does not send the website address and the key is not confirmed.
  • The map element has a height.
  • On phones: if the map sits in the middle of a long page, turn on cooperativeGestures: true, otherwise the page does not scroll with a finger over the map. Use a font of at least 16 px in the address field, otherwise Safari on iPhone zooms the page while typing.

If your website has a strict Content-Security-Policy, add to your policy:

script-src  https://maps.qaida.io;
style-src   https://maps.qaida.io;
connect-src https://maps.qaida.io;
worker-src  blob:;
img-src     data: blob:;

Without worker-src blob: the map stays empty: the drawing worker starts from a blob. The list was checked on a page with default-src 'none', where the page’s own code and styles are loaded as files from its website ('self'). For brevity, the examples above use an inline <script> and a style attribute: under a strict policy, move the code to your own file or allow it with a nonce, and set the map height with a class in your CSS.

The loader is included without an integrity attribute: it is updated with every map release. If your policy requires SRI, write to us — we will give you the address of a bundle with a hash in its name and its sha384.

Visitor data. For suggestions, parsing and limits, the map sends Qaida the visitor’s IP address and the addresses the visitor types or your code parses. They are written to the request log of your key. Mention this in your website’s privacy policy.

Map errors

If the map fails to load, the error text appears inside the map block, and the map’s error event receives an error with a code field. The geocode promise rejects with the same kind of error, AddressInput emits its own error event, and addMarkers lists the markers it could not place in failed, each with its error. The map shows the text in Russian or Kazakh, by lang.

CodeText (ru)What to do
deniedЭтому сайту карта с этим ключом не разрешенаThe website address is not in the key’s list. Check the scheme and the subdomain: https://shop.kz and https://www.shop.kz are different websites
serverKeyНа странице можно использовать только браузерный ключ, привязанный к сайтуA browser key is needed, see Map on your website
badKeyКлюч API не подошелThe key is wrong or revoked
keyНе задан ключ APIPass key in the map options
originСайт не передал свой адресOpen the page from a server, not from a file
limitПревышен лимит запросов, попробуйте позжеRetry later, see What uses the quota
notFoundАдрес не найден на картеThe address has no building point: check the house number
qНе задан адресPass a non-empty address
tokenСессия карты истеклаThe script renews the session by itself. If the error repeats, reload the page
unavailableСервис карты временно недоступенRetry later
scopeГород поиска не найденCheck city or scope: the value must be from the list of cities or understood by scope
modeСпособ маршрута — walk или drivePass mode: 'walk' or mode: 'drive'
pointsДля маршрута нужны две разные точки или два адресаCheck the route points
outOfBoundsТочки маршрута должны быть в КазахстанеRoutes are built only within Kazakhstan
tooFarТочки маршрута слишком далеко друг от другаOn foot — up to 30 km in a straight line, by car — up to 1500 km
noRouteМаршрут между этими точками не найденTake points closer to a road or a crossing
dailyLimitМаршруты на сегодня закончились, попробуйте завтраThe shared daily route limit is used up; retry tomorrow
Extra data

The include parameter

Available now
Prices, building details, apartments and offices work now. Boundaries and footprints have no data yet: their include values are accepted but add null.

Extra data for an address, on request. It is not in the response by default: boundaries outweigh the address itself, and not everyone needs prices.

Works on every endpoint that returns a result object: /parse, /parse/region, /parse/city, /parse/batch, /lookup and /nearby. In a GET request list the values comma-separated; in the /parse/batch body pass a list of strings.

Values

ValueAddsWhere in the response
region_polygonRegion boundarygeometry in the kind: "region" node
city_polygonCity or village boundarygeometry in the kind: "city" or kind: "locality" node
building_polygonBuilding footprintgeometry in the building node
pricesHousing sale and rent prices per m²A market object in the result
building_infoYear built, floor count, residential complex and number of premisesyear_built, floors, complex_name, flats_count and non_residential_count in the building node
apartmentThe apartment or office from the input: kind, number and RCAThe last hierarchy node and the end of full_path_rus, full_path_kaz

Request

curl -G https://api.qaida.io/parse \
  -H "X-Api-Key: $QAIDA_API_KEY" \
  --data-urlencode "q=астана кабанбай батыра 11/5" \
  -d top_k=1 \
  -d include=prices,building_info
  • A requested field is always present. Without data its value is null, so missing data cannot be confused with a field nobody asked for.
  • The exception is apartment: without a unit no node is added and the address line does not change. Whether the unit exists is shown in match.unit_status.
  • An unknown value is a 422 error, so a typo never turns into a silently empty field.
  • If the address is not found down to the building, the hierarchy has no building node — and so no footprint, year built, floor count, complex, premises counts or apartment. Prices then come at street level.
  • /lookup and /nearby have no address string, so apartment adds nothing there.

The exclude parameter

Drops fields you do not need from the response: register codes, postcodes, the address line in the second language. The response gets shorter and batches lighter.

Works on the same endpoints: /parse, /parse/region, /parse/city, /parse/batch, /lookup and /nearby. In a GET request list fields comma-separated; in the /parse/batch body pass a list of strings.

Values

ValueDrops
hierarchyThe whole node list: the address line, coordinate and match remain
full_path_rus, full_path_kazThe address line in Russian or Kazakh
catoKATO in administrative-unit nodes
rcoRCO in unit and street nodes
rcaRCA of the building and unit
postcode, oldPostcodeNew and old postcode
cadastre_numberCadastral number of the building
land_cadastre_numberCadastral number of the land plot
matchThe match field

Request

curl -G https://api.qaida.io/parse \
  -H "X-Api-Key: $QAIDA_API_KEY" \
  --data-urlencode "q=астана кабанбай батыра 11/5" \
  -d top_k=1 \
  -d exclude=rca,rco,cato
Response with exclude=rca,rco,cato · some nodes collapsed
{
  "query": "астана кабанбай батыра 11/5",
  "results": [
    {
      "hierarchy": [
        { … },
        { … },
        { … },
        {
          "type": "geo",
          "kind": "street",
          "name_kz": "Қабанбай Батыр",
          "name_ru": "Қабанбай Батыр",
          "type_kz": "Даңғылы",
          "type_ru": "Проспект"
        },
        {
          "type": "building",
          "kind": "main",
          "number": "11/5",
          "type_kz": "Ғимарат",
          "type_ru": "Здание",
          "cadastre_number": null,
          "land_cadastre_number": "21-320-000-0000",
          "postcode": "Z05T9X8",
          "oldPostcode": "010000"
        }
      ],
      "full_path_rus": "Республика Казахстан, город республиканского значения Астана, проспект Қабанбай Батыр, здание 11/5",
      "full_path_kaz": "Қазақстан республикасы, Астана республикалық маңызы бар қаласы, Қабанбай Батыр даңғылы, 11/5 ғимарат",
      "point": [71.41329956054688, 51.14006042480469],
      "match": { … }
    }
  ],
  "scope": null,
  "scope_conflict": null,
  "search": null
}
  • A field is dropped everywhere it appears: cato disappears from every hierarchy node.
  • A dropped field is absent from the response, not sent as null.
  • Node type and kind cannot be dropped: they are how nodes are found in the hierarchy.
  • An unknown value is a 422 error.

Boundaries and footprints

soon

Boundaries of regions, cities and villages, and building footprints, as GeoJSON.

Each value adds a geometry field to its node of the hierarchy. It is a GeoJSON geometry — Polygon or MultiPolygon; its coordinates, like point, are [lon, lat] pairs.

  • Region boundary (region_polygon) — for the 17 regions and the three cities of national significance. For Almaty, Astana and Shymkent the city and “region” boundaries are the same: if both values are requested, it comes in both nodes.
  • City or village boundary (city_polygon) — in the locality node: city for cities, locality for villages and settlements. Not every village has a boundary.
  • Building footprint (building_polygon) — the outline of the building on the ground. Large cities are covered best; where there is no footprint, geometry is null.
Building node with include=building_polygon,building_info · illustrative values
{
  "type": "building",
  "kind": "main",
  "number": "11/5",
  "rca": 202100297954282,
  "postcode": "Z05T9X8",
  "geometry": {
    "type": "Polygon",
    "coordinates": [
      [
        [71.41301, 51.14021],
        [71.41358, 51.14019],
        [71.41355, 51.13991],
        [71.41298, 51.13993],
        [71.41301, 51.14021]
      ]
    ]
  },
  "year_built": 2008,
  "floors": 12,
  "complex_name": "Пример",
  "flats_count": 180,
  "non_residential_count": 12
}
A region boundary is thousands of points
Request region_polygon and city_polygon only when you really need the boundary, and store it on your side by KATO: boundaries rarely change, and sending them in every response is wasteful.

Rent and sale prices

Market housing prices per square metre for an address: flat sales and long-term rentals.

Enabled by the prices value. The result gets a market object:

FieldTypeDescription
sale_m2integer | nullSale: median, tenge per m² of total area
rent_m2integer | nullRent: median, tenge per m² per month
sale_source, rent_sourcestring | nullSource of each price: house, complex, street or null
Result with include=prices · illustrative values
{
  "hierarchy": [ … ],
  "full_path_rus": "Республика Казахстан, город республиканского значения Астана, проспект Қабанбай Батыр, здание 11/5",
  "point": [71.41329956054688, 51.14006042480469],
  "match": { … },
  "market": {
    "sale_m2": 520000,
    "rent_m2": 4300,
    "sale_source": "house",
    "rent_source": "street"
  }
}

Sale and rent are selected independently, so one address may use different levels. sale_source and rent_source identify each price source.

Where the price comes from

Prices are computed from sale and rental listings linked to register buildings. If a building has no listings, the price is taken from its residential complex, and failing that from the street.

  • This is the median of prices asked by sellers and landlords, not of closed deals.
  • A building-level price is given only for addresses found down to the building unambiguously: match.level is "house" and match.type is exact, alias or corrected. Otherwise the price could land on the house next door; such addresses get the street level straight away.
  • If there is no price at any level, sale_m2 or rent_m2 is null.

Year built, floors, complex and premises

Year built, floor count, residential complex and number of premises of the building.

Enabled by the building_info value. The building node gets these fields:

FieldTypeDescription
year_builtinteger | nullYear of construction
floorsinteger | nullNumber of floors
complex_namestring | nullName of the residential complex the building belongs to
flats_countinteger | nullNumber of flats and rooms in the building, per the Address Register
non_residential_countinteger | nullNumber of non-residential premises, offices and built-in premises in the building, per the Address Register

Premises are counted for the building record in the Address Register. null in both fields means the register knows no premises of the building: typical for private houses and new buildings. A number in one field and 0 in the other means there are premises of one kind only: a business centre has 0 flats. Parking spaces are not counted.

Apartment and office

The apartment or office from the address string, per the Address Register: unit kind, number and RCA.

When the input has an apartment or office number and the address is found down to the building, the service looks the unit up for that building in the Address Register. The result of the check comes in match.unit_status; the unit itself only with include=apartment.

The check: match.unit_status

unit_statusMeaning
foundThe building has a unit with this number in the register
not_foundThe register has units for the building, but not this number
no_dataThe register knows no units of the building. Typical for private houses and new buildings
ambiguousA Latin letter in the number fits two units of the house: “12b” is both “12б” and “12в”. Neither is chosen

The field is absent when the input has no unit number or the address is not found down to the building. The check does not affect match.type: the type rates the address down to the building, so “туран 46а кв 999” is exact with unit_status = "not_found". The unit is looked up for the answer record: the corpus if a corpus was found, otherwise the house.

The unit in the response

Enabled by the apartment value. When the unit is found (unit_status = "found"), it becomes the last hierarchy node, and the address line ends with it: “…, дом 46А, квартира 12”, “…, 46А үй, 12 пәтер”. point stays the building point.

Result for “астана проспект туран 46а кв 12” with include=apartment · hierarchy collapsed down to the unit node
{
  "hierarchy": [
    { … },
    { … },
    { … },
    { … },
    { … },
    { … },
    {
      "type": "apartment",
      "kind": "flat",
      "number": "12",
      "rca": "*****",
      "type_ru": "Квартира",
      "type_kz": "Пәтер"
    }
  ],
  "full_path_rus": "Республика Казахстан, город республиканского значения Астана, район Нұра, проспект Тұран, дом 46А, квартира 12",
  "full_path_kaz": "Қазақстан республикасы, Астана республикалық маңызы бар қаласы, Нұра ауданы, Тұран даңғылы, 46А үй, 12 пәтер",
  "point": [71.40022277832031, 51.11112976074219],
  "match": {
    "level": "house",
    "type": "exact",
    "ambiguous": false,
    "unmatched": [],
    "corrections": [],
    "requested_unit": "12",
    "unit_status": "found"
  }
}
FieldTypeDescription
typestringAlways apartment
kindstringUnit kind: flat — apartment, room — room, non_residential — non-residential premises, office — office, built_in — built-in premises
numberstringNumber as in the register, letters in lower case: “12”, “12а”, “5/1”
rcainteger | stringUnit RCA, 16 digits. A number only for accounts with access to unit RCAs; others get the string "*****". Access is granted on request at qaida@tenzor-ai.com
type_ru, type_kzstringUnit kind in words: “Квартира”, “Нежилое помещение”…; the word used for the unit in full_path

If the unit is not found, there is no node and the address line does not change. exclude=rca removes the RCA from the unit node too.

Which unit is looked up

An apartment and a non-residential unit in one building often share a number, with different RCAs. The word in the input decides which one to look for:

  • “кв”, “квартира”, “пәтер” right at the number — apartments and rooms only; “офис”, “оф”, “кеңсе”, “кабинет” — non-residential premises, offices and built-in premises only. “туран 46а кв 12” is apartment 12, “туран 46а офис 12” is non-residential unit 12 of the same house.
  • A word elsewhere in the input — units of its kind first, then the rest.
  • No word (“абая 10-12”) — apartments and rooms first.
  • “н.п. 12” is how the eGov portal writes a non-residential unit: only non-residential premises are looked up, and an apartment with the same number is never substituted.
  • The spelling of the number does not matter: “12-А”, “12 а” and “12a” all find “12а”.

A number right after the house number

Apartments are often written without “кв”: “астана проспект туран 46а 12”. If the register has no corpus 12 and no house 46А/12, but house 46А has apartment 12, the number is read as the apartment:

match for “астана проспект туран 46а 12”
{
  "level": "house",
  "type": "corrected",
  "ambiguous": false,
  "unmatched": [],
  "corrections": [
    {
      "original": "46А 12",
      "replacement": "46А, кв. 12",
      "kind": "unit"
    }
  ],
  "requested_unit": "12",
  "unit_status": "found"
}
  • The answer type is corrected, corrections has a pair with kind: "unit", and the number is in requested_unit. If the response has a search block, the type does not change and stays partial.
  • Only an apartment is read this way. A non-residential unit needs the word “офис”.
  • If the register has no apartment with this number, the answer is as before: the house with match.type = "partial" and the number in unmatched — it may be an apartment or something else.

The units parameter

On /parse, /parse/extended, /parse/region, /parse/city and /parse/batch the Address Register check is on by default (units=true). units=false turns it off entirely: match has no unit_status, a number after the house number is not read as an apartment, and include=apartment adds no unit. A number named explicitly in the input (“кв 12”) stays in match.requested_unit. On /suggest and /suggest/compact the parameter works the other way round — false by default, see Apartments in suggestions. /lookup, /nearby and /demo/* have no such parameter.

Reference

The scope parameter

Restricts the search to one administrative unit. Works in /parse, every /suggest, /parse/batch, and is required on the level endpoints. When the city is known in advance, there is no need to glue it onto the address string.

Three kinds of value

KindExampleRules
Nameалматы, ЕкібастұзRussian or Kazakh, as in the register. Case-insensitive. No words like “город” or “область”, no “г.” abbreviations, no typos: “Алматинская” is recognized, “Алматинская область” is not. The register spells the Jetisu and Ulytau regions, Konaev and Ushtobe in Kazakh, but their Russian names are accepted too: “Жетысуская”, “Улытауская”, “Конаев”, “Кунаев”, “Капчагай”, “Уштобе”
KATO code750000000Nine digits
UID1The scope.uid value from an earlier response

When several units share a name, the most significant one wins: cities of national significance first, then regions, then everything else. For example, “алматы” is the city of Almaty, not the Almaty Region and not a village of the same name. The scope block in the response shows which unit was taken. Pass KATO to be unambiguous.

The scope block in a response
{
  "uid": 1,
  "kato": 750000000,
  "name_ru": "Алматы",
  "name_kz": "Алматы",
  "type_ru": "Город республиканского значения",
  "type_kz": "Республикалық маңызы бар қаласы",
  "matched_by": "name"
}
FieldTypeDescription
uidintegerInternal unit identifier
katointegerKATO code
name_ru, name_kzstringName in Russian and Kazakh
type_ru, type_kzstringUnit type: “Область”, “Город республиканского значения”, “Село”…
matched_bystringHow the value was recognized: name, kato or uid

Behaviour

CaseResponse
The address is not in the unit200 With an empty results. The service does not fall back to a country-wide search, so an address from another city is never substituted: the extended parameter has no effect together with scope
The value is not recognized422 неизвестная область поиска
The query names another city200 The answer still comes from the scope unit, and scope_conflict is true. Worth checking the source data
“астана кабанбай батыра 11/5” with scope=алматы
{
  "query": "астана кабанбай батыра 11/5",
  "results": [
    {
      "hierarchy": [ … ],
      "full_path_rus": "Республика Казахстан, город республиканского значения Алматы, улица Кабанбай батыра",
      "full_path_kaz": "Қазақстан республикасы, Алматы республикалық маңызы бар қаласы, КАБАНБАЙ БАТЫР көшесі",
      "point": [null, null],
      "match": {
        "level": "street",
        "type": "partial",
        "ambiguous": false,
        "unmatched": ["house:11/5"],
        "corrections": []
      }
    }
  ],
  "scope": {
    "uid": 1,
    "kato": 750000000,
    "name_ru": "Алматы",
    "name_kz": "Алматы",
    "type_ru": "Город республиканского значения",
    "type_kz": "Республикалық маңызы бар қаласы",
    "matched_by": "name"
  },
  "scope_conflict": true,
  "search": null
}

scope_conflict can fire falsely when a street is named after a city, such as “Алатау”.

The extended parameter

Covers strings where a street is given without a locality: “достык 89б”, “абая 135”. /parse, /suggest and /suggest/compact have this parameter, and it defaults to true.

  • true. The service first parses the string the regular way. If that gives no confirmed address, it tries again: it reads a locality written after the house number, or searches for the street across the whole country. Such an answer is marked with a search block. When the answer is regular, search is null.
  • false. The regular parse only: a street is searched just inside the locality named in the string. A string without one gives an empty results or a unit with that name: “достык 89б” is the village of Dostyk.
200 response · /parse, “достык 89б”, hierarchy collapsed
{
  "query": "достык 89б",
  "results": [
    {
      "hierarchy": [ … ],
      "full_path_rus": "Республика Казахстан, город республиканского значения Алматы, проспект Достык, дом 89Б",
      "full_path_kaz": "Қазақстан республикасы, Алматы республикалық маңызы бар қаласы, Достық даңғылы, 89Б үй",
      "point": [76.95661163330078, 43.238582611083984],
      "match": {
        "level": "house",
        "type": "partial",
        "ambiguous": false,
        "unmatched": [],
        "corrections": []
      }
    }
  ],
  "scope": null,
  "scope_conflict": null,
  "search": {
    "mode": "streets",
    "streets": 929,
    "localities": 853,
    "complete": true,
    "dropped": [],
    "place": null,
    "hypothesis": "H0",
    "role": "replaced",
    "superseded": {
      "level": "locality",
      "type": "partial",
      "full_path_rus": "Республика Казахстан, область Жетісу, район Каратальский, город районного значения Үштөбе, село Достык",
      "full_path_kaz": "Қазақстан республикасы, Жетісу облысы, Қаратал ауданы, Үштөбе аудандық маңызы бар қаласы, Достық ауылы"
    },
    "engine_type": "exact"
  }
}

The house is found, but Almaty was not in the string, so match.type is partial, and search.engine_type keeps the type given by the country-wide search — exact. The previous answer of the regular parse, the village of Dostyk, is in search.superseded. The same query with extended=false returns that village:

curl -G https://api.qaida.io/parse \
  -H "X-Api-Key: $QAIDA_API_KEY" \
  --data-urlencode "q=достык 89б" \
  -d extended=false

The search block

FieldTypeDescription
search.rolestringWhat was done with the answer, see the table below
search.modestringstreets — the street was searched across the country, the city in the answer was chosen by the service; scope — the answer lies inside the unit named in the string; unit — the answer is the named unit itself; units — unit suggestions. The context value never occurs here
search.supersededobject | nullThe replaced answer of the regular parse: level, type, full_path_rus, full_path_kaz. Only with role = "replaced", otherwise null
search.engine_typestring | nullThe type of the first answer in the country-wide search when match.type lowers it to partial; otherwise null

The other fields of the block — streets, localities, complete, dropped, place and hypothesis — are the same as in /parse/extended.

roleWhat happenedExample
filledThe regular answer was empty; the country-wide search answers“абая 135” → Almaty, Abai Avenue, 135
replacedThe regular answer was unconfirmed and was replaced with the country-wide one; the former is in superseded“достык 89б”: the village of Dostyk → Almaty, Dostyk Avenue, 89Б
appendedThe regular answer stays first; country-wide candidates follow it, ahead of the other regular answers. Only occurs with top_k of two or more“достык”: the village of Dostyk, then Dostyk Avenue in Almaty
reorderedThe locality stood after the house number. The answer is the regular parse of the same string with the locality moved to the front; the country-wide search took no part. place is that locality; mode is scope when the answer is an address inside it and unit when it is the locality itself“ул. Абая 135, Кокшетау” → Kokshetau, Abai Street, 135
mergedSuggestions only: a word is being typed, and suggestions of units and of streets across the country are merged into one list“астана”: the city of Astana, then Astana streets in other cities
search for “ул. Абая 135, Кокшетау”
{
  "mode": "scope",
  "streets": null,
  "localities": null,
  "complete": true,
  "dropped": [],
  "place": "Кокшетау",
  "hypothesis": null,
  "role": "reordered",
  "superseded": null,
  "engine_type": null
}

With role = "reordered" the country-wide search took no part, so streets, localities and hypothesis are null.

The service chose the city

With role of filled or replaced and mode = "streets", the string had no city: the service chose it. Such an answer always comes with match.type = "partial", even when the house is found and match.unmatched is empty. Country-wide candidates under role = "appended" come with the same type. The type given by the country-wide search is in search.engine_type.

So the rule for automatic processing needs no change: a house in a city you did not name is not treated as confirmed. If you want such a house anyway, read search.engine_type. With role = "reordered" the city comes from the string, and the answer type is the same as in the regular parse.

Suggestions

In /suggest and /suggest/compact the country-wide search runs when there are no regular suggestions or the first of them is neither a street nor a house. While a word is being typed, the order is: the region or city whose name is being typed, then streets across the country, then regular suggestions — villages, districts and the rest. A region or city comes first from three typed letters; at two letters only Almaty, Astana and Shymkent do.

200 response · /suggest, “астана”, limit=5
{
  "query": "астана",
  "suggestions": [
    {
      "kind": "region",
      "uid": 2,
      "text_ru": "Республика Казахстан, город республиканского значения Астана",
      "text_kz": "Қазақстан республикасы, Астана республикалық маңызы бар қаласы",
      "point": [null, null]
    },
    {
      "kind": "street",
      "uid": 25446,
      "text_ru": "Республика Казахстан, город республиканского значения Алматы, микрорайон Альмерек, улица Астана",
      "text_kz": "Қазақстан республикасы, Алматы республикалық маңызы бар қаласы, Әлмерек шағын ауданы, Астана көшесі",
      "point": [null, null]
    },
    {
      "kind": "street",
      "uid": 95890,
      "text_ru": "Республика Казахстан, город республиканского значения Шымкент, микрорайон Тассай, улица Астана",
      "text_kz": "Қазақстан республикасы, Шымкент республикалық маңызы бар қаласы, Тассай шағын ауданы, Астана көшесі",
      "point": [null, null]
    },
    {
      "kind": "street",
      "uid": 8843,
      "text_ru": "Республика Казахстан, область Павлодарская, город областного значения Павлодар, улица Астана",
      "text_kz": "Қазақстан республикасы, Павлодар облысы, Павлодар облыстық маңызы бар қаласы, Астана көшесі",
      "point": [null, null]
    },
    {
      "kind": "district",
      "uid": 81,
      "text_ru": "Республика Казахстан, область Актюбинская, город областного значения Актобе, район в городе Астана",
      "text_kz": "Қазақстан республикасы, Ақтөбе облысы, Ақтөбе облыстық маңызы бар қаласы, Астана қала ішіндегі аудан",
      "point": [null, null]
    }
  ],
  "scope": null,
  "search": {
    "mode": "streets",
    "streets": 317,
    "localities": 287,
    "complete": true,
    "dropped": [],
    "place": null,
    "hypothesis": "H0",
    "role": "merged",
    "superseded": null,
    "engine_type": null
  }
}
  • The list is never longer than limit, so some regular suggestions drop out of it. With limit above one at least one stays; with limit = 1 none may stay.
  • Input ending with a space or an apartment is read as in /parse: the roles filled, replaced, appended, reordered.
  • With extended=false only regular suggestions come: for “астана” that is the city and a district, with no streets.

Where the country-wide search never runs

  • With the scope parameter. You set the search area, and it is never widened.
  • On the level endpoints /parse/region, /parse/city, /suggest/region and /suggest/city: they have no extended parameter.
  • In /parse/batch. Every string of a batch is parsed like /parse with extended=false, and the batch response has no search block.
  • When the regular parse found a house, even with type partial: it is no longer searched for across the country. A locality after the house number is still read (reordered).

include and exclude leave the search block as it is; it cannot be removed with exclude.

When you need extended=false
If your code treats any non-empty results as a found address, or takes point of the first result without looking at match.type, then for a string without a city it gets a house in a city the string never named. If your users pick a village or a district from suggestions, streets rank above them by default. extended=false brings back the previous behaviour in both cases: the regular parse and regular suggestions only.

The extended parameter and the /parse/extended and /suggest/extended endpoints are different things: on the endpoints the country-wide search always runs and the answer type is not lowered.

Result object

One address candidate. The same in /parse, /parse/extended, the level endpoints, /parse/batch, /lookup and /nearby.

FieldTypeDescription
hierarchyarrayAddress nodes from the country down to the building, or down to the unit with include=apartment
full_path_russtringThe full address as one line in Russian
full_path_kazstringThe same in Kazakh
point[lon, lat]Building coordinate or [null, null]
matchobject | nullHow closely the input matched, see The match field
marketobjectSale and rent prices per m², only with include=prices. See Rent and sale prices

Hierarchy

Nodes go from general to specific: country, administrative units, streets and areas, building, and with include=apartment an apartment or office. Depth depends on the place: a village in a region has a district and a rural district, a street in Almaty does not. So find the level you need by the kind field, not by position in the list.

  1. atscountryRepublic of Kazakhstan
  2. atsregionAlmaty Region KATO 190000000
  3. atsdistrictZhambyl District KATO 194200000
  4. atsareaKargaly Rural District KATO 194279000
  5. atslocalityKargaly village KATO 194279100
  6. geostreetAlatau Street RCO 4000000023817
  7. buildingmainhouse 77 RCA 201300062040406 · B33G1H8

For the cities of national significance — Almaty, Astana and Shymkent — the same node appears twice: with kind: "city" and with kind: "region". That way every address has a node with kind: "region".

Node fieldDescription
type: "ats" — administrative unit
kindcountry, region, district, city, area or locality
name_ru, name_kzName
type_ru, type_kzType: “Область”, “Район”, “Село”…
rcoRCO; null for the country
catoKATO; null for the country
geometrysoon GeoJSON boundary, only with include=region_polygon or city_polygon. See Boundaries and footprints
type: "geo" — street or area
kindstreet — street, avenue, lane; area — microdistrict, housing estate, garden partnership
name_ru, name_kz, type_ru, type_kzName and type
rcoRCO
catoAlways null: only administrative units have KATO
type: "building" — building
kindRegister record kind: main, corpus or block
numberNumber as in the register: “77”, “89Б”, “11/5”
type_ru, type_kz“Дом”, “Здание”…; the word used for the building in full_path
rcaRCA
cadastre_numberCadastral number of the building itself; null for many buildings
land_cadastre_numberCadastral number of the land plot the building stands on; null if unknown
postcodeNew postcode
oldPostcodeOld postcode, a 6-digit string
geometrysoon GeoJSON building footprint, only with include=building_polygon
year_built, floors, complex_name, flats_count, non_residential_countYear built, floor count, complex name and premises counts, only with include=building_info. See Year built, floors, complex and premises
type: "apartment" — apartment or office, only with include=apartment
kindflat, room, non_residential, office or built_in
numberNumber as in the register, letters in lower case
rcaUnit RCA with extra access, otherwise "*****". See Apartment and office
type_ru, type_kz“Квартира”, “Нежилое помещение”…; the word used for the unit in full_path

Names come exactly as they are in the register. The Russian field sometimes holds the Kazakh spelling (“Қабанбай Батыр”), and letter case varies.

The match field

Shows how well the answer corresponds to the input. Use it to decide whether to accept an address automatically.

FieldTypeDescription
levelstringHow deep the address was found: house or the kind of the last node — street, area, locality, city…
typestringMatch quality, see the table below
ambiguousbooleanSeveral objects fit equally well
unmatchedstring[]What from the input was not found. Words come as typed, number components with a prefix: house:93, corpus:2, structure:1
correctionsarrayCorrections: {"original": …, "replacement": …, "kind": …}. No kind — a corrected typo; kind: "house" — the house number was replaced with the register record (“102” → “102/41”, “7 2” → “7/2”); kind: "name" — a former city name (“актюбинск” → “актобе”); kind: "unit" — a number after the house number was read as an apartment (“46А 12” → “46А, кв. 12”)
requested_unitstringApartment or office number from the input. Present only when the input had one
unit_statusstringWhether the requested_unit unit exists for the building in the Address Register: found, not_found, no_data or ambiguous. Only when the address is found down to the building. See Apartment and office
locality_relationstringOnly on results of the country-wide search — in /parse/extended and in /parse with a search block — when the string contains a place name: same, descendant or none

type values

typeMeaningWhat to do
exactEverything matched the register directlyAccept
aliasThe street was found by another spelling of its name or by a duplicate record in the registerAccept
correctedSomething in the input was corrected: a typo, the house number, the apartment or a city name; listed in correctionsAccept; spot-check in bulk processing
ambiguousSeveral objects fit equally well; the first is the best rankedRequest top_k above 1 and show the options, or clarify the address
partialPart of the input was not found or not read: the answer may be less detailed than the query, or reach the building with the leftover in unmatched. It also comes with an empty unmatched, when the string had no city and the service chose one. The reason is then in the search block, see The extended parameterDo not treat the address as confirmed; check unmatched and search

When several values apply, type shows the strictest in the order partial → ambiguous → corrected → alias → exact. For example, a typo in an ambiguous address gives ambiguous, while the correction stays visible in corrections:

match for “алмаиы абылай хана 1”: Almaty has two “Абылай хана, 1”
{
  "level": "house",
  "type": "ambiguous",
  "ambiguous": true,
  "unmatched": [],
  "corrections": [
    {
      "original": "алмаиы",
      "replacement": "алматы"
    }
  ]
}
match for “алматы, ул. толе би дом 102”: the register holds number 102 as 102/41
{
  "level": "house",
  "type": "corrected",
  "ambiguous": false,
  "unmatched": [],
  "corrections": [
    {
      "original": "102",
      "replacement": "102/41",
      "kind": "house"
    }
  ]
}
Rule for automatic processing
An address is confirmed down to the building when match.level is "house" and match.type is not "partial".

All response fields

Every field the API returns, by response and object. Details are in the endpoint sections. Fields marked “soon” currently return null when requested with include.

FieldTypeDescription
/parse, /parse/region, /parse/city response
querystringThe query string as sent
resultsarrayResult objects, best first
scopeobject | nullHow scope was understood, see the fields below
scope_conflictboolean | nullThe query names a city outside scope
searchobject | nullHow the country-wide search took part; null when the answer is a regular parse. Always null in /parse/region and /parse/city. See The extended parameter
search.rolestringfilled, replaced, appended or reordered
search.modestringstreets, scope or unit; the other fields of the block are as in /parse/extended below
search.supersededobject | nullThe replaced answer of the regular parse: level, type, full_path_rus, full_path_kaz
search.engine_typestring | nullThe answer type in the country-wide search when match.type lowers it to partial
/parse/extended response
searchobjectHow the string was read; present in every response, without role, superseded and engine_type. The other fields are as in /parse. See /parse/extended
search.modestringstreets, scope, unit, units or context
search.streets, search.localitiesinteger | nullHow many streets matched by name and in how many localities
search.completebooleanfalse — some candidates were not checked because of a limit
search.droppedstring[]Words of the string that did not make it into the street name of the answer
search.placestring | nullThe unit named in the string
search.hypothesisstring | nullThe winning reading: H0, H1, S0, U and others
results[].match.locality_relationstringsame, descendant or none; only when a place is named
/parse/batch response
countintegerNumber of addresses
items[].addressstringThe address from the request
items[].resultsarrayResult objects for this address
items[].scope_conflictboolean | nullThe scope_conflict flag for this address
scopeobject | nullHow scope was understood, shared by the batch
/lookup response
querystringThe query string
matched_bystringpostcode, rca or old_postcode
house_countintegerHow many buildings in the register carry this code
resultsarrayResult objects; match is null
/nearby response
query.lat, query.lonnumberThe query point
resultsarrayResult objects, nearest first
results[].distance_mnumberDistance from the query point, m
results[].shared_pointintegerHow many buildings sit at the same point
/suggest, /suggest/compact, /suggest/region, /suggest/city, /suggest/extended, /suggest/compact/extended response
searchobject | nullIn /suggest and /suggest/compact — how the country-wide search took part, as in /parse, plus the merged role; null when the suggestions are regular. Always null in /suggest/region and /suggest/city. In /suggest/extended and /suggest/compact/extended — the same block as in /parse/extended, always present
querystringThe query string
suggestions[].kindstringregion, city, district, area, locality, street, house, address, and with units=true — apartment
suggestions[].uidinteger | nullInternal object identifier
suggestions[].text_ru, suggestions[].text_kzstringAddress line in Russian and Kazakh
suggestions[].point[lon, lat]House coordinate or [null, null]
scopeobject | nullHow scope was understood
Result object
hierarchyarrayNodes from the country down to the building, or to the unit with include=apartment; see below
full_path_rus, full_path_kazstringThe full address as one line
point[lon, lat]Building coordinate or [null, null]
matchobject | nullMatch quality, see below
marketobjectPrices per m², with include=prices
type: "ats" node — administrative unit
type, kindstringats; country, region, district, city, area or locality
name_ru, name_kzstringName
type_ru, type_kzstringUnit type
rcointeger | nullRCO
catointeger | nullKATO
geometrysoonobject | nullBoundary, with include=region_polygon or city_polygon
type: "geo" node — street or area
type, kindstringgeo; street or area
name_ru, name_kz, type_ru, type_kzstringName and type
rcointegerRCO
catonullAlways null
type: "building" node — building
type, kindstringbuilding; main, corpus or block
numberstringNumber as in the register
type_ru, type_kzstring“Дом”, “Здание”…
rcaintegerRCA
cadastre_numberstring | nullCadastral number of the building
land_cadastre_numberstring | nullCadastral number of the land plot
postcodestring | nullNew postcode
oldPostcodestring | nullOld postcode, 6 digits
geometrysoonobject | nullBuilding footprint, with include=building_polygon
year_builtinteger | nullYear built, with include=building_info
floorsinteger | nullFloor count, with include=building_info
complex_namestring | nullResidential complex name, with include=building_info
flats_countinteger | nullNumber of flats, with include=building_info
non_residential_countinteger | nullNumber of non-residential premises, with include=building_info
type: "apartment" node — apartment or office, with include=apartment
type, kindstringapartment; flat, room, non_residential, office or built_in
numberstringNumber as in the register
rcainteger | stringUnit RCA with extra access, otherwise "*****"
type_ru, type_kzstring“Квартира”, “Нежилое помещение”…
match object
levelstringHow deep the address was found
typestringexact, alias, corrected, ambiguous or partial
ambiguousbooleanSeveral objects fit equally well
unmatchedstring[]What from the input was not found
corrections[].original, corrections[].replacementstringWhat was corrected and what it became
corrections[].kindstringhouse — the house number was replaced with the register record, name — a former city name, unit — a number after the house number was read as an apartment; absent for a typo
requested_unitstringApartment or office from the input; only when present
unit_statusstringfound, not_found, no_data or ambiguous; only with requested_unit and an address down to the building
locality_relationstringsame, descendant or none; only on results of the country-wide search
scope object
uidintegerInternal unit identifier
katointegerKATO
name_ru, name_kz, type_ru, type_kzstringName and type
matched_bystringname, kato or uid
market object
sale_m2, rent_m2integer | nullSale and rent: median, tenge per m²
sale_source, rent_sourcestring | nullPrice source: house, complex, street or null
Error
detailstring | arrayReason for the error
detail[].type, detail[].loc, detail[].msgstring, array, stringFor parameter errors: error kind, field and reason

Valid regions

The 20 scope values for /parse/region and /suggest/region. Use the Russian or Kazakh name, or the KATO code.

NameKazakhKATOType
АлматыАлматы750000000City of national significance
АстанаАстана710000000City of national significance
ШымкентШымкент790000000City of national significance
АбайАбай100000000Region
АкмолинскаяАқмола110000000Region
АктюбинскаяАқтөбе150000000Region
АлматинскаяАлматы190000000Region
АтыраускаяАтырау230000000Region
Восточно-КазахстанскаяШығыс Қазақстан630000000Region
ЖамбылскаяЖамбыл310000000Region
ЖетысускаяЖетісу330000000Region
Западно-КазахстанскаяБатыс Қазақстан270000000Region
КарагандинскаяҚарағанды350000000Region
КостанайскаяҚостанай390000000Region
КызылординскаяҚызылорда430000000Region
МангистаускаяМаңғыстау470000000Region
ПавлодарскаяПавлодар550000000Region
Северо-КазахстанскаяСолтүстік Қазақстан590000000Region
ТуркестанскаяТүркістан610000000Region
УлытаускаяҰлытау620000000Region

Valid cities

scope values for /parse/city and /suggest/city, grouped by region. Use the Russian or Kazakh name, or the KATO code. /parse and /suggest also accept any other administrative unit — district, rural district, village — by name or KATO.

CityKazakhKATOSignificance
Cities of national significance
АлматыАлматы750000000national
АстанаАстана710000000national
ШымкентШымкент790000000national
Abai Region
КурчатовКурчатов101810000regional
СемейСемей101010000regional
АягозАягөз103620100district
ШарШар104221100district
Akmola Region
КокшетауКөкшетау111010000regional
КосшыКосшы111610000regional
СтепногорскСтепногорск111810000regional
АккольАқкөл113220100district
АтбасарАтбасар113820100district
ДержавинскДержавин115420100district
ЕрейментауЕрейментау114620100district
ЕсильЕсіл114820100district
МакинскМакинск114020100district
СтепнякСтепняк114520100district
ЩучинскЩучинск117020100district
Aktobe Region
АктобеАқтөбе151010000regional
АлгаАлға153220100district
ЖемЖем154825100district
КандыагашҚандыағаш154820100district
ТемирТемір155621100district
ХромтауХромтау156020100district
ШалкарШалқар156420100district
ЭмбаЕмбі154823100district
Almaty Region
АлатауАлатау191810000regional
Конаев (Кунаев, Капчагай)Қонаев191010000regional
ЕсикЕсік194020100district
КаскеленҚаскелең195220100district
ТалгарТалғар196220100district
Atyrau Region
АтырауАтырау231010000regional
КульсарыҚұлсары233620100district
East Kazakhstan Region
РиддерРиддер632410000regional
Усть-КаменогорскӨскемен631010000regional
АлтайАлтай634820100district
ЗайсанЗайсан634620100district
СеребрянскСеребрянск634821100district
ШемонаихаШемонаиха636820100district
Jambyl Region
ТаразТараз311010000regional
ЖанатасЖаңатас316020100district
КаратауҚаратау316220100district
ШуШу316621100district
Jetisu Region
ТалдыкорганТалдықорған331010000regional
ТекелиТекелі331810000regional
ЖаркентЖаркент334620100district
СарканСарқан334820100district
УшаралҮшарал333420100district
УштобеҮштөбе334420100district
West Kazakhstan Region
УральскОрал271010000regional
АксайАқсай273620100district
Karaganda Region
БалхашБалқаш351610000regional
КарагандаҚарағанды351010000regional
ПриозерскПриозерск352110000regional
СараньСаран352210000regional
ТемиртауТеміртау352410000regional
ШахтинскШахтинск352810000regional
АбайАбай353220100district
КаркаралинскҚарқаралы354820100district
Kostanay Region
АркалыкАрқалық391610000regional
КостанайҚостанай391010000regional
ЛисаковскЛисаковск392010000regional
РудныйРудный392410000regional
ЖитикараЖітіқара394420100district
ТобылТобыл395420100district
Kyzylorda Region
БайконырБайқоңыр431910000regional
КызылордаҚызылорда431010000regional
АральскАрал433220100district
КазалинскҚазалы434423100district
Mangystau Region
АктауАқтау471010000regional
ЖанаозенЖаңаөзен471810000regional
Форт-ШевченкоФорт-Шевченко475220100district
Pavlodar Region
АксуАқсу551610000regional
ПавлодарПавлодар551010000regional
ЭкибастузЕкібастұз552210000regional
North Kazakhstan Region
ПетропавловскПетропавл591010000regional
БулаевоБулаев593620100district
МамлюткаМамлютка595220100district
СергеевкаСергеевка595620100district
ТайыншаТайынша596020100district
Turkistan Region
АрысАрыс611610000regional
КентауКентау612010000regional
ТуркестанТүркістан611010000regional
ЖетысайЖетісай613820100district
ЛенгерЛеңгір615820100district
СарыағашСарыағаш615420100district
ШардараШардара616420100district
Ulytau Region
ЖезказганЖезқазған621010000regional
КаражалҚаражал621810000regional
СатпаевСәтбаев622010000regional

Integrating reliably

  • Timeouts and retries. Use a timeout of about 5 seconds. Retry only 429 and 503, after waiting Retry-After.
  • Check quality, not just presence. A non-empty results does not mean a house was found: look at match.level and match.type. For a string without a city /parse by default returns a house in a city of its own choice — with type partial.
  • Pass the city you know. If the city or region is a separate field in your data, use scope or the level endpoints. The address is then found even when the city is not in the string, and is never confused with a same-named street elsewhere.
  • Watch scope_conflict. In bulk processing true usually points to an error in the source data.
  • Large volumes in batches. For a database export use /parse/batch with 100 addresses per request, not separate /parse calls. A batch is always parsed like /parse with extended=false, so for strings without a city its answer differs from the default /parse answer, see /parse/batch.

Contacts