news-shopping
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNews & Shopping Search with Serper
通过Serper实现新闻与购物搜索
STOP — Read before making any API call. enrichx402.com endpoints are not the same as each provider's native API. All paths use the format. You MUST either:https://enrichx402.com/api/{provider}/{action}
- Copy exact URLs from the Quick Reference table below, OR
- Run
to get the correct pathsx402.discover_api_endpoints(url="https://enrichx402.com")Guessing paths will fail with 405 errors (wrong path) or 404 errors (missingprefix)./api/
Access Google News and Google Shopping through x402-protected endpoints.
注意 — 调用任何API前请仔细阅读。 enrichx402.com的接口并非各服务商的原生API。所有路径均采用格式。您必须:https://enrichx402.com/api/{provider}/{action}
- 从下方快速参考表中复制准确URL,或者
- 运行
获取正确路径x402.discover_api_endpoints(url="https://enrichx402.com")猜测路径会导致失败,返回405错误(路径错误)或404错误(缺少前缀)。/api/
通过x402保护的接口访问Google News和Google Shopping。
Setup
配置
See rules/getting-started.md for installation and wallet setup.
请查看rules/getting-started.md了解安装和钱包设置方法。
Quick Reference
快速参考
| Task | Endpoint | Price | Description |
|---|---|---|---|
| News search | | $0.04 | Google News search |
| Shopping search | | $0.04 | Google Shopping search |
| 任务 | 接口 | 价格 | 描述 |
|---|---|---|---|
| 新闻搜索 | | $0.04 | Google News搜索 |
| 购物搜索 | | $0.04 | Google Shopping搜索 |
News Search
新闻搜索
Search Google News for articles:
mcp
x402.fetch(
url="https://enrichx402.com/api/serper/news",
method="POST",
body={
"q": "artificial intelligence regulation"
}
)Parameters:
- - Search query (required)
q - - Number of results (default: 10)
num - - Country code (e.g., "us", "uk", "de")
gl - - Language (e.g., "en", "es", "fr")
hl - - Time filter (qdr:h, qdr:d, qdr:w, qdr:m, qdr:y)
tbs
搜索Google News获取文章:
mcp
x402.fetch(
url="https://enrichx402.com/api/serper/news",
method="POST",
body={
"q": "artificial intelligence regulation"
}
)参数:
- - 搜索关键词(必填)
q - - 结果数量(默认:10)
num - - 国家代码(例如:"us"、"uk"、"de")
gl - - 语言(例如:"en"、"es"、"fr")
hl - - 时间筛选器(qdr:h, qdr:d, qdr:w, qdr:m, qdr:y)
tbs
Time Filters
时间筛选器
| Filter | Meaning |
|---|---|
| Past hour |
| Past 24 hours |
| Past week |
| Past month |
| Past year |
Example - news from past week:
mcp
x402.fetch(
url=".../serper/news",
body={
"q": "AI startups funding",
"tbs": "qdr:w"
}
)| 筛选器 | 含义 |
|---|---|
| 过去1小时 |
| 过去24小时 |
| 过去1周 |
| 过去1个月 |
| 过去1年 |
示例 - 过去一周的新闻:
mcp
x402.fetch(
url=".../serper/news",
body={
"q": "AI startups funding",
"tbs": "qdr:w"
}
)Country/Language Filtering
国家/语言筛选
mcp
x402.fetch(
url=".../serper/news",
body={
"q": "technology news",
"gl": "uk",
"hl": "en"
}
)Returns:
- Article title and snippet
- Source/publication name
- Published date
- Article URL
- Thumbnail image (if available)
mcp
x402.fetch(
url=".../serper/news",
body={
"q": "technology news",
"gl": "uk",
"hl": "en"
}
)返回内容:
- 文章标题和摘要
- 来源/发布机构名称
- 发布日期
- 文章URL
- 缩略图(如有)
Shopping Search
购物搜索
Search Google Shopping for products:
mcp
x402.fetch(
url="https://enrichx402.com/api/serper/shopping",
method="POST",
body={
"q": "wireless noise cancelling headphones"
}
)Parameters:
- - Search query (required)
q - - Number of results (default: 10)
num - - Country code for pricing/availability
gl - - Language
hl
Returns:
- Product title
- Price and currency
- Merchant/store name
- Product URL
- Rating (if available)
- Thumbnail image
搜索Google Shopping获取产品:
mcp
x402.fetch(
url="https://enrichx402.com/api/serper/shopping",
method="POST",
body={
"q": "wireless noise cancelling headphones"
}
)参数:
- - 搜索关键词(必填)
q - - 结果数量(默认:10)
num - - 用于定价/库存查询的国家代码
gl - - 语言
hl
返回内容:
- 产品标题
- 价格与货币
- 商家/店铺名称
- 产品URL
- 评分(如有)
- 缩略图
Shopping with Location
基于地理位置的购物搜索
Get local pricing and availability:
mcp
x402.fetch(
url=".../serper/shopping",
body={
"q": "MacBook Pro M3",
"gl": "us"
}
)获取本地定价与库存信息:
mcp
x402.fetch(
url=".../serper/shopping",
body={
"q": "MacBook Pro M3",
"gl": "us"
}
)Workflows
工作流
News Monitoring
新闻监控
- (Optional) Check balance:
x402.get_wallet_info - Discover endpoints (required before first fetch):
x402.discover_api_endpoints(url="https://enrichx402.com") - Search with appropriate time filter
- Review and summarize top stories
mcp
x402.fetch(
url="https://enrichx402.com/api/serper/news",
method="POST",
body={"q": "company name OR competitor name", "tbs": "qdr:d", "num": 20}
)- (可选)查询余额:
x402.get_wallet_info - 发现接口(首次调用前必填):
x402.discover_api_endpoints(url="https://enrichx402.com") - 使用合适的时间筛选器进行搜索
- 查看并总结热门报道
mcp
x402.fetch(
url="https://enrichx402.com/api/serper/news",
method="POST",
body={"q": "company name OR competitor name", "tbs": "qdr:d", "num": 20}
)Breaking News Research
突发新闻调研
- Search with for past hour
qdr:h - Identify key sources and facts
- Note developing aspects
mcp
x402.fetch(
url="https://enrichx402.com/api/serper/news",
method="POST",
body={"q": "breaking news topic", "tbs": "qdr:h"}
)- 使用筛选过去1小时的内容
qdr:h - 识别关键来源与事实
- 记录事件进展
mcp
x402.fetch(
url="https://enrichx402.com/api/serper/news",
method="POST",
body={"q": "breaking news topic", "tbs": "qdr:h"}
)Product Research
产品调研
- Define search criteria (category, price range)
- Search Google Shopping
- Compare prices across merchants
- Present top options with pros/cons
mcp
x402.fetch(
url="https://enrichx402.com/api/serper/shopping",
method="POST",
body={"q": "ergonomic office chair under $500", "num": 20}
)- 定义搜索条件(品类、价格区间)
- 搜索Google Shopping
- 对比不同商家的价格
- 展示最优选项及优缺点
mcp
x402.fetch(
url="https://enrichx402.com/api/serper/shopping",
method="POST",
body={"q": "ergonomic office chair under $500", "num": 20}
)Price Comparison
价格对比
- Use exact product name/model
- Compare merchant prices
- Note shipping and availability
mcp
x402.fetch(
url="https://enrichx402.com/api/serper/shopping",
method="POST",
body={"q": "exact product name model number"}
)- 使用准确的产品名称/型号
- 对比不同商家的价格
- 记录运费与库存信息
mcp
x402.fetch(
url="https://enrichx402.com/api/serper/shopping",
method="POST",
body={"q": "exact product name model number"}
)Response Data
响应数据
News Article Fields
新闻文章字段
- - Article headline
title - - Article excerpt
snippet - - Publication name
source - - Published date
date - - Article URL
link - - Thumbnail (if available)
imageUrl
- - 文章标题
title - - 文章摘要
snippet - - 发布机构名称
source - - 发布日期
date - - 文章URL
link - - 缩略图(如有)
imageUrl
Shopping Product Fields
购物产品字段
- - Product name
title - - Price with currency
price - - Merchant/store
source - - Product URL
link - - Star rating (if available)
rating - - Number of reviews
reviews - - Product image
imageUrl - - Shipping info (if available)
delivery
- - 产品名称
title - - 带货币符号的价格
price - - 商家/店铺
source - - 产品URL
link - - 星级评分(如有)
rating - - 评论数量
reviews - - 产品图片
imageUrl - - 配送信息(如有)
delivery
Tips
小贴士
News Search
新闻搜索
- Use quotes for exact phrases:
"climate change" - Use OR for alternatives:
AI OR "artificial intelligence" - Be specific to get relevant results
- Use time filters to avoid old news
- 使用引号精确匹配短语:
"climate change" - 使用OR连接备选关键词:
AI OR "artificial intelligence" - 关键词越具体,结果越相关
- 使用时间筛选器避免过时新闻
Shopping Search
购物搜索
- Include brand/model for specific products
- Add "under $X" or "best" for filtered results
- Check parameter for accurate local pricing
gl - More results = better price comparison
- 搜索具体产品时包含品牌/型号
- 添加"under $X"或"best"筛选结果
- 检查参数以获取准确的本地定价
gl - 结果数量越多,价格对比越全面
Cost Estimation
成本估算
Both endpoints are $0.04 per call.
| Task | Calls | Cost |
|---|---|---|
| Quick news check | 1 | $0.04 |
| Daily news summary | 2-3 | $0.08-0.12 |
| Product research | 1-2 | $0.04-0.08 |
| Full market research | 3-5 | $0.12-0.20 |
两个接口每次调用费用均为0.04美元。
| 任务 | 调用次数 | 成本 |
|---|---|---|
| 快速新闻查询 | 1 | $0.04 |
| 每日新闻摘要 | 2-3 | $0.08-0.12 |
| 产品调研 | 1-2 | $0.04-0.08 |
| 完整市场调研 | 3-5 | $0.12-0.20 |