O‘zbekcha va Turkcha so‘zlar bazasi uchun ochiq o‘qish rejimidagi API
https://turkcha.ru/api/
API ishlayotganini tekshirish uchun.
{
"message": "Turkcha API (read-only) ishlayapti ✅",
"endpoints": {
"GET /sozlar": "Barcha so‘zlarni olish",
"GET /sozlar/{id}": "Bitta so‘zni olish"
}
}
Barcha so‘zlarni olish.
[
{
"id": 10,
"uzbek": "kitob",
"turk": "kitap",
"created_at": "2025-10-20 09:00:00"
},
{
"id": 9,
"uzbek": "uy",
"turk": "ev",
"created_at": "2025-10-19 14:00:00"
}
]
ID orqali bitta so‘zni olish.
{
"id": 5,
"uzbek": "suv",
"turk": "su",
"created_at": "2025-10-17 08:00:00"
}
| Kod | Xabar | Tavsif |
|---|---|---|
| 403 | Faqat GET so‘rovlarga ruxsat berilgan | POST/PUT/DELETE metodlariga murojaat qilinganda |
| 404 | Resurs topilmadi | URL noto‘g‘ri bo‘lsa |
| 500 | Server xatosi | Baza yoki PHP xatosi yuz berganda |
.htaccess orqali yo‘naltirish tavsiya ✅
$data = file_get_contents("https://turkcha.ru/api/sozlar");
$sozlar = json_decode($data, true);
foreach ($sozlar as $s) {
echo $s['uzbek'] . " → " . $s['turk'] . "<br>";
}
fetch("https://turkcha.ru/api/sozlar")
.then(res => res.json())
.then(data => console.log(data));
API ochiq holda taqdim etiladi. Foydalanuvchilar ma’lumotlarni o‘qish huquqiga ega,
lekin o‘zgartirish yoki o‘chirish huquqiga ega emaslar.
Manba ko‘rsatilishi tavsiya etiladi:
https://turkcha.ru/api