# exa > Exa CLI tool for intelligent web search, content extraction, and code context retrieval. - Author: 9bingyin - Repository: 9bingyin/skills - Version: 20260123051502 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/9bingyin/skills - Web: https://mule.run/skillshub/@@9bingyin/skills~exa:20260123051502 --- --- name: exa description: "Exa CLI tool for intelligent web search, content extraction, and code context retrieval." --- # Exa CLI Exa is a search engine built from the ground up for AIs. This tool provides a zero-dependency Python CLI to access Exa's powerful search, content, and code context capabilities. ## Usage ### 1. Search Intelligently search the web and extract contents. Exa automatically chooses the best search method using an embeddings-based model. **Command:** ```bash python3 scripts/exa_cli.py search "QUERY" [OPTIONS] ``` **Core Options:** - `query` (required): The search query string. - `--num-results `: Number of results (1-100). Default: 10. - `--type `: - `neural`: Semantic search using embeddings. - `auto` (default): Intelligently combines neural and other search methods. - `fast`: Streamlined version of search models for speed. - `deep`: Comprehensive search with query expansion and detailed context. - `--additional-queries `: Additional query variations for `deep` search. **Filtering Options:** - `--category `: Focus on data categories: `company`, `research paper`, `news`, `pdf`, `github`, `tweet`, `personal site`, `financial report`, `people`. - `--include-domains `: Only include results from these domains. - `--exclude-domains `: Exclude results from these domains. - `--user-location `: Two-letter ISO country code (e.g., `US`). - `--start-crawl-date ` / `--end-crawl-date `: Filter by when Exa discovered the link. - `--start-published-date ` / `--end-published-date `: Filter by publication date. - `--include-text `: Strings that *must* be present in the webpage text (max 5 words). - `--exclude-text `: Strings that *must not* be present in the text. - `--moderation`: Enable content moderation. **Content Options:** - `--text`: Return full page text. - `--summary`: Return AI-generated page summary. - `--highlights`: Return relevant text highlights identified by LLM. **Example:** ```bash python3 scripts/exa_cli.py search "latest LLM research" --category "research paper" --num-results 5 --summary --start-published-date "2024-01-01T00:00:00.000Z" ``` ### 2. Contents Get full page contents, summaries, and metadata for specific URLs. Returns instant results from cache with automatic live crawling as fallback. **Command:** ```bash python3 scripts/exa_cli.py contents URL [URL...] [OPTIONS] ``` **Core Options:** - `urls` (required): List of URLs to retrieve. - `--livecrawl `: - `never`: Disable livecrawling (cache only). - `fallback` (default): Livecrawl when cache is empty. - `preferred`: Always try to livecrawl, fall back to cache if it fails. - `always`: Always live-crawl, never use cache. - `--livecrawl-timeout `: Timeout for livecrawling in milliseconds. - `--subpages `: Number of subpages to crawl. - `--subpage-target `: Terms to find specific subpages (e.g., `pricing`). **Content Options:** - `--text`: Return full page text. - `--summary`: Return page summary. - `--highlights`: Return relevant highlights from the page. **Example:** ```bash python3 scripts/exa_cli.py contents "https://exa.ai/blog/exa-code" --text --livecrawl preferred --subpages 1 ``` ### 3. Context (Exa Code) Get relevant code snippets and examples from open source libraries and repositories. Searches billions of GitHub repos and docs to find token-efficient context for coding. **Command:** ```bash python3 scripts/exa_cli.py context "QUERY" [OPTIONS] ``` **Options:** - `query` (required): Search query to find relevant code snippets (e.g., "how to use react hooks"). - `--tokens `: Token limit for response. `dynamic` (default) determines optimal length. Specific values (e.g., 5000) allow precise control. **Example:** ```bash python3 scripts/exa_cli.py context "React hooks for state management" --tokens 5000 ``` ## Pricing **COST OPTIMIZATION:** Always strive to minimize costs. Avoid adding unnecessary search parameters (like `--text` or `--summary`) or requesting more results than strictly needed (keep `--num-results` low unless necessary). Costs depend on search type, number of results, and content extraction. ### 1. Search Costs Base cost per request based on `--type` and `--num-results`: | Type | Results | Cost | | --- | --- | --- | | Neural/Auto/Fast | 1-25 | $0.005 | | Neural/Auto/Fast | 26-100 | $0.025 | | Neural/Auto/Fast | 100+ | $1.00 | | Deep | 1-25 | $0.015 | | Deep | 26-100 | $0.075 | **Content Extractions:** Adding `--text`, `--summary`, or `--highlights` incurs extra "Contents" costs (see below). ### 2. Contents Costs Charged per 1,000 tokens (approx. 1 "page") of processed content. | Feature | Cost per 1k Tokens | | --- | --- | | Text (`--text`) | $0.001 | | Highlights (`--highlights`) | $0.001 | | Summary (`--summary`) | $0.001 | ### 3. Context (Code) Costs - **Search Fee:** ~$0.005 per request - **Content Fee:** $1.00 per 1M tokens (approx $0.001 per 1k tokens) based on returned length. *Tip: Check the `costDollars` field in the API response for exact usage.* ## Help ```bash python3 scripts/exa_cli.py --help python3 scripts/exa_cli.py --help ```