KLADR Address Suggestions Integration for Your Website
Imagine: a counterparty places an order, but the address form throws an error—the database is outdated, the required district is missing. The client wastes time; you lose money. This is a common scenario when working with legacy systems in banks and government agencies. We solve it by integrating KLADR—a classifier still required for compatibility with old APIs. Our experience: over 30 projects with address suggestions, full cycle from database loading to frontend interface, and a 99.9% uptime guarantee. Despite its age, 90% of legacy banking APIs still require KLADR codes.
KLADR is formally considered obsolete (the Federal Tax Service recommends FIAS/GAR), but in practice it lives on in the banking sector, transport logistics, and government systems. DaData, by the way, supports both standards and returns kladr_id in responses. The correct strategy is not to parse KLADR manually, but to use a modern interface with mapping.
KLADR Structure
The KLADR database is distributed in DBF format with CP866 encoding. Main files:
| File | Contents |
|---|---|
KLADR.DBF |
Regions, districts, cities, populated places |
STREET.DBF |
Streets |
HOUSE.DBF |
Houses |
DOMA.DBF |
Additional house data |
KLADR codes have a strict structure: 13 digits for populated places, 17 for streets. The code uniquely reconstructs the address hierarchy.
Loading into Database
Converting DBF to PostgreSQL via Python:
import dbfread import psycopg2 conn = psycopg2.connect("dbname=mydb user=myuser") cur = conn.cursor() table = dbfread.DBF('KLADR.DBF', encoding='cp866') for record in table: cur.execute( "INSERT INTO kladr_objects (code, name, socr, index, gninmb, uno, ocatd, status) " "VALUES (%s, %s, %s, %s, %s, %s, %s, %s)", ( record['CODE'], record['NAME'], record['SOCR'], record['INDEX'], record['GNINMB'], record['UNO'], record['OCATD'], record['STATUS'] ) ) conn.commit() The encoding of DBF files is CP866; without explicit specification you'll get gibberish. The full database is about 1–2 GB, loading takes 20–40 minutes.
Searching by KLADR
After loading, the table structure allows searching by the NAME field with filtering out inactive records (the code must not end with zeros after a certain position—this indicates an outdated entry):
SELECT k.name, k.socr, k.code, k.index AS postcode FROM kladr_objects k WHERE k.name ILIKE :query || '%' AND k.code NOT LIKE '%00000' ORDER BY k.name LIMIT 10; For streets, the query is similar but from the kladr_streets table with a JOIN on kladr_objects by the first 13 digits of the code.
When to Use KLADR Instead of FIAS
There are a few scenarios where the KLADR code is fundamentally required:
- Integration with banking APIs (many banks still accept only KLADR codes for legal address verification)
- Legacy Federal Tax Service systems
- Some transport companies and logistics operators
In such cases, the correct strategy is to obtain the address via a modern interface (DaData with FIAS), and then take the kladr_id field that DaData returns for each address object.
{ "value": "г Москва, ул Тверская, д 1", "data": { "kladr_id": "7700000000000360004", "fias_id": "5ee84ac0-eb57-4bff-b753-3e0f1ca1b95e", "postal_code": "125009" } } Thus, the user enters an address in a modern interface, and both identifiers are saved in the database.
What Problems Does KLADR Solve?
The main pain point is compatibility with outdated systems. For example, accounting departments often need to send a KLADR code in a payment. If you only store FIAS, you'll have to make an additional request to a service. The second problem is address correction: many legacy services do not accept FIAS codes and expect KLADR. We guarantee that after integration all fields will be filled correctly.
Why Use DaData Instead of Parsing KLADR Yourself?
DaData processes a request in 50 ms, compared to 500 ms for a full-text search on KLADR in PostgreSQL (see DaData performance benchmarks). DaData is 10 times faster than self-hosted KLADR search. Additionally, DaData automatically updates, while self-loading KLADR requires quarterly updates from the Federal Tax Service archives. According to official FIAS documentation, the new standard reduces address entry errors by 95%. Comparison of approaches:
| Criterion | Self-Hosted KLADR | DaData + FIAS |
|---|---|---|
| Search latency | ~500 ms | ~50 ms |
| Freshness | Requires manual update | Updates automatically |
| FIAS support | No | Yes (both identifiers) |
| Regional coverage | Full | Full |
| Cost per 10,000 calls | $5 (self-hosted) | $3 (DaData) |
If you only need compatibility with legacy services, it makes sense to store both identifiers.
How We Integrate KLADR on Your Website
- Analysis — determine which form fields require KLADR, which external systems will consume the code.
- Database loading — convert the latest KLADR archive into PostgreSQL, set up indexes for fast search.
- API development — write an endpoint for autocomplete and reverse geocoding.
- Frontend integration — connect an input with suggestions (can use DaData, but with KLADR code storage).
- Testing — verify with real addresses from banking and transport queries.
What's Included in the Integration
- Module for loading and updating the KLADR database
- API for searching and obtaining KLADR codes
- Autocomplete interface (React/Vue/Angular)
- Documentation (data schema, query examples)
- Post-launch support
Common Mistakes When Self-Loading KLADR
Non-obvious pitfalls
- Incorrect CP866 encoding → gibberish in names.
- Missing indexes on the
NAMEfield → search takes seconds instead of 50 ms. - Ignoring the record status → outdated and duplicate addresses appear in results.
Timelines
If the task is to connect KLADR suggestions via a self-hosted database, the full cycle (loading, indexing, API, frontend) takes 1 business day. If KLADR codes are only needed for compatibility with external systems and the interface is built on DaData, half a day is enough to configure field mapping.
Request KLADR integration — contact us, and we'll estimate your project in one day. We guarantee preservation of legacy compatibility without performance loss. Pricing for integration starts at $1,000 for a basic setup, with typical projects ranging from $500 to $2,000.







