API Documentation

Sentiment Monitor REST API Reference

Endpoints

GET /api/news

获取新闻列表,支持分页和地区筛选

region string (optional) 地区筛选: all, middle-east, europe, asia, americas, africa
limit number (optional) 每页数量,默认 20
offset number (optional) 偏移量,用于分页
risk string (optional) 风险等级筛选: high, medium, low
GET /api/hot-topics

获取热点话题列表

region string (optional) 地区筛选
limit number (optional) 返回数量,默认 10
GET /api/stats

获取统计数据概览

GET /api/health

健康检查接口

POST /api/fetch

手动触发数据抓取(需要 Authorization Header)

Response Format

{
  "news": [
    {
      "id": 1,
      "title": "News Title",
      "source": "Reuters",
      "source_url": "https://...",
      "region": "middle-east",
      "risk": "high",
      "time": "5分钟前",
      "sentiment": -0.5
    }
  ],
  "count": 20,
  "timestamp": "2026-01-15T10:30:00Z"
}
← 返回首页