Documentation Index
Fetch the complete documentation index at: https://docs.byul.ai/llms.txt
Use this file to discover all available pages before exploring further.
Article Structure
News articles are delivered with the following data structure based on the official API:
{
"_id": "67850d7b0123456789abcdef",
"title": "Tesla Stock Surges After Q4 Earnings Beat",
"koTitle": "테슬라 4분기 실적 발표 후 주가 급등",
"content": "Tesla Inc. reported stronger-than-expected Q4 2024 earnings, with revenue beating analyst estimates by 8%. The electric vehicle maker delivered 484,507 vehicles in Q4, up 15% year-over-year, driving shares up 12% in after-hours trading.",
"koContent": "테슬라가 2024년 4분기 실적에서 애널리스트 예상치를 8% 상회하는 매출을 기록했습니다. 이 전기차 제조업체는 4분기에 484,507대를 인도하며 전년 대비 15% 증가했고, 시간외 거래에서 주가가 12% 상승했습니다.",
"url": "https://www.byul.ai/news/tesla-earnings-q4-2024",
"date": "2024-01-15T10:30:00.000Z",
"source": "byul.ai",
"timestamp": 1705401000,
"importanceScore": 8,
"category": "earnings",
"symbols": ["TSLA"],
"sentiment": "positive"
}
Field Descriptions
Core Fields:
_id - Unique article identifier
title - Article headline (primary, usually English)
koTitle - Korean title (optional)
content - Article content or summary (optional; may be absent)
koContent - Korean content or summary (optional; may be absent)
url - Link to original article
date - Article date (ISO 8601 format)
Metadata:
source - News source name (always “byul.ai”)
timestamp - Unix timestamp
symbols - Related stock symbols array (optional)
Classification:
importanceScore - Market importance (0-10 integer, higher = more important)
category - News category
sentiment - Sentiment analysis result (“positive”, “negative”, “neutral”) (optional)
Receiving Data
Listen for incoming news articles:
socket.on('news:data', (response) => {
const { data } = response;
const { news } = data;
news.forEach(article => {
console.log(`${article.title}`);
console.log(`Importance: ${article.importanceScore}/10`);
console.log(`Symbols: ${article.symbols?.join(', ') || 'General'}`);
console.log(`Sentiment: ${article.sentiment || 'N/A'}`);
console.log(`Source: ${article.source}`);
});
});
The complete WebSocket response structure:
{
"type": "news",
"data": {
"news": [
{
"_id": "67850d7b0123456789abcde1",
"title": "Breaking: Fed Issues Emergency Statement",
"koTitle": "속보: 연준 긴급성명 발표",
"url": "https://www.byul.ai/news/fed-emergency-statement",
"date": "2024-01-15T14:30:00.000Z",
"source": "byul.ai",
"timestamp": 1705415400,
"importanceScore": 10,
"category": "fed",
"symbols": [],
"sentiment": "neutral"
}
],
"hasMore": false,
"nextCursor": null,
"total": 1
},
"timestamp": "2024-01-15T14:30:15Z",
"isRealTimeUpdate": true
}
Data Validation
Always validate incoming data structure:
function validateArticle(article) {
return (
article._id &&
article.title &&
typeof article.importanceScore === 'number' &&
Number.isInteger(article.importanceScore) &&
article.importanceScore >= 0 && article.importanceScore <= 10 &&
article.date &&
(!article.sentiment || ['positive', 'negative', 'neutral'].includes(article.sentiment))
);
}
socket.on('news:data', (response) => {
const { data } = response;
const { news } = data;
const validArticles = news.filter(validateArticle);
console.log(`Processing ${validArticles.length} valid articles`);
validArticles.forEach(article => {
processArticle(article);
});
});
Language Support
Articles include multi-language titles:
title - Primary title (usually English)
koTitle - Korean version (optional)
Use the appropriate title field based on your application’s language requirements.