Skip to main content
GET
Suggest

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求头

accept
enum<string>
默认值:application/json

The default supported media type is application/json.

可用选项:
application/json,
*/*
示例:

"application/json"

api-version
string | null

The API version to use. This is denoted by the format YYYY-MM-DD. Default is the latest that is available. Read more about API versioning.

cache-control
enum<string> | null

Brave Search will return cached content by default. To prevent caching set the Cache-Control header to no-cache. This is currently done as best effort.

可用选项:
no-cache
Allowed value: "no-cache"
user-agent
string | null

The user agent originating the request. Brave search can utilize the user agent to provide a different experience depending on the device as described by the string. The user agent should follow the commonly used browser agent strings on each platform. For more information on curating user agents, see RFC 9110.

查询参数

count
integer
默认值:5

The number of suggestion search results returned in response. The actual number of results delivered may be less than requested. Minimum is 1, maximum is 20. The default is 5.

必填范围: 1 <= x <= 20
country
enum<string>
默认值:US

The suggest search query country, where potentially the results could come from. The country string is limited to 2 character country codes of supported countries. This is a just a hint for calculating suggest responses.

可用选项:
AR,
AU,
AT,
BE,
BR,
CA,
CL,
DK,
FI,
FR,
DE,
GR,
HK,
IN,
ID,
IT,
JP,
KR,
MY,
MX,
NL,
NZ,
NO,
CN,
PL,
PT,
PH,
RU,
SA,
ZA,
ES,
SE,
CH,
TW,
TR,
GB,
US,
ALL
lang
enum<string>
默认值:en

The suggest search language preference, where potentially the results could come from. The 2 or more character language code for which the suggest search results are provided. This is a just a hint for calculating suggest responses.

可用选项:
ar,
eu,
bn,
bg,
ca,
zh-hans,
zh-hant,
hr,
cs,
da,
nl,
en,
en-gb,
et,
fi,
fr,
gl,
de,
el,
gu,
he,
hi,
hu,
is,
it,
ja,
jp,
kn,
ko,
lv,
lt,
ms,
ml,
mr,
nb,
pl,
pt-br,
pt-pt,
pa,
ro,
ru,
sr,
sk,
sl,
es,
sv,
ta,
te,
th,
tr,
uk,
vi
q
string
必填

The user’s suggest search query term. Query can not be empty. The max query length is 400 characters, and the word limit is 50 words.

Required string length: 1 - 400
rich
boolean
默认值:false

Whether to enhance suggestions with rich results. This requires a paid autosuggest subscription.

响应

Successful Response

query
OriginalQuery · object
必填

Suggest search query string. Only the original query is returned.

type
enum<string>
默认值:suggest
可用选项:
suggest
Allowed value: "suggest"
results
SuggestResult · object[]

The list of suggestions for the given query.