Get Started in 5 Minutes

Prerequisites

REST API is available on all plans. See pricing for rate limits and features.

Step 1: Get Your API Key

  1. Login to Byul API Dashboard
  2. Your API key is automatically generated and displayed
  3. Copy your API key (starts with byul_v2)

Step 2: Make Your First Request

curl -X GET "https://api.byul.ai/api/v2/news?limit=10&minImportance=7" \
  -H "X-API-Key: byul_api_key"

Step 3: Parse the Response

{
  "items": [
    {
      "_id": "67850d7b0123456789abcdef",
      "title": "Tesla Stock Surges After Q4 Earnings Beat",
      "koTitle": "테슬라 4분기 실적 상승으로 주가 급등",
      "url": "https://www.byul.ai/news/tesla-earnings-q4-2024",
      "date": "2024-01-15T10:30:00.000Z",
      "importanceScore": 8,
      "category": "earnings",
      "symbols": ["TSLA"],
      "sentiment": "positive"
    }
  ],
  "nextCursor": "67850d7b0123456789abcde0",
  "hasMore": true
}

Step 4: Handle Pagination

const getAllNews = async () => {
  let allNews = [];
  let cursor = null;
  let hasMore = true;
  
  while (hasMore) {
    const params = new URLSearchParams({
      limit: '50',
      minImportance: '6'
    });
    
    if (cursor) {
      params.append('cursor', cursor);
    }
    
    const response = await fetch(`https://api.byul.ai/api/v2/news?${params}`, {
      headers: { 'X-API-Key': process.env.BYUL_API_KEY }
    });
    
    const data = await response.json();
    allNews.push(...data.items);
    
    cursor = data.nextCursor;
    hasMore = data.hasMore;
  }
  
  console.log(`Retrieved ${allNews.length} total articles`);
  return allNews;
};

Congratulations!

You’ve successfully made your first REST API request and retrieved financial news!

What’s Next?

Troubleshooting

Common Issues

401 Unauthorized
  • Check your API key format (must start with byul_)
  • Verify your API key at Dashboard
  • Ensure the X-API-Key header is set correctly
429 Too Many Requests
  • You’ve exceeded your plan’s rate limit
  • Check rate limit headers in the response
  • Implement exponential backoff retry logic
  • Consider upgrading your plan at Pricing
400 Bad Request
  • Check parameter values (limit: 1-100, minImportance: 1-10)
  • Ensure proper URL encoding for query parameters
  • Validate JSON structure if sending request body

Need Help?

Pro Tip: Use environment variables in production instead of hardcoding API keys:
export BYUL_API_KEY=byul_api_key

Rate Limits by Plan

  • Test (Free): 30 requests/minute
  • Starter ($19/month): 60 requests/minute
  • Pro ($99/month): 120 requests/minute
  • Enterprise: Custom limits
All responses include rate limit headers for monitoring usage.