News Search
Paid News Search proxy via x402 pay-per-use (HTTP 402).
Prerequisites: This skill requires x402-payment. Complete the setup steps before first use.
Security: Documentation only — no executable code or credentials. Wallet/keys stay on your machine; never stored here.
Service URLs
| Role | Domain |
|---|
| API Provider | https://www.cpbox.io |
| Facilitator |
https://www.cppay.finance |
Endpoint (Agent Interface)
CODEBLOCK0
Payment Flow (x402 Protocol)
- 1. First request (no
PAYMENT-SIGNATURE) -> 402 Payment Required with requirements JSON - Client signs (EIP-712) -> INLINECODE2
- Retry with
PAYMENT-SIGNATURE -> Server settles and returns JSON
With @springmint/x402-payment or x402-sdk-go, payment is automatic.
Quick Start (cURL)
Basic Search
CODEBLOCK1
Recent News (Past 24 Hours)
CODEBLOCK2
Date Range Filter
CODEBLOCK3
Using with x402-payment
CODEBLOCK4
Parameters
| Parameter | Type | Required | Default | Description |
|---|
| INLINECODE6 | string | Yes | - | Search query (1-400 chars, max 50 words) |
| INLINECODE7 |
string | No |
US | Search country (2-letter country code or
ALL) |
|
search_lang | string | No |
en | Language preference (2+ char language code) |
|
ui_lang | string | No |
en-US | UI language (e.g., "en-US") |
|
count | int | No |
20 | Number of results (1-50) |
|
offset | int | No |
0 | Page offset (0-9) |
|
safesearch | string | No |
strict | Adult content filter (
off/
moderate/
strict) |
|
freshness | string | No | - | Time filter (
pd/
pw/
pm/
py or date range) |
|
spellcheck | bool | No |
true | Auto-correct query |
|
extra_snippets | bool | No | - | Up to 5 additional excerpts per result |
|
goggles | string or array | No | - | Custom ranking filter (URL or inline; repeat param for multiple) |
|
operators | bool | No |
true | Apply search operators |
|
include_fetch_metadata | bool | No |
false | Include fetch timestamps in results |
Freshness Values
| Value | Description |
|---|
| INLINECODE36 | Past day (24 hours) - ideal for breaking news |
| INLINECODE37 |
Past week (7 days) |
|
pm | Past month (31 days) |
|
py | Past year (365 days) |
|
YYYY-MM-DDtoYYYY-MM-DD | Custom date range |
Response Format
CODEBLOCK5
Response Fields
| Field | Type | Description |
|---|
| INLINECODE41 | string | Always INLINECODE42 |
| INLINECODE43 |
string | The original search query |
|
query.altered | string? | Spellcheck-corrected query (if changed) |
|
query.cleaned | string? | Cleaned/normalized query from spellchecker |
|
query.spellcheck_off | bool? | Whether spellcheck was disabled |
|
query.show_strict_warning | bool? | True if strict safesearch blocked results |
|
query.search_operators | object? | Applied search operators |
|
query.search_operators.applied | bool | Whether operators were applied |
|
query.search_operators.cleaned_query | string? | Query after operator processing |
|
query.search_operators.sites | list[str]? | Domains from
site: operators |
|
results[].type | string | Always
"news_result" |
|
results[].title | string | Article title |
|
results[].url | string | Source URL of the article |
|
results[].description | string? | Article description/summary |
|
results[].age | string? | Human-readable age (e.g. "2 hours ago") |
|
results[].page_age | string? | Publication date from source (ISO datetime) |
|
results[].page_fetched | string? | When page was last fetched (ISO datetime) |
|
results[].fetched_content_timestamp | int? | Fetch timestamp (only with
include_fetch_metadata=true) |
|
results[].meta_url.scheme | string? | URL protocol scheme |
|
results[].meta_url.netloc | string? | Network location |
|
results[].meta_url.hostname | string? | Lowercased domain name |
|
results[].meta_url.favicon | string? | Favicon URL |
|
results[].meta_url.path | string? | URL path |
|
results[].thumbnail.src | string | Served thumbnail URL |
|
results[].thumbnail.original | string? | Original thumbnail URL |
|
results[].extra_snippets | list[str]? | Up to 5 additional excerpts per result |
Goggles (Custom Ranking)
Goggles let you re-rank news results — boost trusted outlets or suppress unwanted sources.
| Method | Example |
|---|
| Hosted | INLINECODE71 |
| Inline |
--data-urlencode 'goggles=$discard\n$site=example.com' |
Hosted goggles should be hosted on a public URL and include ! name:, ! description:, ! author: headers. Inline rules need no registration.
Syntax: $boost=N / $downrank=N (1–10), $discard, $site=example.com. Combine with commas: $site=example.com,boost=3. Separate rules with \n (%0A).
Allow list: $discard\n$site=docs.python.org\n$site=developer.mozilla.org — Block list: INLINECODE84
Resources: See your upstream provider's Goggles documentation.
Search Operators
Use search operators to refine results:
- -
site:local-paper.com - Limit to specific news site - INLINECODE86 - Match exact phrase
- INLINECODE87 - Exclude term
Set operators=false to disable operator parsing.
Use Cases
- - Breaking news monitoring: Use
freshness=pd for the most recent articles on a topic. - Custom news feeds with Goggles: Boost trusted sources and discard other sources.
- Historical news research: Use
freshness=YYYY-MM-DDtoYYYY-MM-DD to find articles from specific time periods. - Multilingual news: Combine
country, search_lang, and ui_lang for cross-locale results. - Data pipelines: Set
include_fetch_metadata=true for fetched_content_timestamp on each result.
Notes
- - SafeSearch: Defaults to INLINECODE96
- Pagination: Use
offset (0-9) with INLINECODE98 - Extra snippets: Up to 5 additional excerpts when INLINECODE99
新闻搜索
通过 x402 按次付费(HTTP 402)的付费新闻搜索代理。
前置条件:此技能需要 x402 支付。首次使用前请完成设置步骤。
安全性:仅提供文档——不含可执行代码或凭证。钱包/密钥保留在您的机器上;绝不存储在此处。
服务 URL
| 角色 | 域名 |
|---|
| API 提供商 | https://www.cpbox.io |
| 协调方 |
https://www.cppay.finance |
端点(代理接口)
http
GET /api/x402/news-search
POST /api/x402/news-search/post
支付流程(x402 协议)
- 1. 首次请求(无 PAYMENT-SIGNATURE)-> 返回 402 Payment Required 及需求 JSON
- 客户端签名(EIP-712)-> PAYMENT-SIGNATURE
- 重试并携带 PAYMENT-SIGNATURE -> 服务器结算并返回 JSON
使用 @springmint/x402-payment 或 x402-sdk-go 时,支付自动完成。
快速开始(cURL)
基础搜索
bash
curl -s https://www.cpbox.io/api/x402/news-search?q=space+exploration \
-H Accept: application/json
近期新闻(过去 24 小时)
bash
curl -s https://www.cpbox.io/api/x402/news-search \
-H Accept: application/json \
-G \
--data-urlencode q=cybersecurity \
--data-urlencode country=US \
--data-urlencode freshness=pd \
--data-urlencode count=20
日期范围筛选
bash
curl -s https://www.cpbox.io/api/x402/news-search \
-H Accept: application/json \
-G \
--data-urlencode q=climate summit \
--data-urlencode freshness=2026-01-01to2026-01-31
配合 x402-payment 使用
bash
npx @springmint/x402-payment \
--url https://www.cpbox.io/api/x402/news-search \
--method GET
参数
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|
| q | string | 是 | - | 搜索查询(1-400 字符,最多 50 词) |
| country |
string | 否 | US | 搜索国家(2 字母国家代码或 ALL) |
| search_lang | string | 否 | en | 语言偏好(2+ 字符语言代码) |
| ui_lang | string | 否 | en-US | 界面语言(例如 en-US) |
| count | int | 否 | 20 | 结果数量(1-50) |
| offset | int | 否 | 0 | 分页偏移量(0-9) |
| safesearch | string | 否 | strict | 成人内容过滤(off/moderate/strict) |
| freshness | string | 否 | - | 时间筛选(pd/pw/pm/py 或日期范围) |
| spellcheck | bool | 否 | true | 自动纠正查询 |
| extra_snippets | bool | 否 | - | 每个结果最多 5 个额外摘要 |
| goggles | string 或 array | 否 | - | 自定义排名筛选(URL 或内联;多个时重复参数) |
| operators | bool | 否 | true | 应用搜索运算符 |
| include
fetchmetadata | bool | 否 | false | 在结果中包含获取时间戳 |
Freshness 值
| 值 | 描述 |
|---|
| pd | 过去一天(24 小时)- 适合突发新闻 |
| pw |
过去一周(7 天) |
| pm | 过去一月(31 天) |
| py | 过去一年(365 天) |
| YYYY-MM-DDtoYYYY-MM-DD | 自定义日期范围 |
响应格式
json
{
type: news,
query: {
original: space exploration
},
results: [
{
type: news_result,
title: 太空探索新进展,
url: https://news.example.com/space-exploration,
description: 近期任务加深了我们对……的理解,
age: 2 小时前,
page_age: 2026-01-15T14:30:00,
page_fetched: 2026-01-15T15:00:00Z,
meta_url: {
scheme: https,
netloc: news.example.com,
hostname: news.example.com,
favicon: https://imgs.search.provider/favicon/news.example.com,
path: /space-exploration
},
thumbnail: {
src: https://imgs.search.provider/...
}
}
]
}
响应字段
| 字段 | 类型 | 描述 |
|---|
| type | string | 始终为 news |
| query.original |
string | 原始搜索查询 |
| query.altered | string? | 拼写纠正后的查询(如有变更) |
| query.cleaned | string? | 拼写检查器清理/规范化后的查询 |
| query.spellcheck_off | bool? | 拼写检查是否已禁用 |
| query.show
strictwarning | bool? | 严格安全搜索是否屏蔽了结果 |
| query.search_operators | object? | 已应用的搜索运算符 |
| query.search_operators.applied | bool | 运算符是否已应用 |
| query.search
operators.cleanedquery | string? | 运算符处理后的查询 |
| query.search_operators.sites | list[str]? | 来自 site: 运算符的域名 |
| results[].type | string | 始终为 news_result |
| results[].title | string | 文章标题 |
| results[].url | string | 文章来源 URL |
| results[].description | string? | 文章描述/摘要 |
| results[].age | string? | 人类可读的时效(例如 2 小时前) |
| results[].page_age | string? | 来源的发布日期(ISO 日期时间) |
| results[].page_fetched | string? | 页面最后获取时间(ISO 日期时间) |
| results[].fetched
contenttimestamp | int? | 获取时间戳(仅当 include
fetchmetadata=true 时) |
| results[].meta_url.scheme | string? | URL 协议方案 |
| results[].meta_url.netloc | string? | 网络位置 |
| results[].meta_url.hostname | string? | 小写域名 |
| results[].meta_url.favicon | string? | 网站图标 URL |
| results[].meta_url.path | string? | URL 路径 |
| results[].thumbnail.src | string | 提供的缩略图 URL |
| results[].thumbnail.original | string? | 原始缩略图 URL |
| results[].extra_snippets | list[str]? | 每个结果最多 5 个额外摘要 |
Goggles(自定义排名)
Goggles 让您重新排列新闻结果——提升可信来源或屏蔽不想要的来源。
| 方法 | 示例 |
|---|
| 托管 | --data-urlencode goggles=https://<hosted-goggle-url> |
| 内联 |
--data-urlencode goggles=$discard\n$site=example.com |
托管 goggles 应托管在公共 URL 上,并包含 ! name:、! description:、! author: 头部。内联规则无需注册。
语法:$boost=N / $downrank=N(1–10)、$discard、$site=example.com。用逗号组合: