mxik
Typed JS/TS client for tasnif.soliq.uz: search MXIK (IKPU) codes by keyword, barcode, brand or certificate.
- Zero dependencies, ~2 kB gzipped
- ESM + CommonJS, works in Node 20+, Bun, Deno, browsers and edge runtimes
- Unwrapped results, pagination, language, timeouts and
AbortSignal support
📖 Documentation
Install
npm i mxik
Usage
import { createMxik } from 'mxik'
const mxik = createMxik({ lang: 'ru' })
const { items, total, hasNext } = await mxik.search('кофе', { page: 1, size: 50 })
const details = await mxik.get('00406001001232001')
await mxik.filter({ brand: 'Samsung' })
await mxik.filter({ barcode: '4600000000000' })
await mxik.dvCert('UZ.123456')
for await (const item of mxik.searchAll('кофе'))
console.log(item.mxikCode, item.name)
Errors
API errors throw MxikError with status and reason. Network errors, timeouts and aborts are passed through as is.
import { MxikError } from 'mxik'
try {
await mxik.search('кофе', { signal: AbortSignal.timeout(3000) })
}
catch (error) {
if (error instanceof MxikError)
console.log(error.status, error.reason)
}
Migrating from 1.1
MxikClient, createMxikClient and fetchBy* still work but are deprecated. See the migration guide.
License
MIT