curl --request POST \
--url https://api.langsearch.com/v1/web-search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "AI search APIs",
"count": 10,
"contents": {
"text": true
}
}
'{
"code": 200,
"log_id": "example-request-id",
"msg": null,
"data": {
"_type": "SearchResponse",
"queryContext": {
"originalQuery": "LangSearch Web Search API"
},
"webPages": {
"webSearchUrl": "https://langsearch.com/search?q=LangSearch+Web+Search+API",
"value": [
{
"id": "result-0",
"name": "LangSearch",
"url": "https://langsearch.com",
"displayUrl": "langsearch.com",
"datePublished": null,
"text": "Free Web Search API for AI agents. The World Engine for AGI."
}
]
}
},
"usage": {
"input_tokens": 5,
"output_tokens": 15
}
}Web Search
Retrieve web results with source URLs and context for your AI application.
curl --request POST \
--url https://api.langsearch.com/v1/web-search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "AI search APIs",
"count": 10,
"contents": {
"text": true
}
}
'{
"code": 200,
"log_id": "example-request-id",
"msg": null,
"data": {
"_type": "SearchResponse",
"queryContext": {
"originalQuery": "LangSearch Web Search API"
},
"webPages": {
"webSearchUrl": "https://langsearch.com/search?q=LangSearch+Web+Search+API",
"value": [
{
"id": "result-0",
"name": "LangSearch",
"url": "https://langsearch.com",
"displayUrl": "langsearch.com",
"datePublished": null,
"text": "Free Web Search API for AI agents. The World Engine for AGI."
}
]
}
},
"usage": {
"input_tokens": 5,
"output_tokens": 15
}
}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.Authorizations
Your LangSearch API key.
Body
A non-empty natural-language search query.
1"How does a search API help an AI agent?"
Maximum results requested. Use 1–50. Values below 1 are normalized to 1; values above 50 are rejected.
x <= 50Date 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.
^(noLimit|oneDay|oneWeek|oneMonth|oneYear|[0-9]{4}-[0-9]{2}-[0-9]{2}(\.\.[0-9]{4}-[0-9]{2}-[0-9]{2})?)$"2026-09-01..2026-09-13"
Restrict results to these domains. Omit or use an empty array for no inclusion filter.
1["langsearch.com", "openai.com"]
Exclude results from these domains. Omit or use an empty array for no exclusion filter.
1["reddit.com"]
Choose whether to retrieve full webpage text.
Show child attributes
Show child attributes
Response
Search succeeded. Example content illustrates the response shape.

