news-shopping

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

News & 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
https://enrichx402.com/api/{provider}/{action}
. You MUST either:
  1. Copy exact URLs from the Quick Reference table below, OR
  2. Run
    x402.discover_api_endpoints(url="https://enrichx402.com")
    to get the correct paths
Guessing paths will fail with 405 errors (wrong path) or 404 errors (missing
/api/
prefix).
Access Google News and Google Shopping through x402-protected endpoints.
注意 — 调用任何API前请仔细阅读。 enrichx402.com的接口并非各服务商的原生API。所有路径均采用
https://enrichx402.com/api/{provider}/{action}
格式。您必须:
  1. 从下方快速参考表中复制准确URL,或者
  2. 运行
    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

快速参考

TaskEndpointPriceDescription
News search
https://enrichx402.com/api/serper/news
$0.04Google News search
Shopping search
https://enrichx402.com/api/serper/shopping
$0.04Google Shopping search
任务接口价格描述
新闻搜索
https://enrichx402.com/api/serper/news
$0.04Google News搜索
购物搜索
https://enrichx402.com/api/serper/shopping
$0.04Google 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:
  • q
    - Search query (required)
  • num
    - Number of results (default: 10)
  • gl
    - Country code (e.g., "us", "uk", "de")
  • hl
    - Language (e.g., "en", "es", "fr")
  • tbs
    - Time filter (qdr:h, qdr:d, qdr:w, qdr:m, qdr:y)
搜索Google News获取文章:
mcp
x402.fetch(
  url="https://enrichx402.com/api/serper/news",
  method="POST",
  body={
    "q": "artificial intelligence regulation"
  }
)
参数:
  • q
    - 搜索关键词(必填)
  • num
    - 结果数量(默认:10)
  • gl
    - 国家代码(例如:"us"、"uk"、"de")
  • hl
    - 语言(例如:"en"、"es"、"fr")
  • tbs
    - 时间筛选器(qdr:h, qdr:d, qdr:w, qdr:m, qdr:y)

Time Filters

时间筛选器

FilterMeaning
qdr:h
Past hour
qdr:d
Past 24 hours
qdr:w
Past week
qdr:m
Past month
qdr:y
Past year
Example - news from past week:
mcp
x402.fetch(
  url=".../serper/news",
  body={
    "q": "AI startups funding",
    "tbs": "qdr:w"
  }
)
筛选器含义
qdr:h
过去1小时
qdr:d
过去24小时
qdr:w
过去1周
qdr:m
过去1个月
qdr:y
过去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:
  • q
    - Search query (required)
  • num
    - Number of results (default: 10)
  • gl
    - Country code for pricing/availability
  • hl
    - Language
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
    - 搜索关键词(必填)
  • num
    - 结果数量(默认:10)
  • 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

新闻监控

  1. (Optional) Check balance:
    x402.get_wallet_info
  2. Discover endpoints (required before first fetch):
    x402.discover_api_endpoints(url="https://enrichx402.com")
  3. Search with appropriate time filter
  4. 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}
)
  1. (可选)查询余额:
    x402.get_wallet_info
  2. 发现接口(首次调用前必填):
    x402.discover_api_endpoints(url="https://enrichx402.com")
  3. 使用合适的时间筛选器进行搜索
  4. 查看并总结热门报道
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
    qdr:h
    for past hour
  • 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"}
)
  • 使用
    qdr:h
    筛选过去1小时的内容
  • 识别关键来源与事实
  • 记录事件进展
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

新闻文章字段

  • title
    - Article headline
  • snippet
    - Article excerpt
  • source
    - Publication name
  • date
    - Published date
  • link
    - Article URL
  • imageUrl
    - Thumbnail (if available)
  • title
    - 文章标题
  • snippet
    - 文章摘要
  • source
    - 发布机构名称
  • date
    - 发布日期
  • link
    - 文章URL
  • imageUrl
    - 缩略图(如有)

Shopping Product Fields

购物产品字段

  • title
    - Product name
  • price
    - Price with currency
  • source
    - Merchant/store
  • link
    - Product URL
  • rating
    - Star rating (if available)
  • reviews
    - Number of reviews
  • imageUrl
    - Product image
  • delivery
    - Shipping info (if available)
  • title
    - 产品名称
  • price
    - 带货币符号的价格
  • source
    - 商家/店铺
  • link
    - 产品URL
  • 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
    gl
    parameter for accurate local pricing
  • More results = better price comparison
  • 搜索具体产品时包含品牌/型号
  • 添加"under $X"或"best"筛选结果
  • 检查
    gl
    参数以获取准确的本地定价
  • 结果数量越多,价格对比越全面

Cost Estimation

成本估算

Both endpoints are $0.04 per call.
TaskCallsCost
Quick news check1$0.04
Daily news summary2-3$0.08-0.12
Product research1-2$0.04-0.08
Full market research3-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