API for large lists
IKPU codes for thousands of products at once — by barcode, name, package code or customs (TN VED) code. The same search as on the site, built for your software: an accounting system, a till or a marketplace.
Getting a key
Sign in with a Krafta account (email or Telegram) and create a key in your account. Keys are free and work at once.
Get a keyRequests
Send the key in the Authorization header. The API lives at https://tasnif.krafta.uz/api/v1. Answers are always JSON.
Authorization: Bearer $TASNIF_KEYSearch
GET https://tasnif.krafta.uz/api/v1/search?q=…&limit=10
Takes anything the site's search box takes: words in Russian, Uzbek or English, a barcode, an IKPU code, a package code, a customs code. limit is how many results to return (1 to 30, 10 by default).
The same request in curl, 1C, Python, JavaScript and PHP. The program reads the key from the TASNIF_KEY environment variable, and in 1C from the «Ключ» line.
curl "https://tasnif.krafta.uz/api/v1/search?q=капучино&limit=1" \
-H "Authorization: Bearer $TASNIF_KEY"Answer
{
"query": "капучино",
"type": "words",
"ordered_by": "ai",
"results": [
{
"ikpu": "10202001010000002",
"name": {
"ru": "Безалкогольные напитки, кофе и кофесодержащие напитки, приготовленные в заведении общественного питания",
"uz": "Alkogolsiz ichimliklar, qahva va qahva tarkibli ichimliklar, umumiy ovqatlanish shaxobchalarida tayyorlangan"
},
"kind": "catering",
"active": true,
"branded": false,
"match": "text",
"exact": false,
"category": {
"code": "10202001010",
"name": { "ru": "Безалкогольные напитки", "uz": "Alkogolsiz ichimliklar" }
},
"invoice_blocked_since": null
}
],
"usage": { "ai_word_lookups_left_today": 999 }
}A whole list
POST https://tasnif.krafta.uz/api/v1/batch
Up to 1,000 items at once, answered in the same order. limit is how many results per item (1 to 10, 3 by default). Barcodes and codes are answered in seconds; a list of 1,000 word items takes about four minutes, so give your HTTP client a timeout of at least five minutes.
curl "https://tasnif.krafta.uz/api/v1/batch" \
-H "Authorization: Bearer $TASNIF_KEY" \
-H "Content-Type: application/json" \
-d '{"items": ["4780029010025", "капучино", "2701 19"], "limit": 1}'Answer
{
"results": [
{
"query": "4780029010025",
"type": "barcode",
"ordered_by": "search",
"results": [
{
"ikpu": "04818001001038001",
"name": { "ru": "Бумага туалетная: Viva Classik, сорт серый …", "uz": "Hojatxona qog’ozi: Viva Classik …" },
"kind": "goods",
"active": true,
"branded": true,
"match": "barcode",
"exact": true,
"category": { "code": "04818001001", "name": { "ru": "Бумага туалетная", "uz": "Hojatxona qog’ozi" } },
"invoice_blocked_since": null
}
]
},
{ "query": "капучино", "type": "words", "ordered_by": "ai", "results": [ … ] },
{ "query": "2701 19", "type": "customs_code", "ordered_by": "search", "results": [ … ] }
],
"usage": { "ai_word_lookups_left_today": 998 }
}Everything about a code
GET https://tasnif.krafta.uz/api/v1/codes/{ikpu}
Names in Russian and Uzbek, the catalog path, units, barcode, tax benefit and the package codes for the receipt. For a switched-off code, the active codes of its category come in replacements.
curl "https://tasnif.krafta.uz/api/v1/codes/10202001010000002" \
-H "Authorization: Bearer $TASNIF_KEY"What the answer holds
- type
- What the query was: words, barcode, code (an IKPU code), package_code, customs_code (TN VED), code_prefix (the start of a code).
- ordered_by
- ai — the AI chose the order; search — the search's own order.
- ikpu
- The IKPU code, 17 digits.
- name.ru, name.uz
- The name in Russian and in Uzbek (Latin script).
- kind
- goods, service, or catering — a dish or drink made on the premises.
- active
- false — the code is switched off and can't go on a receipt.
- branded
- true — a specific brand's code; false — the category's generic code.
- exact
- true — matched directly: the code itself, its barcode or a package code. false — the best match, worth checking.
- match
- How it was found: text (words); ikpu, barcode, package (the code, a barcode, a package code); tnved (the customs heading); same_maker (the same manufacturer's product — the barcode itself isn't in the catalog); same_category (an active code of the same category).
- category
- The catalog sub-position: code and name.
- invoice_blocked_since
- The date (YYYY-MM-DD) from which this general code can't be used on e-invoices (for marked goods, on receipts too), otherwise null. Such a code comes right after a detailed code of the same category.
- usage.ai_word_lookups_left_today
- How many AI-ordered word lookups are left today.
Limits
- Numbers — barcodes, IKPU, package and customs codes — are unlimited.
- The first 1,000 word lookups a day are ordered by AI. After that answers come in the search's own order — no errors, just no AI. Days are counted in Tashkent time.
- At most 300 requests a minute; a list of up to 1,000 items counts as one request.
- Limits are per account: all its keys share them. Your account shows what’s left.
- Need more? Message us.
Errors
An error comes with an HTTP status and a body like this:
{ "error": { "code": "rate_limited", "message": "Too many requests this minute. …" } }- 400 bad_request
- Something is wrong with the request: no q, a string over 200 characters, or more than 1,000 items in a list.
- 401 unauthorized
- No key, a wrong key, or a revoked one.
- 404 not_found
- No such code in the catalog.
- 429 rate_limited
- Over 300 requests a minute. Wait a minute (see the Retry-After header).
- 502 server_error
- Something failed on our side. Try again in a minute.
The data comes from the official catalog at tasnif.soliq.uz and is updated every day. Check a code against the official catalog before it goes on a receipt.