YIX NEWS · DEVELOPER PLATFORM
Build with YIX News.
Yangiliklarni integratsiya qiling.
REST API va MCP server orqali O‘zbekiston hamda dunyo yangiliklarini web, mobil ilova, bot va AI agentlaringizga ulang.
RESTHTTP JSON API
MCPAI tool integration
JSONOddiy javob formati
01 · QUICK START
Bir so‘rov bilan boshlang
Ochiq yangiliklar oqimi uchun API key kerak emas.
GET
https://yixnews-api.vercel.app/api/site-news?limit=10&offset=002 · REST API
API manzillari
BASE URL
https://yixnews-api.vercel.app| Method | Endpoint | Auth | Vazifasi |
|---|---|---|---|
| GET | /api/site-news | Yo‘q | Ochiq yangiliklar oqimi |
| GET | /api/news | Bearer key | Himoyalangan yangiliklar |
| GET | /api/me | Bearer key | API hisob ma’lumoti |
| GET | /api/session/me | Session token | Joriy web sessiya |
| GET | /api/health | Yo‘q | Gateway holati |
| POST | /api/auth/start | Yo‘q | Telegram loginni boshlash |
Yangi boshlayotganlar uchun
/api/site-news endpointidan foydalaning. Himoyalangan endpointlar API key talab qiladi.03 · QUERY PARAMETERS
Filtrlash va pagination
| Parametr | Qiymat | Izoh |
|---|---|---|
limit | 1–100 | Yangiliklar soni |
offset | 0 yoki katta | Boshlanish indeksi |
category | uzbekistan, world, technology, economy, science, sport, gaming, cinema | Kategoriya |
country | uzbekistan, usa, uk, russia, turkey, india, international | Mamlakat |
language | uz, ru, en, tr, hi | Til |
Pagination: 1-sahifa offset=0, 2-sahifa offset=10, 3-sahifa offset=20 (agar limit=10 bo‘lsa).
uzbekistanworldtechnologyeconomysciencesportgamingcinema
GET request
/api/site-news?category=technology&country=uzbekistan&language=uz&limit=10&offset=0
04 · AUTHENTICATION
API key bilan ishlash
Ochiq /api/site-news uchun key shart emas. Himoyalangan /api/news va /api/me uchun API key kerak.
- API Dashboardga o‘ting.
- Telegram orqali login qiling.
- Berilgan API key’ni xavfsiz saqlang.
- Key’ni server tomonda Authorization header orqali yuboring.
HTTP header
Authorization: Bearer YIX_YOUR_API_KEY
API key’ni frontend kodiga, ochiq GitHub repository yoki ommaviy joyga joylamang.
05 · CODE EXAMPLES
Kod namunalari
JavaScript
fetch
const url = "https://yixnews-api.vercel.app/api/site-news?limit=10&offset=0";
const response = await fetch(url);
if (!response.ok) throw new Error("HTTP " + response.status);
const data = await response.json();
console.log(data.news);Python
requests
import requests
url = "https://yixnews-api.vercel.app/api/site-news"
response = requests.get(url, params={"limit": 10, "offset": 0}, timeout=20)
response.raise_for_status()
print(response.json()["news"])cURL
Terminal
curl "https://yixnews-api.vercel.app/api/site-news?limit=10&offset=0"
Jonli API tester
Natija shu yerda ko‘rinadi.
06 · MODEL CONTEXT PROTOCOL
AI agentlar uchun MCP
MCP server AI klientlarga YIX News ma’lumotlarini tool sifatida chaqirish imkonini beradi. Transport turi — Streamable HTTP.
MCP URL
https://yixnews-mcp.vercel.app/api/mcp- MCP qo‘llaydigan klientda remote server qo‘shing.
- Transport sifatida Streamable HTTP ni tanlang.
- Yuqoridagi endpoint URL’ni kiriting.
- Tool’larni yangilang va
get_newsni chaqiring.
Bu remote HTTP MCP server. Uni local stdio server sifatida sozlamang. Klientning ulash oynasi farq qilishi mumkin.
07 · MCP TOOLS
Mavjud tool’lar
| Tool | Parametrlar | Vazifasi |
|---|---|---|
get_news | category, country, language, limit, offset | Yangiliklarni olish |
list_categories | Yo‘q | Kategoriyalar ro‘yxati |
list_sources | limit | Manbalar ro‘yxati |
get_api_status | Yo‘q | API holati |
get_news arguments
{
"category": "technology",
"country": "uzbekistan",
"language": "uz",
"limit": 10,
"offset": 0
}limit va offset raqam bo‘lishi kerak; yangilangan server raqam ko‘rinishidagi stringni ham qabul qiladi.
08 · TROUBLESHOOTING
Xatoliklar
| HTTP | Ma’nosi | Yechim |
|---|---|---|
| 400 | Noto‘g‘ri parametr | Filtr va pagination qiymatlarini tekshiring. |
| 401 | Autentifikatsiya yo‘q | Bearer key yoki session token yuboring. |
| 429 | Kunlik limit tugagan | Limit yangilanishini kuting. |
| 500 | Backend xatosi | Keyinroq qayta urinib ko‘ring. |
| 502 | Backend javob bermadi | Health endpointni tekshiring. |
GitHub: Backend · Frontend / docs