Web Search Pro
Run a web search via the /v1/tools/search_pro endpoint with site and time-range constraints, plus structured content chunks.
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.
Usage Example
Usage Example
Response Fields
Response Fields
chunks, the string fields above are returned as empty strings when no data is available.Response ExampleError Codes
Error Codes
search_results array; failed or empty-result calls are free. For pricing details, see WebSearch Pricing.Authorizations
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
Search query text. Must not be empty.
Search timeout in seconds, from 1 to 60. If omitted, no per-request timeout is applied.
1 <= x <= 60Maximum number of results to return, from 1 to 20. Defaults to 5.
1 <= x <= 20Restrict 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.
5Time-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
List of search results; an empty array when nothing matches.