Skip to main content
POST
Web Search Pro
On top of Web Search Basic, this endpoint lets you restrict results to specific sites with sites (multiple sites are OR’d, up to 5), constrain the time range with time_window, and return structured content chunks (chunks) for each result. Ideal for retrieval scenarios that require control over sources and freshness. start and end of time_window accept YYYY, YYYY-MM, and YYYY-MM-DD formats. Both are normalized to the first day of their period before comparison, and start must not be later than end.
Except for chunks, the string fields above are returned as empty strings when no data is available.Response Example
Common Response HeadersAll responses, including error responses, carry these two headers.
Billing: you are charged once per successful call (HTTP 200) that returns a non-empty search_results array; failed or empty-result calls are free. For pricing details, see WebSearch Pricing.

Authorizations

Authorization
string
header
required

The Authorization header expects a Bearer token. Use an MOONSHOT_API_KEY as the token. This is a server-side secret key. Generate one on the API keys page in your dashboard.

Body

application/json
text_query
string
required

Search query text. Must not be empty.

timeout_seconds
integer

Search timeout in seconds, from 1 to 60. If omitted, no per-request timeout is applied.

Required range: 1 <= x <= 60
limit
integer
default:5

Maximum number of results to return, from 1 to 20. Defaults to 5.

Required range: 1 <= x <= 20
sites
string[]

Restrict results to the given sites. Multiple sites are OR'd, up to 5 entries; each entry must be non-empty and must not contain whitespace or parentheses.

Maximum array length: 5
time_window
object

Time-window constraint on result dates. start and end are each normalized to the first day of their period before comparison; start must not be later than end.

Response

Search results with content snippets

search_results
object[]
required

List of search results; an empty array when nothing matches.