google-search

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Google Search API

Google Search API

Google's own search results as clean JSON — one plain HTTP GET per call, paid as you go. Google's search operators pass straight through:
site:
,
filetype:
,
intitle:
, and quoted exact phrases all work exactly as they do in the browser. No Custom Search Engine setup, no per-day query quota, no billing account.
Base URL:
https://google.fetcher.sh
以结构化JSON格式返回Google原生搜索结果——每次调用仅需一个简单的HTTP GET请求,按需付费。Google的搜索运算符可直接传递:
site:
filetype:
intitle:
及精确短语引号匹配的效果与浏览器中完全一致。无需设置自定义搜索引擎,无每日查询配额,无需绑定计费账户。
基础URL:
https://google.fetcher.sh

Authentication

认证方式

Two ways to pay, same data — full mechanics in the
fetcher
skill
:
bash
undefined
两种付费方式,返回数据一致——详细机制请查看
fetcher
技能
bash
undefined

1. Prepaid credits (recommended — get a key at https://fetcher.sh/topup

1. 预付费额度(推荐——可通过https://fetcher.sh/topup获取密钥

or via POST /api/credits/topup, see the fetcher skill)

或调用POST /api/credits/topup,详见fetcher技能)

export FETCHER_API_KEY="bby_live_xxxxxxxxxxxx" curl -H "Authorization: Bearer $FETCHER_API_KEY"
"https://google.fetcher.sh/api/search?query=hello"
export FETCHER_API_KEY="bby_live_xxxxxxxxxxxx" curl -H "Authorization: Bearer $FETCHER_API_KEY"
"https://google.fetcher.sh/api/search?query=hello"

2. x402 pay-per-call — omit the header; a GET with no payment returns 402

2. x402按调用付费——省略请求头;未付费的GET请求会返回402状态码

with machine-readable payment requirements (USDC on Base, Polygon,

并附带机器可读的支付要求(支持在Base、Polygon、Arbitrum、Monad或Solana链上使用USDC支付)。@x402/fetch会自动签名并重试请求。

Arbitrum, Monad, or Solana). @x402/fetch signs and retries automatically.


Every response is `{ "status": number, "message": string, "data": ... }`; the
HTTP status mirrors `status`.

所有响应格式均为`{ "status": number, "message": string, "data": ... }`;HTTP状态码与`status`字段值一致。

Endpoint ($0.005/call)

接口(每次调用$0.005)

EndpointWhat it returns
/api/search
Google web search results for a query
Required:
query
. Optional:
safe
(SafeSearch),
page
(pagination),
hl
(UI language, e.g.
en
),
country
(region scope),
count
(results per page — currently
10
),
noEncode
(skip query re-encoding for pre-formatted operator strings).
接口返回内容
/api/search
对应查询词的Google网页搜索结果
必填参数:
query
。可选参数:
safe
(安全搜索)、
page
(分页)、
hl
(界面语言,例如
en
)、
country
(地区范围)、
count
(每页结果数——当前默认值为
10
)、
noEncode
(跳过对预格式化运算符字符串的查询重编码)。

Scenarios

使用场景

Restrict to one site:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "query=site:github.com x402 payments" -G \
  "https://google.fetcher.sh/api/search"
PDFs only:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "query=agentic commerce filetype:pdf" -G \
  "https://google.fetcher.sh/api/search"
Exact phrase:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode 'query="pay per call api"' -G \
  "https://google.fetcher.sh/api/search"
Localized results (UK, French UI) and pagination:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "query=agentic commerce" -G \
  --data-urlencode "country=GB" \
  --data-urlencode "hl=fr" \
  --data-urlencode "page=2" \
  "https://google.fetcher.sh/api/search"
Combine operators — title match plus site restriction:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "query=intitle:pricing site:x402.org" -G \
  "https://google.fetcher.sh/api/search"
限定单个站点搜索:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "query=site:github.com x402 payments" -G \
  "https://google.fetcher.sh/api/search"
仅搜索PDF文件:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "query=agentic commerce filetype:pdf" -G \
  "https://google.fetcher.sh/api/search"
精确短语搜索:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode 'query="pay per call api"' -G \
  "https://google.fetcher.sh/api/search"
本地化结果(英国地区、法语界面)及分页:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "query=agentic commerce" -G \
  --data-urlencode "country=GB" \
  --data-urlencode "hl=fr" \
  --data-urlencode "page=2" \
  "https://google.fetcher.sh/api/search"
组合运算符——标题匹配+站点限定:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "query=intitle:pricing site:x402.org" -G \
  "https://google.fetcher.sh/api/search"

MCP

MCP

json
{
  "mcpServers": {
    "google-search": {
      "url": "https://google.fetcher.sh/mcp",
      "headers": { "Authorization": "Bearer bby_live_..." }
    }
  }
}
Free:
search_endpoints
,
describe_endpoint
,
check_balance
. Paid:
fetch_data
(any endpoint above),
topup_credits
, plus the named shortcut
google_search
. Drop the
headers
block to pay per call with x402 instead — see the
fetcher
skill
for the full flow.
json
{
  "mcpServers": {
    "google-search": {
      "url": "https://google.fetcher.sh/mcp",
      "headers": { "Authorization": "Bearer bby_live_..." }
    }
  }
}
免费接口:
search_endpoints
describe_endpoint
check_balance
。付费接口:
fetch_data
(上述所有接口)、
topup_credits
,以及命名快捷方式
google_search
。若要使用x402按调用付费,可移除
headers
块——完整流程请查看
fetcher
技能

Errors

错误码

  • 400
    — missing/invalid parameter (message names it)
  • 401
    — unknown or rotated key
  • 402
    — payment required (x402 challenge) or
    topup_required
    (credits exhausted)
  • 404
    — not a priced path
  • No rate limits; no refunds on upstream failures (settlement precedes delivery)
  • 400
    —— 参数缺失/无效(消息中会指明具体参数)
  • 401
    —— 密钥未知或已过期
  • 402
    —— 需要支付(x402挑战)或
    topup_required
    (预付费额度耗尽)
  • 404
    —— 路径未定价
  • 无速率限制;上游服务失败不退款(结算先于结果交付)

Reference

参考链接