Exa Search Skill
Use this skill whenever you need live-ish web search results, filtered link discovery, or cached page contents via the Exa Search API.
Setup
- •Export your Exa API key.
bash
export EXA_API_KEY="sk-your-key"
- •(Optional) override the base URL via
EXA_API_BASE(defaults tohttps://api.exa.ai).
No third-party dependencies are required; the helper script only uses Python's standard library.
Usage
The helper supports both /search and /contents:
bash
# Search (default command) ./scripts/search.py --query "latest AI news" --type fast --num-results 5 ./scripts/search.py search --query "vector database benchmark" --include-domain arxiv.org --text ./scripts/search.py search --query "China CRM market" --start-published-date 2024-01-01 --end-published-date 2024-12-31 --table-limit 3 --raw out.json ./scripts/search.py search --query "best langgraph tutorials" --highlights 2 "key steps" --text # Get contents for known URLs or IDs echo 'https://docs.exa.ai/reference/search' | \ xargs ./scripts/search.py contents --url --text --highlights 2 ./scripts/search.py contents --url https://exa.ai/blog --text --text-max-chars 2000 ./scripts/search.py contents --id https://docs.exa.ai/reference/search \ --summary-query "Key takeaways" --table-limit 1 ./scripts/search.py contents --url https://exa.ai \ --summary-schema examples/schema-company.json --text
Key search flags:
- •
--type:auto(default),fast,neural,deep. - •
--num-results: up to 100 (subject to plan/type limits). - •
--include-domain/--exclude-domain: repeatable filters. - •Date filters:
--start-published-date,--end-published-date,--start-crawl-date,--end-crawl-date. - •
--category: focus onnews,research paper,github,people, etc. - •Content extraction:
--textfor cached body,--highlights [numSentences query]for snippets. - •Output:
--table-limit Ncontrols stdout preview,--raw file.jsonsaves full API response.
Key contents flags:
- •Targets: provide one or more
--urlor--id(IDs come from previous search results). - •
--text,--text-max-chars,--text-include-htmlfor body retrieval. - •
--highlights [numSentences query],--highlights-per-urlfor excerpt control. - •
--summary-queryor--summary-schema <file>for free-form or structured summaries. - •
--livecrawlcontrols freshness (never,fallback,preferred,always).
Workflow
- •Search: craft the query, tune filters, choose search type.
- •Inspect: review terminal output or saved JSON; note interesting result IDs/URLs.
- •Contents: pass those IDs/URLs to the
contentssubcommand to retrieve full text, highlights, or summaries. - •Iterate: adjust highlights, livecrawl, or summary schema depending on downstream consumption (RAG, dashboards, etc.).
Reference
- •Search reference: https://docs.exa.ai/reference/search
- •Contents reference: https://docs.exa.ai/reference/get-contents
- •Quickstart / SDK examples: https://docs.exa.ai/reference/quickstart
Troubleshooting
- •
401 Unauthorized: ensureEXA_API_KEYis set and valid. - •Empty results: broaden query, remove restrictive filters, or try
--type neural/deep. - •Slow responses: prefer cached content (
--text), avoid live crawl when possible. - •Contents call errors: confirm each URL/ID exists and is crawlable; try
--livecrawl fallbackfor stale links.