Web Search
Paid Web 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)
This endpoint uses HTTP 402 Payment Required:
- 1. First request (no payment header) -> Server returns
402 with payment requirements JSON - Client signs the payment requirements (EIP-712) -> Produces a INLINECODE1
- Retry with
PAYMENT-SIGNATURE header -> Server verifies, settles, returns result JSON
When using @springmint/x402-payment (Node.js) or x402-sdk-go (Go), the flow is handled automatically.
Quick Start (cURL)
Basic Search
CODEBLOCK1
With Parameters
CODEBLOCK2
Using with x402-payment
CLI (AI Agent)
CODEBLOCK3
Tip: add query params directly to --url, e.g. ...?q=bitcoin+etf&freshness=pd.
Library (Node.js)
CODEBLOCK4
When to Use Web Search
| Feature | Web Search (this) | LLM Context (llm-context) | Answers (answers) |
|---|
| Output | Structured results (links, snippets, metadata) | Pre-extracted page content for LLMs | End-to-end AI answers with citations |
| Result types |
Web, news, videos, discussions, FAQ, infobox, locations, rich | Extracted text chunks, tables, code | Synthesized answer + source list |
| Unique features | Goggles, structured data (
schemas), rich callbacks | Token budget control, threshold modes | Multi-iteration search, streaming, OpenAI SDK compatible |
| Speed | Fast (~0.5-1s) | Fast (<1s) | Slower (~30-180s) |
| Best for | Search UIs, data extraction, custom ranking | RAG pipelines, AI agents, grounding | Chat interfaces, thorough research |
Parameters
| Parameter | Type | Required | Default | Description |
|---|
| INLINECODE10 | string | Yes | - | Search query (1-400 chars, max 50 words) |
| INLINECODE11 |
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 | Max results per page (1-20) |
|
offset | int | No |
0 | Page offset for pagination (0-9) |
|
safesearch | string | No |
moderate | Adult content filter (
off/
moderate/
strict) |
|
freshness | string | No | - | Time filter (
pd/
pw/
pm/
py or date range) |
|
text_decorations | bool | No |
true | Include highlight markers |
|
spellcheck | bool | No |
true | Auto-correct query |
|
result_filter | string | No | - | Filter result types (comma-separated) |
|
goggles | string | No | - | Custom ranking filter (URL or inline) |
|
extra_snippets | bool | No | - | Get up to 5 extra snippets per result |
|
operators | bool | No |
true | Apply search operators |
|
units | string | No | - | Measurement units (
metric/
imperial) |
|
enable_rich_callback | bool | No |
false | Enable rich 3rd party data callback |
|
include_fetch_metadata | bool | No |
false | Include
fetched_content_timestamp on results |
Freshness Values
| Value | Description |
|---|
| INLINECODE49 | Past day (24 hours) |
| INLINECODE50 |
Past week (7 days) |
|
pm | Past month (31 days) |
|
py | Past year (365 days) |
|
YYYY-MM-DDtoYYYY-MM-DD | Custom date range |
Result Filter Values
Filter types: discussions, faq, infobox, news, query, videos, web, INLINECODE61
CODEBLOCK5
Location Headers (Optional)
For location-aware results, add these headers. Lat/Long is sufficient when coordinates are known — the other headers are only needed as a fallback when coordinates are unavailable.
| Header | Type | Description |
|---|
| INLINECODE62 | float | User latitude (-90.0 to 90.0) |
| INLINECODE63 |
float | User longitude (-180.0 to 180.0) |
|
X-Loc-Timezone | string | IANA timezone (e.g., "America/San_Francisco") |
|
X-Loc-City | string | City name |
|
X-Loc-State | string | State/region code (ISO 3166-2) |
|
X-Loc-State-Name | string | State/region full name (e.g., "California") |
|
X-Loc-Country | string | 2-letter country code |
|
X-Loc-Postal-Code | string | Postal code (e.g., "94105") |
Priority: X-Loc-Lat + X-Loc-Long take precedence. When provided, downstream services resolve the location directly from coordinates and the text-based headers (City, State, Country, Postal-Code) are not used for location resolution. Provide text-based headers only when you don't have coordinates. Sending both won't break anything — lat/long simply wins.
Response Format
Response Fields
| Field | Type | Description |
|---|
| INLINECODE72 | string | Always INLINECODE73 |
| INLINECODE74 |
string | The original search query |
|
query.altered | string? | Spellcheck-corrected query (if changed) |
|
query.cleaned | string? | Cleaned/normalized query |
|
query.spellcheck_off | bool? | Whether spellcheck was disabled |
|
query.more_results_available | bool | Whether more pages exist |
|
query.show_strict_warning | bool? | True if strict safesearch blocked adult results |
|
query.search_operators | object? | Applied search operators (
applied,
cleaned_query,
sites) |
|
web.type | string | Always
"search" |
|
web.results[].title | string | Page title |
|
web.results[].url | string | Page URL |
|
web.results[].description | string? | Snippet/description text |
|
web.results[].age | string? | Human-readable age (e.g., "2 days ago") |
|
web.results[].language | string? | Content language code |
|
web.results[].meta_url | object | URL components (
scheme,
netloc,
hostname,
path) |
|
web.results[].thumbnail | object? | Thumbnail (
src,
original) |
|
web.results[].thumbnail.original | string? | Original full-size image URL |
|
web.results[].thumbnail.logo | bool? | Whether the thumbnail is a logo |
|
web.results[].profile | object? | Publisher identity (
name,
url,
long_name,
img) |
|
web.results[].page_age | string? | ISO datetime of publication (e.g.,
"2025-04-12T14:22:41") |
|
web.results[].extra_snippets | list[str]? | Up to 5 additional excerpts |
|
web.results[].deep_results | object? | Additional links (
buttons,
links) from the page |
|
web.results[].schemas | list? | Raw schema.org structured data |
|
web.results[].product | object? | Product info and reviews |
|
web.results[].recipe | object? | Recipe details (ingredients, time, ratings) |
|
web.results[].article | object? | Article metadata (author, publisher, date) |
|
web.results[].book | object? | Book info (author, ISBN, rating) |
|
web.results[].software | object? | Software product info |
|
web.results[].rating | object? | Aggregate ratings |
|
web.results[].faq | object? | FAQ found on the page |
|
web.results[].movie | object? | Movie info (directors, actors, genre) |
|
web.results[].video | object? | Video metadata (duration, views, creator) |
|
web.results[].location | object? | Location/restaurant details |
|
web.results[].qa | object? | Question/answer info |
|
web.results[].creative_work | object? | Creative work data |
|
web.results[].music_recording | object? | Music/song data |
|
web.results[].organization | object? | Organization info |
|
web.results[].review | object? | Review data |
|
web.results[].content_type | string? | Content type classification |
|
web.results[].fetched_content_timestamp | int? | Fetch timestamp (with
include_fetch_metadata=true) |
|
web.mutated_by_goggles | bool | Whether results were re-ranked by Goggles |
|
web.family_friendly | bool | Whether results are family-friendly |
|
mixed | object? | Preferred display order (see Mixed Response below) |
|
discussions.results[] | array? | Forum discussion clusters |
|
discussions.results[].data.forum_name | string? | Forum/community name |
|
discussions.results[].data.num_answers | int? | Number of answers/replies |
|
discussions.results[].data.question | string? | Discussion question |
|
discussions.results[].data.top_comment | string? | Top-voted comment excerpt |
|
faq.results[] | array? | FAQ entries |
|
news.results[] | array? | News articles |
|
videos.results[] | array? | Video results |
|
infobox.results[] | array? | Knowledge graph entries |
|
locations.results[] | array? | Local POI results |
|
rich.hint.vertical | string? | Rich result type |
|
rich.hint.callback_key | string? | Callback key for rich data |
JSON Example
CODEBLOCK6
Mixed Response
The mixed object defines the preferred display order of results across types. It contains three arrays:
| Array | Purpose |
|---|
| INLINECODE147 | Primary result list (ordered sequence of results to display) |
| INLINECODE148 |
Results to display above main results |
|
side | Results to display alongside main results (e.g., infobox) |
Each entry is a ResultReference with type (e.g., "web", "videos"), index (into the corresponding result array), and all (true to include all results of that type at this position).
Search Operators
| Operator | Syntax | Description |
|---|
| Site | INLINECODE157 | Limit results to a specific domain |
| File extension |
ext:pdf | Results with a specific file extension |
| File type |
filetype:pdf | Results created in a specific file type |
| In title |
intitle:python | Pages with term in the title |
| In body |
inbody:tutorial | Pages with term in the body |
| In page |
inpage:guide | Pages with term in title or body |
| Language |
lang:es | Pages in a specific language (ISO 639-1) |
| Location |
loc:us | Pages from a specific country (ISO 3166-1 alpha-2) |
| Include |
+term | Force inclusion of a term |
| Exclude |
-term | Exclude pages containing the term |
| Exact match |
"exact phrase" | Match the exact phrase in order |
| AND |
term1 AND term2 | Both terms required (uppercase) |
| OR / NOT |
term1 OR term2,
NOT term | Logical operators (uppercase) |
Set operators=false to disable operator parsing.
Goggles (Custom Ranking)
Goggles let you re-rank search results — boost trusted sources, suppress SEO spam, or build focused search scopes.
| Method | Example |
|---|
| Hosted | INLINECODE172 |
| 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: INLINECODE185
Resources: See your upstream provider's Goggles documentation.
Rich Data Enrichments
For queries about weather, stocks, sports, currency, etc., use the rich callback workflow:
CODEBLOCK7
Supported Rich Types: Calculator, Definitions, Unit Conversion, Unix Timestamp, Package Tracker, Stock, Currency, Cryptocurrency, Weather, American Football, Baseball, Basketball, Cricket, Football/Soccer, Ice Hockey, Web3, Translator
Rich Callback Endpoint
CODEBLOCK8
| Parameter | Type | Required | Description |
|---|
| INLINECODE186 | string | Yes | Callback key from the web search rich.hint.callback_key field |
Use Cases
- - General-purpose search integration: Richest result set (web, news, videos, discussions, FAQ, infobox, locations) in one call. For RAG/LLM grounding, prefer
llm-context. - Structured data extraction: Products, recipes, ratings, articles via
schemas and typed fields on results. - Custom search with Goggles: Boost/discard sites with inline rules or hosted Goggles for fully customized ranking.
Notes
- - Pagination: Use
offset (0-9) with count to page through results - Count: Max 20 for web search; actual results may be less than requested
Web Search
通过 x402 按使用付费(HTTP 402)的付费网络搜索代理。
前置条件:此技能需要 x402 支付。首次使用前请完成设置步骤。
安全性:仅文档说明——无可执行代码或凭据。钱包/密钥保留在您的机器上;绝不在此处存储。
服务 URL
| 角色 | 域名 |
|---|
| API 提供商 | https://www.cpbox.io |
| 促进者 |
https://www.cppay.finance |
端点(代理接口)
http
GET /api/x402/web-search
POST /api/x402/web-search/post
支付流程(x402 协议)
此端点使用 HTTP 402 Payment Required:
- 1. 首次请求(无支付头)-> 服务器返回带有支付要求 JSON 的 402
- 客户端签名支付要求(EIP-712)-> 生成 PAYMENT-SIGNATURE
- 重试并携带 PAYMENT-SIGNATURE 头 -> 服务器验证、结算、返回结果 JSON
使用 @springmint/x402-payment(Node.js)或 x402-sdk-go(Go)时,流程将自动处理。
快速开始(cURL)
基本搜索
bash
curl -s https://www.cpbox.io/api/x402/web-search?q=python+web+frameworks \
-H Accept: application/json
带参数
bash
curl -s https://www.cpbox.io/api/x402/web-search \
-H Accept: application/json \
-G \
--data-urlencode q=rust programming tutorials \
--data-urlencode country=US \
--data-urlencode search_lang=en \
--data-urlencode count=10 \
--data-urlencode safesearch=moderate \
--data-urlencode freshness=pm
与 x402-payment 一起使用
CLI(AI 代理)
bash
npx @springmint/x402-payment \
--url https://www.cpbox.io/api/x402/web-search \
--method GET
提示:直接将查询参数添加到 --url,例如 ...?q=bitcoin+etf&freshness=pd。
库(Node.js)
ts
import { createX402FetchClient } from @springmint/x402-payment;
const client = await createX402FetchClient();
const response = await client.request(
https://www.cpbox.io/api/x402/web-search?q=python+web+frameworks&count=10,
{ method: GET },
);
const data = await response.json();
何时使用 Web Search
| 特性 | Web Search(本技能) | LLM Context(llm-context) | Answers(answers) |
|---|
| 输出 | 结构化结果(链接、摘要、元数据) | 为 LLM 预提取的页面内容 | 带引用的端到端 AI 答案 |
| 结果类型 |
网页、新闻、视频、讨论、FAQ、信息框、位置、富内容 | 提取的文本块、表格、代码 | 综合答案 + 来源列表 |
| 独特功能 | Goggles、结构化数据(schemas)、富回调 | Token 预算控制、阈值模式 | 多轮搜索、流式传输、兼容 OpenAI SDK |
| 速度 | 快速(约 0.5-1 秒) | 快速(<1 秒) | 较慢(约 30-180 秒) |
| 最适合 | 搜索 UI、数据提取、自定义排序 | RAG 管道、AI 代理、事实依据 | 聊天界面、深入研究 |
参数
| 参数 | 类型 | 必需 | 默认值 | 描述 |
|---|
| q | string | 是 | - | 搜索查询(1-400 字符,最多 50 个词) |
| country |
string | 否 | US | 搜索国家(2 字母国家代码或 ALL) |
| search_lang | string | 否 | en | 语言偏好(2+ 字符语言代码) |
| ui_lang | string | 否 | en-US | UI 语言(例如 en-US) |
| count | int | 否 | 20 | 每页最大结果数(1-20) |
| offset | int | 否 | 0 | 分页偏移量(0-9) |
| safesearch | string | 否 | moderate | 成人内容过滤(off/moderate/strict) |
| freshness | string | 否 | - | 时间过滤(pd/pw/pm/py 或日期范围) |
| text_decorations | bool | 否 | true | 包含高亮标记 |
| spellcheck | bool | 否 | true | 自动纠正查询 |
| result_filter | string | 否 | - | 过滤结果类型(逗号分隔) |
| goggles | string | 否 | - | 自定义排序过滤器(URL 或内联) |
| extra_snippets | bool | 否 | - | 每个结果最多获取 5 个额外摘要 |
| operators | bool | 否 | true | 应用搜索运算符 |
| units | string | 否 | - | 测量单位(metric/imperial) |
| enable
richcallback | bool | 否 | false | 启用富第三方数据回调 |
| include
fetchmetadata | bool | 否 | false | 在结果中包含 fetched
contenttimestamp |
Freshness 值
过去一周(7 天) |
| pm | 过去一个月(31 天) |
| py | 过去一年(365 天) |
| YYYY-MM-DDtoYYYY-MM-DD | 自定义日期范围 |
结果过滤值
过滤类型:discussions、faq、infobox、news、query、videos、web、locations
bash
仅网页和视频结果
curl ...&result_filter=web,videos
位置头(可选)
对于位置感知结果,添加这些头。当已知坐标时,经纬度就足够了——其他头仅在坐标不可用时作为后备需要。
| 头 | 类型 | 描述 |
|---|
| X-Loc-Lat | float | 用户纬度(-90.0 到 90.0) |
| X-Loc-Long |
float | 用户经度(-180.0 到 180.0) |
| X-Loc-Timezone | string | IANA 时区(例如 America/San_Francisco) |
| X-Loc-City | string | 城市名称 |
| X-Loc-State | string | 州/地区代码(ISO 3166-2) |
| X-Loc-State-Name | string | 州/地区全名(例如 California) |
| X-Loc-Country | string | 2 字母国家代码 |
| X-Loc-Postal-Code | string | 邮政编码(例如 94105) |
优先级:X-Loc-Lat + X-Loc-Long 优先。当提供时,下游服务直接从坐标解析位置,基于文本的头(城市、州、国家、邮政编码)不用于位置解析。仅在您没有坐标时提供基于文本的头。同时发送两者不会造成任何问题——经纬度优先。
响应格式
响应字段
| 字段 | 类型 | 描述 |
|---|
| type | string | 始终为 search |
| query.original |
string | 原始搜索查询 |
| query.altered | string? | 拼写检查纠正后的查询(如果更改) |
| query.cleaned | string? | 清理/规范化后的查询 |
| query.spellcheck_off | bool? | 拼写检查是否已禁用 |
| query.more
resultsavailable | bool | 是否还有更多页面 |
| query.show
strictw