Skip to main content
POST
All supported Web Search features are included in the Free Plan, subject to your account allowance.
Request up to 50 results. Set contents.text to true for full webpage text, or use { "max_characters": 3000 } to set a per-result limit. Text mode returns text instead of snippet; the default limit is 5000 characters. Fewer results, including zero, are valid.
See working with results for field semantics and errors for retry guidance.

Authorizations

Authorization
string
header
default:Bearer YOUR_LANGSEARCH_API_KEY
required

Your LangSearch API key.

Body

application/json
query
string
required

A non-empty natural-language search query.

Minimum string length: 1
Example:

"How does a search API help an AI agent?"

count
integer
default:10

Maximum results requested. Use 1–50. Values below 1 are normalized to 1; values above 50 are rejected.

Required range: x <= 50
freshness
string
default:noLimit

Date filter: noLimit, oneDay, oneWeek, oneMonth, oneYear, YYYY-MM-DD, or YYYY-MM-DD..YYYY-MM-DD. Dates must be valid calendar dates. A single date selects that UTC day; ranges include both endpoints and require start <= end.

Pattern: ^(noLimit|oneDay|oneWeek|oneMonth|oneYear|[0-9]{4}-[0-9]{2}-[0-9]{2}(\.\.[0-9]{4}-[0-9]{2}-[0-9]{2})?)$
Example:

"2026-09-01..2026-09-13"

includeDomains
string[]

Restrict results to these domains. Omit or use an empty array for no inclusion filter.

Minimum string length: 1
Example:
excludeDomains
string[]

Exclude results from these domains. Omit or use an empty array for no exclusion filter.

Minimum string length: 1
Example:
contents
object

Choose whether to retrieve full webpage text.

Response

Search succeeded. Example content illustrates the response shape.

code
integer
required
Example:

200

data
object
required
usage
object
required

Input and output token counts for this request.

Example:
log_id
string

Request trace identifier.

msg
string | null

Response message.