Mahsulotlar API
Kitob, kanselyariya, mualliflar, nashriyotlar, tavsiyalar va seller mahsulotlarini olish.
Katalogdagi kitoblar, kanselyariyalar, seller ma'lumotlari va tavsiyalar. Barcha GET endpointlar read ability talab qiladi.
Kitobning to‘liq tavsifi, muallifi, nashriyoti, narxi, qoldig‘i va rasmlarini qaytaradi.
| Parametr | Turi | Tavsifi |
|---|---|---|
| id majburiy | integer | Kitob ID raqami. |
curl --request GET \ --url 'https://www.kitobchi.com/api/v1/client/products/book/128' \ --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/products/book/128", {
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/products/book/128");
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/products/book/128",
headers={
"Accept": "application/json",
"X-App-ID": "app_xxxxxxxxxxxx",
"X-App-Secret": os.environ["KITOBCHI_APP_SECRET"],
},
)
data = res.json()
{
"status": "success",
"data": {
"id": 128,
"name": "Atomic Habits",
"price": 89000,
"old_price": 99000,
"image": "https://kitobchi.com/storage/books/128.jpg",
"type": "book",
"in_stock": true,
"description": "Kichik o‘zgarishlar, ulkan natijalar...",
"pages": 320,
"isbn": "9781847941831",
"author": {
"id": 45,
"name": "James Clear"
},
"seller": {
"id": 12,
"name": "Asaxiy Books"
}
}
}
Sinab ko'rish
Kanselyariya tovarining to‘liq ma’lumoti va variantlarini qaytaradi.
| Parametr | Turi | Tavsifi |
|---|---|---|
| id majburiy | integer | Mahsulot ID si. |
curl --request GET \ --url 'https://www.kitobchi.com/api/v1/client/products/stationery/54' \ --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/products/stationery/54", {
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/products/stationery/54");
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/products/stationery/54",
headers={
"Accept": "application/json",
"X-App-ID": "app_xxxxxxxxxxxx",
"X-App-Secret": os.environ["KITOBCHI_APP_SECRET"],
},
)
data = res.json()
{
"status": "success",
"data": {
"id": 54,
"name": "ErichKrause Qalam to‘plami",
"price": 25000,
"type": "stationery",
"in_stock": true,
"seller": {
"id": 12,
"name": "Kanselyariya Dunyosi"
}
}
}
Sinab ko'rish
Muayyan muallifning barcha faol kitoblari ro‘yxatini sahifalab qaytaradi.
| Parametr | Turi | Tavsifi |
|---|---|---|
| authorId majburiy | integer | Muallif ID raqami. |
| Parametr | Turi | Talab | Tavsifi |
|---|---|---|---|
| page | integer | ixtiyoriy | Sahifa raqami. |
| per_page | integer | ixtiyoriy | Sahifadagi elementlar soni. |
curl --request GET \ --url 'https://www.kitobchi.com/api/v1/client/products/by-author/45?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/products/by-author/45?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/products/by-author/45?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/products/by-author/45?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()
{
"status": "success",
"data": [
{
"id": 128,
"name": "Atomic Habits",
"price": 89000,
"type": "book"
}
],
"meta": {
"current_page": 1,
"per_page": 20,
"total": 4,
"last_page": 1
}
}
Sinab ko'rish
Muayyan nashriyotning barcha faol kitoblari ro‘yxatini sahifalab qaytaradi.
| Parametr | Turi | Tavsifi |
|---|---|---|
| publisherId majburiy | integer | Nashriyot ID raqami. |
| Parametr | Turi | Talab | Tavsifi |
|---|---|---|---|
| page | integer | ixtiyoriy | Sahifa raqami. |
| per_page | integer | ixtiyoriy | Sahifadagi elementlar soni. |
curl --request GET \ --url 'https://www.kitobchi.com/api/v1/client/products/by-publisher/8?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/products/by-publisher/8?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/products/by-publisher/8?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/products/by-publisher/8?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()
{
"status": "success",
"data": [
{
"id": 128,
"name": "Atomic Habits",
"price": 89000,
"type": "book"
}
],
"meta": {
"current_page": 1,
"per_page": 20,
"total": 12,
"last_page": 1
}
}
Sinab ko'rish
Katalogdagi mahsulotlarni turi bo‘yicha sahifalab qaytaradi.
| Parametr | Turi | Tavsifi |
|---|---|---|
| col majburiy | string | Mahsulot turi: books yoki stationery. |
| Parametr | Turi | Talab | Tavsifi |
|---|---|---|---|
| page | integer | ixtiyoriy | Sahifa raqami (1 dan boshlanadi). |
| per_page | integer | ixtiyoriy | Sahifadagi elementlar soni (maksimal 100). |
| q | string | ixtiyoriy | Nom bo‘yicha filtr. |
| sort | string | ixtiyoriy | Tartiblash: popular, new, price_asc, price_desc. |
curl --request GET \ --url 'https://www.kitobchi.com/api/v1/client/products/books?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/products/books?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/products/books?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/products/books?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()
{
"status": "success",
"data": [
{
"id": 128,
"name": "Atomic Habits",
"price": 89000,
"old_price": 99000,
"image": "https://kitobchi.com/storage/books/128.jpg",
"type": "book",
"in_stock": true,
"seller_id": 12
}
],
"meta": {
"page": 1,
"per_page": 20,
"total": 342
}
}
Sinab ko'rish
Vitrina va “sizga mos” bloklari uchun tavsiya ro‘yxati.
| Parametr | Turi | Tavsifi |
|---|---|---|
| col majburiy | string | Mahsulot turi: books yoki stationery. |
curl --request GET \ --url 'https://www.kitobchi.com/api/v1/client/products/recommendation/books' \ --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/products/recommendation/books", {
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/products/recommendation/books");
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/products/recommendation/books",
headers={
"Accept": "application/json",
"X-App-ID": "app_xxxxxxxxxxxx",
"X-App-Secret": os.environ["KITOBCHI_APP_SECRET"],
},
)
data = res.json()
{
"status": "success",
"data": [
{
"id": 305,
"name": "Deep Work",
"price": 76000,
"image": "https://kitobchi.com/storage/books/305.jpg",
"type": "book",
"in_stock": true
}
]
}
Sinab ko'rish
Do‘konlar ro‘yxati va har biri uchun eng so‘nggi mahsulotlar.
| Parametr | Turi | Talab | Tavsifi |
|---|---|---|---|
| page | integer | ixtiyoriy | Sahifa raqami. |
curl --request GET \ --url 'https://www.kitobchi.com/api/v1/client/products/sellers/list?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/products/sellers/list?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/products/sellers/list?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/products/sellers/list?page=1",
headers={
"Accept": "application/json",
"X-App-ID": "app_xxxxxxxxxxxx",
"X-App-Secret": os.environ["KITOBCHI_APP_SECRET"],
},
)
data = res.json()
{
"status": "success",
"data": [
{
"id": 12,
"name": "Asaxiy Books",
"logo": "https://kitobchi.com/storage/sellers/12.png",
"rating": 4.8,
"latest_products": []
}
]
}
Sinab ko'rish
QR token orqali do‘kon ma’lumotini olish.
| Parametr | Turi | Tavsifi |
|---|---|---|
| token majburiy | string | Seller QR tokeni. |
curl --request GET \ --url 'https://www.kitobchi.com/api/v1/client/products/sellers/by-qr/qr_9f3c1a' \ --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/products/sellers/by-qr/qr_9f3c1a", {
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/products/sellers/by-qr/qr_9f3c1a");
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/products/sellers/by-qr/qr_9f3c1a",
headers={
"Accept": "application/json",
"X-App-ID": "app_xxxxxxxxxxxx",
"X-App-Secret": os.environ["KITOBCHI_APP_SECRET"],
},
)
data = res.json()
{
"status": "success",
"data": {
"id": 12,
"name": "Asaxiy Books",
"rating": 4.8
}
}
Sinab ko'rish
Do‘kon profili va uning sahifalangan mahsulotlari.
| Parametr | Turi | Tavsifi |
|---|---|---|
| id majburiy | integer | Seller ID. |
| page majburiy | integer | Mahsulotlar sahifasi. |
curl --request GET \ --url 'https://www.kitobchi.com/api/v1/client/products/sellers/profile/12/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/products/sellers/profile/12/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/products/sellers/profile/12/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/products/sellers/profile/12/1",
headers={
"Accept": "application/json",
"X-App-ID": "app_xxxxxxxxxxxx",
"X-App-Secret": os.environ["KITOBCHI_APP_SECRET"],
},
)
data = res.json()
{
"status": "success",
"data": {
"id": 12,
"name": "Asaxiy Books",
"products": [],
"meta": {
"page": 1,
"total": 240
}
}
}
Sinab ko'rish
Do‘kon ichidan shtrix-kod yoki ISBN orqali bitta mahsulotni topadi. `/isbn/{isbn}` alias ham mavjud.
| Parametr | Turi | Tavsifi |
|---|---|---|
| sellerId majburiy | integer | Seller ID. |
| code majburiy | string | Shtrix-kod yoki ISBN. |
curl --request GET \ --url 'https://www.kitobchi.com/api/v1/client/products/sellers/12/code/9781847941831' \ --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/products/sellers/12/code/9781847941831", {
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/products/sellers/12/code/9781847941831");
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/products/sellers/12/code/9781847941831",
headers={
"Accept": "application/json",
"X-App-ID": "app_xxxxxxxxxxxx",
"X-App-Secret": os.environ["KITOBCHI_APP_SECRET"],
},
)
data = res.json()
{
"status": "success",
"data": {
"id": 128,
"name": "Atomic Habits",
"price": 89000,
"in_stock": true,
"seller_id": 12
}
}