Kitobchi API v1
OpenAPI Postman Kitobchi.com

Qidiruv API

Global qidiruv, autocomplete takliflari, trend so‘rovlar va kategoriyalar bo‘yicha filtr.

Global qidiruv, autocomplete va kategorial filtr. Autocomplete'ni UI'da debounce (300 ms) bilan chaqiring.

GET https://www.kitobchi.com/api/v1/client/search
Kesh
Global qidiruv

Nom, muallif, kategoriya va turga qarab natija qaytaradi.

Query parametrlari
ParametrTuriTalabTavsifi
q string majburiy Qidiruv matni.
page integer ixtiyoriy Sahifa raqami.
per_page integer ixtiyoriy Sahifadagi elementlar soni.
curl --request GET \
  --url 'https://www.kitobchi.com/api/v1/client/search?q=python&page=1&per_page=20' \
  --header 'Accept: application/json' \
  --header 'X-App-ID: app_xxxxxxxxxxxx' \
  --header 'X-App-Secret: your-secret'
const res = await fetch("https://www.kitobchi.com/api/v1/client/search?q=python&page=1&per_page=20", {
  headers: {
    "Accept": "application/json",
    "X-App-ID": "app_xxxxxxxxxxxx",
    "X-App-Secret": process.env.KITOBCHI_APP_SECRET,
  },
});
const data = await res.json();
<?php
$ch = curl_init("https://www.kitobchi.com/api/v1/client/search?q=python&page=1&per_page=20");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Accept: application/json',
    'X-App-ID: app_xxxxxxxxxxxx',
    'X-App-Secret: ' . getenv('KITOBCHI_APP_SECRET'),
  ],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import os, requests

res = requests.get(
    "https://www.kitobchi.com/api/v1/client/search?q=python&page=1&per_page=20",
    headers={
        "Accept": "application/json",
        "X-App-ID": "app_xxxxxxxxxxxx",
        "X-App-Secret": os.environ["KITOBCHI_APP_SECRET"],
    },
)
data = res.json()
Javob 200 OK
{
    "status": "success",
    "data": [
        {
            "id": 128,
            "name": "Python bilan dasturlash",
            "type": "book",
            "price": 120000,
            "image": "https://kitobchi.com/storage/books/128.jpg"
        }
    ],
    "meta": {
        "page": 1,
        "total": 37
    }
}
Sinab ko'rish
X-App-ID
X-App-Secret
q *
page
per_page
GET https://www.kitobchi.com/api/v1/client/search/suggestions
Kesh
Autocomplete takliflari

Qidiruv maydoni uchun tezkor takliflar (nom, muallif, teg).

Query parametrlari
ParametrTuriTalabTavsifi
q string majburiy Qidiruv boshlanmasi.
seller_id integer ixtiyoriy Bitta do‘kon ichida cheklash.
curl --request GET \
  --url 'https://www.kitobchi.com/api/v1/client/search/suggestions?q=pyth' \
  --header 'Accept: application/json' \
  --header 'X-App-ID: app_xxxxxxxxxxxx' \
  --header 'X-App-Secret: your-secret'
const res = await fetch("https://www.kitobchi.com/api/v1/client/search/suggestions?q=pyth", {
  headers: {
    "Accept": "application/json",
    "X-App-ID": "app_xxxxxxxxxxxx",
    "X-App-Secret": process.env.KITOBCHI_APP_SECRET,
  },
});
const data = await res.json();
<?php
$ch = curl_init("https://www.kitobchi.com/api/v1/client/search/suggestions?q=pyth");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Accept: application/json',
    'X-App-ID: app_xxxxxxxxxxxx',
    'X-App-Secret: ' . getenv('KITOBCHI_APP_SECRET'),
  ],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import os, requests

