highlights is a strong default for retrieval workflows because it preserves the most relevant
evidence without pulling full page text into every response.
const result = await exa.search("blog post about artificial intelligence", { contents: { highlights: true, },});
const structuredResult = await exa.search("Who is the CEO of OpenAI?", { type: "deep", systemPrompt: "Prefer official sources and avoid duplicate results", outputSchema: { type: "object", properties: { leader: { type: "string" }, title: { type: "string" }, sourceCount: { type: "number" }, }, required: ["leader", "title"], }, contents: { highlights: true, },});console.log(structuredResult.output?.content);
outputSchema and systemPrompt work across all search types. Keep outputSchema focused on
output.content, and use systemPrompt to guide the final returned result. For more demanding
synthesis, prefer reasoning-focused search types like deep-lite, deep, or deep-reasoning. Do not include citations/confidence in your schema; Exa returns grounding
automatically in output.grounding. Including citation/confidence fields in outputSchema
duplicates data, reduces structure quality, and is usually less reliable.
Reasoning-focused search variants:
deep-lite: lowest-latency deep-search mode
deep: light mode
deep-reasoning: base reasoning mode
Need streaming structured synthesis? The raw /search endpoint supports stream: true together
with outputSchema and returns OpenAI-compatible SSE chunks. See the Search API
guide.
The Research API (/research/v1) is legacy and deprecated. For new integrations, use exa.search(...) with type: "deep-reasoning" and outputSchema for structured research-style output.
const result = await exa.search("Find the top 5 AI startups founded in 2024", { type: "deep-reasoning", outputSchema: { type: "object", properties: { startups: { type: "array", items: { type: "string" } }, }, }, contents: { highlights: true },});