Neural Search API
Exa-compatible semantic search, similar content discovery, and key passage extraction.
Neural Search API
Semantic search that finds conceptually similar content. Exa-compatible endpoints for drop-in replacement.
Neural Search
POST /api/v1/neural/search
Find content based on meaning, not just keywords. Supports autoprompt expansion for better results.
Body Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
query | string | required | Search query |
num_results | integer | 10 | Results to return (1-50) |
use_autoprompt | boolean | true | Auto-expand query for better results |
include_highlights | boolean | false | Extract key passages |
include_domains | string[] | — | Only search these domains |
exclude_domains | string[] | — | Exclude these domains |
start_published_date | string | — | Filter by publish date (ISO 8601) |
end_published_date | string | — | Filter by publish date (ISO 8601) |
category | string | — | "general", "news", "academic", "tech", "finance" |
Example Request
curl -X POST 'https://api.unsearch.dev/api/v1/neural/search' \
-H 'X-API-Key: sk_live_xxxxx' \
-H 'Content-Type: application/json' \
-d '{
"query": "Companies building autonomous AI agents",
"num_results": 10,
"category": "tech",
"use_autoprompt": true,
"include_highlights": true
}'Response
{
"query": "Companies building autonomous AI agents",
"expanded_queries": [
"autonomous AI agent startups 2025",
"enterprise AI agent companies"
],
"results": [
{
"title": "AI Agent Startups 2025",
"url": "https://example.com/ai-agents",
"content": "A comprehensive list of companies...",
"score": 0.95,
"published_date": "2025-01-15",
"author": "Tech Reporter",
"highlights": [
"Cognition Labs raised $175M for their autonomous coding agent Devin",
"Adept AI focuses on building agents that interact with software"
]
}
],
"autoprompt_used": true,
"search_type": "neural",
"response_time_ms": 450
}Find Similar
POST /api/v1/neural/similar
Find content similar to a given URL or text.
Body Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
url | string | — | URL to find similar content for |
text | string | — | Text to find similar content for |
num_results | integer | 10 | Results to return (1-50) |
exclude_source | boolean | true | Exclude the source URL from results |
Provide either url or text, not both.
Example Request
curl -X POST 'https://api.unsearch.dev/api/v1/neural/similar' \
-H 'X-API-Key: sk_live_xxxxx' \
-H 'Content-Type: application/json' \
-d '{
"url": "https://arxiv.org/abs/2301.01234",
"num_results": 5
}'Response
{
"source": "https://arxiv.org/abs/2301.01234",
"similar": [
{
"title": "Related Research Paper",
"url": "https://arxiv.org/abs/2302.05678",
"content": "...",
"score": 0.89,
"published_date": "2025-02-10"
}
],
"response_time_ms": 320
}Extract Highlights
POST /api/v1/neural/highlights
Extract the most relevant passages from content for a given query.
Body Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
query | string | required | Query to find relevant passages for |
content | string | required | Content to extract highlights from |
num_highlights | integer | 3 | Number of highlights (1-10) |
Response
{
"query": "transformer self-attention",
"highlights": [
{
"text": "Self-attention allows each position in the sequence to attend to all other positions...",
"relevance": 0.95,
"start_index": 1234
}
]
}Predictive Search
POST /api/v1/neural/predictive
Predict next searches based on context and recent queries.
Body Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
context | string | — | Current context or topic |
recent_searches | string[] | — | Recent search queries |
num_predictions | integer | 5 | Predictions to generate (1-10) |
Response
{
"predictions": [
{
"query": "transformer vs LSTM performance comparison",
"confidence": 0.87,
"reason": "Follow-up to recent transformer architecture queries"
}
],
"context_used": true
}Categories
GET /api/v1/neural/categories
List available search categories.
{
"categories": ["general", "news", "academic", "tech", "finance"]
}