res = requests.get(
    "https://www.kitobchi.com/api/v1/client/search/suggestions?q=pyth",
    headers={
        "Accept": "application/json",
        "X-App-ID": "app_xxxxxxxxxxxx",
        "X-App-Secret": os.environ["KITOBCHI_APP_SECRET"],
    },
)
data = res.json()
Javob 200 OK
{
    "status": "success",
    "data": [
        "Python",
        "Python bilan dasturlash",
        "Pythonic"
    ]
}
Sinab ko'rish
X-App-ID
X-App-Secret
q *
seller_id
GET https://www.kitobchi.com/api/v1/client/search/categories
Kesh
Kategoriyalar

Katalog menyusi va filtr paneli uchun kategoriyalar ro‘yxati.

curl --request GET \
  --url 'https://www.kitobchi.com/api/v1/client/search/categories' \
  --header 'Accept: application/json' \
  --header 'X-App-ID: app_xxxxxxxxxxxx' \
  --header 'X-App-Secret: your-secret'
const res = await fetch("https://www.kitobchi.com/api/v1/client/search/categories", {
  headers: {
    "Accept": "application/json",
    "X-App-ID": "app_xxxxxxxxxxxx",
    "X-App-Secret": process.env.KITOBCHI_APP_SECRET,
  },
});
const data = await res.json();
<?php
$ch = curl_init("https://www.kitobchi.com/api/v1/client/search/categories");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Accept: application/json',
    'X-App-ID: app_xxxxxxxxxxxx',
    'X-App-Secret: ' . getenv('KITOBCHI_APP_SECRET'),
  ],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import os, requests

res = requests.get(
    "https://www.kitobchi.com/api/v1/client/search/categories",
    headers={
        "Accept": "application/json",
        "X-App-ID": "app_xxxxxxxxxxxx",
        "X-App-Secret": os.environ["KITOBCHI_APP_SECRET"],
    },
)
data = res.json()
Javob 200 OK
{
    "status": "success",
    "data": [
        {
            "id": 3,
            "name": "Biznes",
            "type": "book",
            "children": []
        }
    ]
}
Sinab ko'rish
X-App-ID
X-App-Secret
GET https://www.kitobchi.com/api/v1/client/search/category/{cat_id}/{type}
Kesh
Kategoriya mahsulotlari

Bitta kategoriya ichidagi mahsulotlarni turi bo‘yicha qaytaradi.

Path parametrlari
ParametrTuriTavsifi
cat_id majburiy integer Kategoriya ID.
type majburiy string Mahsulot turi: book yoki stationery.
Query parametrlari
ParametrTuriTalabTavsifi
page integer ixtiyoriy Sahifa raqami.
curl --request GET \
  --url 'https://www.kitobchi.com/api/v1/client/search/category/3/book?page=1' \
  --header 'Accept: application/json' \
  --header 'X-App-ID: app_xxxxxxxxxxxx' \
  --header 'X-App-Secret: your-secret'
const res = await fetch("https://www.kitobchi.com/api/v1/client/search/category/3/book?page=1", {
  headers: {
    "Accept": "application/json",
    "X-App-ID": "app_xxxxxxxxxxxx",
    "X-App-Secret": process.env.KITOBCHI_APP_SECRET,
  },
});
const data = await res.json();
<?php
$ch = curl_init("https://www.kitobchi.com/api/v1/client/search/category/3/book?page=1");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Accept: application/json',
    'X-App-ID: app_xxxxxxxxxxxx',
    'X-App-Secret: ' . getenv('KITOBCHI_APP_SECRET'),
  ],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import os, requests

res = requests.get(
    "https://www.kitobchi.com/api/v1/client/search/category/3/book?page=1",
    headers={
        "Accept": "application/json",
        "X-App-ID": "app_xxxxxxxxxxxx",
        "X-App-Secret": os.environ["KITOBCHI_APP_SECRET"],
    },
)
data = res.json()
Javob 200 OK
{
    "status": "success",
    "data": [],
    "meta": {
        "page": 1,
        "total": 96
    }
}
Sinab ko'rish
X-App-ID
X-App-Secret
cat_id
type
page