SonarBay News Intelligence
Real-time access to 7 days of global news, updated every 15 minutes. ~100K+ articles from thousands of sources worldwide.
CLI
The primary way to access SonarBay.
Install
CODEBLOCK0
Search News
CODEBLOCK1
| Flag | Description |
|---|
| INLINECODE0 | Results per page (default: 10) |
| INLINECODE1 |
Page number (default: 1) |
|
-s <sort> |
relevance (default),
newest,
oldest |
|
--country <code> | Filter by country code (e.g.
US,
IN,
DE) |
|
--source <domain> | Filter by source domain |
|
--json | Raw JSON output for piping |
Trending Entities
CODEBLOCK2
| Flag | Description |
|---|
| INLINECODE12 | INLINECODE13 (default), organizations, countries, INLINECODE16 |
| INLINECODE17 |
Time window:
1h,
6h,
12h,
24h (default),
48h,
7d |
|
-n <num> | Number of results (default: 20) |
Time-Series Counts
CODEBLOCK3
| Flag | Description |
|---|
| INLINECODE25 | Bucket size: 15m, 1h (default), 6h, INLINECODE29 |
| INLINECODE30 |
Lookback window in hours (default: 24) |
Other Commands
CODEBLOCK4
Pipe-Friendly
Every command supports --json for scripting and piping:
CODEBLOCK5
Common Patterns
Monitor a topic over time
- 1. Run
sonarbay counts "topic" -w 72 to see the trend - Identify spikes in the histogram
- Run
sonarbay search "topic" -s newest to find what triggered a spike
Find who's making news
- 1. Run
sonarbay trending -t persons or INLINECODE35 - Search for a specific entity to get articles
Compare coverage across sources
- 1. Search the same topic with different
--source filters - Compare result counts and article titles
REST API (Fallback)
If the CLI is not available, use the REST API directly.
Base URL: https://sonarbay.com
| Endpoint | Description |
|---|
| INLINECODE38 | Search articles |
| INLINECODE39 |
Trending entities |
|
GET /v1/counts?q=<query>&interval=1h&hours=24 | Time-series counts |
|
GET /v1/article/<id> | Single article by ID |
|
GET /v1/status | Health check |
All endpoints return JSON. No authentication required.
Data Details
- - Coverage: 7-day rolling window, ~100K+ articles
- Update frequency: Every 15 minutes
- Sources: Thousands of global news outlets
- Languages: Primarily English, with multilingual coverage
- Fields per article: title, source, url, date (ISO), countries, location names
- Country codes: ISO 2-letter (US, UK, IN, DE, etc.)
SonarBay 新闻情报
实时获取过去7天的全球新闻,每15分钟更新一次。收录来自全球数千个来源的约10万+篇文章。
命令行界面
访问SonarBay的主要方式。
安装
bash
Mac/Linux
curl -fsSL https://sonarbay.com/install.sh | sh
Windows (PowerShell)
irm https://sonarbay.com/install.ps1 | iex
搜索新闻
bash
sonarbay search AI监管
sonarbay search 气候变化 -n 20 -s newest
sonarbay search 特斯拉 --country US --source reuters.com
| 标志 | 说明 |
|---|
| -n <数量> | 每页结果数(默认:10) |
| -p <页码> |
页码(默认:1) |
| -s <排序> | relevance(默认)、newest、oldest |
| --country <代码> | 按国家代码筛选(例如US、IN、DE) |
| --source <域名> | 按来源域名筛选 |
| --json | 输出原始JSON格式,便于管道处理 |
热门实体
bash
sonarbay trending
sonarbay trending -t organizations -w 48h -n 10
| 标志 | 说明 |
|---|
| -t <类型> | persons(默认)、organizations、countries、source |
| -w <时间窗口> |
时间窗口:1h、6h、12h、24h(默认)、48h、7d |
| -n <数量> | 结果数量(默认:20) |
时间序列计数
bash
sonarbay counts 比特币 -i 1h -w 72
| 标志 | 说明 |
|---|
| -i <间隔> | 桶大小:15m、1h(默认)、6h、1d |
| -w <小时> |
回溯窗口小时数(默认:24) |
其他命令
bash
sonarbay status # 健康检查
sonarbay update # 自动更新至最新版本
sonarbay --version # 显示版本号
管道友好
所有命令均支持--json参数,便于脚本编写和管道处理:
bash
sonarbay search OpenAI --json | jq .results[].title
sonarbay trending --json | jq .trending[:5]
sonarbay counts 通胀 --json | jq .buckets[] | select(.count > 100)
常见模式
持续监控某个话题
- 1. 运行sonarbay counts 话题 -w 72查看趋势
- 识别直方图中的峰值
- 运行sonarbay search 话题 -s newest查找触发峰值的原因
发现新闻人物
- 1. 运行sonarbay trending -t persons或-t organizations
- 搜索特定实体获取相关文章
比较不同来源的报道
- 1. 使用不同的--source筛选条件搜索同一话题
- 比较结果数量和文章标题
REST API(备用方案)
如果命令行界面不可用,可直接使用REST API。
基础URL:https://sonarbay.com
| 端点 | 说明 |
|---|
| GET /v1/search?q=<查询>&per_page=10&sort=relevance | 搜索文章 |
| GET /v1/trending?type=persons&hours=24&limit=20 |
热门实体 |
| GET /v1/counts?q=<查询>&interval=1h&hours=24 | 时间序列计数 |
| GET /v1/article/
| 按ID获取单篇文章 |
| GET /v1/status | 健康检查 |
所有端点均返回JSON格式。无需身份验证。
数据详情
- - 覆盖范围:7天滚动窗口,约10万+篇文章
- 更新频率:每15分钟
- 来源:数千家全球新闻媒体
- 语言:主要为英语,支持多语言覆盖
- 每篇文章字段:标题、来源、URL、日期(ISO格式)、国家、地点名称
- 国家代码:ISO两位字母代码(US、UK、IN、DE等)