spellcheck

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Spellcheck

拼写检查

Requires API Key: Get one at https://api.search.brave.com
需要API Key: 可在 https://api.search.brave.com 获取
套餐: 包含在拼写检查套餐中,详见 https://api-dashboard.search.brave.com/app/subscriptions/subscribe

Quick Start (cURL)

快速开始(cURL)

bash
curl -s "https://api.search.brave.com/res/v1/spellcheck/search" \
  -H "Accept: application/json" \
  -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \
  -G \
  --data-urlencode "q=artifical inteligence" \
  --data-urlencode "lang=en" \
  --data-urlencode "country=US"
bash
curl -s "https://api.search.brave.com/res/v1/spellcheck/search" \
  -H "Accept: application/json" \
  -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \
  -G \
  --data-urlencode "q=artifical inteligence" \
  --data-urlencode "lang=en" \
  --data-urlencode "country=US"

Endpoint

接口端点

http
GET https://api.search.brave.com/res/v1/spellcheck/search
Authentication:
X-Subscription-Token: <API_KEY>
header
http
GET https://api.search.brave.com/res/v1/spellcheck/search
身份验证: 请求头传入
X-Subscription-Token: <API_KEY>

Parameters

参数

ParameterTypeRequiredDefaultDescription
q
stringYesQuery to spell check (1-400 chars, max 50 words)
lang
stringNo
en
Language preference (2+ char language code, e.g.
en
,
fr
,
de
,
pt-br
,
zh-hans
). 51 codes supported
country
stringNo
US
Search country (2-letter country code or
ALL
)
参数类型必填默认值描述
q
string待拼写检查的查询词(1-400字符,最多50个单词)
lang
string
en
语言偏好(2位及以上语言代码,例如
en
fr
de
pt-br
zh-hans
),支持51种语言代码
country
string
US
搜索所属国家(2位国家代码或
ALL

Response Fields

返回字段

FieldTypeDescription
type
stringAlways
"spellcheck"
query.original
stringThe input query as submitted
results
arraySpell-corrected suggestions. May be empty when no correction is found
results[].query
stringA corrected version of the query
字段类型描述
type
string固定为
"spellcheck"
query.original
string用户提交的原始查询词
results
array拼写纠正建议列表,未找到可纠正内容时可能为空
results[].query
string纠正后的查询词版本

Example Response

响应示例

json
{
  "type": "spellcheck",
  "query": {
    "original": "artifical inteligence"
  },
  "results": [
    {
      "query": "artificial intelligence"
    }
  ]
}
json
{
  "type": "spellcheck",
  "query": {
    "original": "artifical inteligence"
  },
  "results": [
    {
      "query": "artificial intelligence"
    }
  ]
}

Use Cases

使用场景

  • Pre-search query cleanup: Check spelling before deciding which search endpoint to call
  • "Did you mean?" UI: Show users a corrected suggestion before running the search
  • Batch query normalization: Clean up user inputs in bulk
  • 搜索前查询清理: 在决定调用哪个搜索端点之前先完成拼写检查
  • "你是不是想找?" UI: 在执行搜索前向用户展示纠正后的搜索建议
  • 批量查询标准化: 批量清理用户输入内容

Notes

注意事项

  • Built-in alternative: Web Search and LLM Context have
    spellcheck=true
    by default — use this standalone endpoint only when you need the correction before searching
  • Context-aware: Corrections consider the full query context, not just individual words
  • 内置替代方案: 网页搜索和LLM Context接口默认开启
    spellcheck=true
    —— 仅当你需要在搜索前获取纠错结果时才使用此独立接口
  • 上下文感知: 纠错会参考完整的查询上下文,而不只是单独校验单个单词