Loading...
Loading...
Search the web using Exa's AI-powered search API. Supports semantic search, content extraction, direct answers, and deep research with structured output.
npx skill4agent add nicolaischmid/agent-skills exa-search~/.config/exa-search/config.json{
"api_key": "your-exa-api-key-here"
}# Check config exists and is valid JSON
cat ~/.config/exa-search/config.json | jq .
# Test connection
curl -s -X POST "https://api.exa.ai/search" \
-H "x-api-key: $(jq -r .api_key ~/.config/exa-search/config.json)" \
-H "Content-Type: application/json" \
-d '{"query": "test", "numResults": 1}' | jq '.results | length'401 UnauthorizedConnection refusednullmkdir -p ~/.config/exa-search
cat > ~/.config/exa-search/config.json << 'EOF'
{
"api_key": "USER_PROVIDED_API_KEY"
}
EOF| Endpoint | Use When |
|---|---|
| Need to find web pages, research topics, or get content from multiple sources |
| Have specific URLs and need to extract their full content |
| Need a direct, concise answer to a factual question |
| Need in-depth research with structured output, multi-step analysis, or comprehensive reports |
EXA_API_KEY=$(jq -r .api_key ~/.config/exa-search/config.json)/search# Basic search
curl -s -X POST "https://api.exa.ai/search" \
-H "x-api-key: $EXA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "latest developments in AI agents",
"numResults": 10
}' | jq '.results[] | {title, url, publishedDate}'
# Search with content extraction
curl -s -X POST "https://api.exa.ai/search" \
-H "x-api-key: $EXA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "best practices for RAG systems",
"numResults": 5,
"contents": {
"text": true,
"highlights": {
"numSentences": 3,
"highlightsPerUrl": 2
},
"summary": {}
}
}' | jq '.results[] | {title, url, summary, highlights}'
# Search with date filters and domain restrictions
curl -s -X POST "https://api.exa.ai/search" \
-H "x-api-key: $EXA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "OpenAI announcements",
"numResults": 10,
"startPublishedDate": "2024-01-01T00:00:00.000Z",
"includeDomains": ["openai.com", "techcrunch.com", "theverge.com"],
"contents": {
"text": {"maxCharacters": 1000},
"summary": {}
}
}' | jq
# Search with category filter
curl -s -X POST "https://api.exa.ai/search" \
-H "x-api-key: $EXA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "transformer architecture papers",
"numResults": 10,
"category": "research paper",
"contents": {
"text": true,
"summary": {}
}
}' | jq
# Deep search for comprehensive results
curl -s -X POST "https://api.exa.ai/search" \
-H "x-api-key: $EXA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "climate change mitigation strategies",
"type": "deep",
"numResults": 20,
"contents": {
"text": true,
"summary": {}
}
}' | jqautoneuralfastdeepcompanyresearch papernewspdfgithubtweetpersonal sitefinancial reportpeople/contents# Get content from URLs
curl -s -X POST "https://api.exa.ai/contents" \
-H "x-api-key: $EXA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"urls": [
"https://arxiv.org/abs/2307.06435",
"https://example.com/article"
],
"text": true,
"summary": {},
"highlights": {
"numSentences": 2,
"highlightsPerUrl": 3
}
}' | jq '.results[] | {url, title, summary, highlights}'
# Get content with livecrawl for fresh data
curl -s -X POST "https://api.exa.ai/contents" \
-H "x-api-key: $EXA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"urls": ["https://example.com/news"],
"text": {"maxCharacters": 5000},
"livecrawl": "preferred"
}' | jqneverfallbackpreferredalways/answer# Get a direct answer
curl -s -X POST "https://api.exa.ai/answer" \
-H "x-api-key: $EXA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "What is the current population of Tokyo?"
}' | jq '{answer, citations: [.citations[] | {title, url}]}'
# Answer with full source text
curl -s -X POST "https://api.exa.ai/answer" \
-H "x-api-key: $EXA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "What are the main features of GPT-4?",
"text": true
}' | jq/research/v1# Create a research task with structured output
RESEARCH_RESPONSE=$(curl -s -X POST "https://api.exa.ai/research/v1" \
-H "x-api-key: $EXA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "exa-research",
"instructions": "Compare the top 3 cloud providers (AWS, Azure, GCP) on pricing for compute instances. Return structured data.",
"outputSchema": {
"type": "object",
"required": ["providers"],
"properties": {
"providers": {
"type": "array",
"items": {
"type": "object",
"required": ["name", "computePricing", "strengths"],
"properties": {
"name": {"type": "string"},
"computePricing": {"type": "string"},
"strengths": {"type": "array", "items": {"type": "string"}}
}
}
}
}
}
}')
RESEARCH_ID=$(echo "$RESEARCH_RESPONSE" | jq -r '.researchId')
echo "Research ID: $RESEARCH_ID"
# Poll for results (repeat until status is "completed" or "failed")
curl -s "https://api.exa.ai/research/v1/$RESEARCH_ID" \
-H "x-api-key: $EXA_API_KEY" | jq '{status, output}'
# Simple research without schema (returns markdown report)
curl -s -X POST "https://api.exa.ai/research/v1" \
-H "x-api-key: $EXA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "exa-research",
"instructions": "Summarize the latest developments in quantum computing from the past 6 months."
}' | jqexa-researchexa-research-pro| Parameter | Type | Description |
|---|---|---|
| string | The search query (required) |
| integer | Number of results (max 100, default 10) |
| string | Search type: |
| string | Filter by content type |
| array | Only include results from these domains |
| array | Exclude results from these domains |
| string | Only results published after (ISO 8601) |
| string | Only results published before (ISO 8601) |
| array | Must contain this text (max 1 string, 5 words) |
| array | Must not contain this text |
| object | Content extraction options |
| Parameter | Type | Description |
|---|---|---|
| boolean/object | Extract full page text |
| object | Extract relevant snippets |
| object | Generate page summary |
| string | Crawl freshness: |
| Field | Description |
|---|---|
| Unique request identifier |
| Array of search results |
| Document ID (use with /contents) |
| Page URL |
| Page title |
| Publication date |
| Author if available |
| Full page content (if requested) |
| Relevant snippets (if requested) |
| Page summary (if requested) |
| Request cost breakdown |