Loading...
Loading...
Call Exa Search directly with cURL or raw HTTP. Use when an agent needs Exa semantic web retrieval from POST /search without an SDK, including ranked results, domain or category filters, freshness-aware result content, highlights or text extraction, structured output, or streaming search responses.
npx skill4agent add exa-labs/agent-skills exa-searchRequires API key: Get one at https://dashboard.exa.ai/api-keysHeader:x-api-key: $EXA_API_KEY
POST https://api.exa.ai/searchtype: "auto"contentscurl -sS -X POST "https://api.exa.ai/search" \
-H "Content-Type: application/json" \
-H "x-api-key: $EXA_API_KEY" \
-d '{
"query": "latest developments in LLMs",
"type": "auto",
"numResults": 10
}'curl -sS -X POST "https://api.exa.ai/search" \
-H "Content-Type: application/json" \
-H "x-api-key: $EXA_API_KEY" \
-d '{
"query": "latest developments in LLMs",
"type": "auto",
"numResults": 5,
"contents": {
"highlights": true
}
}'curl -sS -X POST "https://api.exa.ai/search" \
-H "Content-Type: application/json" \
-H "x-api-key: $EXA_API_KEY" \
-d '{
"query": "AI regulation policy updates",
"type": "auto",
"category": "news",
"numResults": 10,
"includeDomains": ["reuters.com", "bbc.com"],
"startPublishedDate": "2025-01-01",
"contents": {
"text": {
"maxCharacters": 2000
},
"maxAgeHours": 24,
"livecrawlTimeout": 12000
}
}'curl -sS -X POST "https://api.exa.ai/search" \
-H "Content-Type: application/json" \
-H "x-api-key: $EXA_API_KEY" \
-d '{
"query": "map the major technical and commercial tradeoffs in sodium-ion batteries for grid storage",
"type": "deep",
"numResults": 8
}'POST https://api.exa.ai/searchx-api-key: <API_KEY>Authorization: Bearer <API_KEY>x-api-keyPOST /contents| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| string | Yes | - | Natural-language search query. Long, semantically rich descriptions work well. |
| string | No | | Search method: |
| integer | No | | Number of results to return. Use small values for agent loops; maximum is 100. |
| string | No | - | Specialized result type: |
| string[] | No | - | Only return results from these domains, paths, or wildcard patterns. Max 1200. |
| string[] | No | - | Exclude these domains, paths, or wildcard patterns. Max 1200. |
| string | No | - | ISO 8601 lower bound for result publication date. |
| string | No | - | ISO 8601 upper bound for result publication date. |
| string | No | - | Two-letter ISO country code such as |
| boolean | No | | Filter unsafe content from results. |
| string[] | No | - | Extra query variants for deep-search variants. Use alongside the main |
| string | No | - | Instructions for synthesized output and deep-search planning, such as source preferences. |
| object | No | - | JSON Schema controlling |
| boolean | No | | If |
| string | No | - | Enterprise-only compliance mode, such as |
contents/searchtexthighlightssummarycontents| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| boolean or object | No | - | Return full page text as markdown. Object form supports |
| boolean or object | No | - | Return query-relevant excerpts. Prefer |
| boolean or object | No | - | Return per-result LLM summaries. Use sparingly because each result adds synthesis work. |
| integer | No | - | Freshness control. |
| integer | No | | Timeout for live crawling in milliseconds. Use |
| integer | No | | Number of linked subpages to crawl per result. |
| string or string[] | No | - | Terms used to prioritize which subpages matter, such as |
| integer | No | | Number of links to extract from each result page. |
| integer | No | | Number of image URLs to extract from each result page. |
| Parameter | Type | Default | Description |
|---|---|---|---|
| integer | - | Character limit for returned text. Use this instead of |
| boolean | | Preserve HTML tags in output. |
| string | | |
| string[] | - | Only include selected sections: |
| string[] | - | Exclude selected sections from the same section list. |
contents.highlights: true| Parameter | Type | Default | Description |
|---|---|---|---|
| string | - | Custom query guiding which excerpts are returned. |
| integer | - | Cap highlight characters per URL. Omit unless the caller has a strict budget. |
| Parameter | Type | Default | Description |
|---|---|---|---|
| string | - | Custom query for the summary. |
| object | - | JSON Schema for structured per-result summaries. |
typeoutputSchema| Type | Best for | Tradeoff |
|---|---|---|
| General default search and most new integrations | Balances speed and quality without requiring the caller to tune retrieval strategy. |
| Low-latency agent loops and product paths | Faster than |
| Real-time UI, chat, voice, and autocomplete-style paths | Lowest latency path; use for quick retrieval rather than deep synthesis. |
| Lightweight research or synthesis | Adds more planning and synthesis than |
| Multi-step research, comparisons, and synthesis-heavy retrieval | Higher latency; better when the query needs exploration across several sources. |
| Hard research tasks with high ambiguity or complex tradeoffs | Highest latency and reasoning depth. |
autofastinstantdeepdeep-litedeep-reasoning{
"query": "recent product launches from major AI chip companies",
"type": "fast",
"numResults": 5
}{
"query": "compare competing explanations for the recent rise in grid-scale battery deployments",
"type": "deep",
"numResults": 8
}systemPromptoutputSchemacurl -sS -X POST "https://api.exa.ai/search" \
-H "Content-Type: application/json" \
-H "x-api-key: $EXA_API_KEY" \
-d '{
"query": "compare the latest frontier AI model releases",
"type": "deep",
"systemPrompt": "Prefer official sources and avoid duplicate results.",
"outputSchema": {
"type": "object",
"properties": {
"models": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"notable_claims": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["name", "notable_claims"]
}
}
},
"required": ["models"]
},
"contents": {
"highlights": true
}
}'output.groundingoutputSchema-NAccept: text/event-streamstream: trueoutputSchemastreamtruecurl -sS -N -X POST "https://api.exa.ai/search" \
-H "Content-Type: application/json" \
-H "Accept: text/event-stream" \
-H "x-api-key: $EXA_API_KEY" \
-d '{
"query": "recent grid-scale battery deployments",
"type": "deep",
"stream": true,
"outputSchema": {
"type": "object",
"properties": {
"summary": { "type": "string" }
},
"required": ["summary"]
},
"contents": {
"highlights": true
}
}'data:choices[0].delta.content| Field | Type | Description |
|---|---|---|
| string | Unique request identifier. |
| array | Ranked result objects. |
| string | Page title. |
| string | Page URL. |
| string or null | Estimated publication date when available. |
| string or null | Author when available. |
| string | Returned when |
| string[] | Returned when |
| number[] | Similarity scores for highlights. |
| string | Returned when |
| array | Nested result objects from subpage crawling. |
| string[] | Extracted links when requested. |
| string or object | Synthesized output when |
| array | Citations and confidence labels for synthesized fields. |
| number | Total request cost when returned. |
| number | Search latency when returned. |
texthighlightssummarycontents/searchtexthighlightssummary/contentstokensNumcontents.text.maxCharactersuseAutopromptnumSentenceshighlightsPerUrlcontents.maxAgeHourslivecrawlcompanypeopleresearch papernewspersonal sitefinancial reportcompanypeoplestartPublishedDateendPublishedDatecompanyexcludeDomainspeoplepeopleincludeDomainscontents.highlightscontents.textcontents.summarystream: trueoutputSchema/search