> ## Documentation Index
> Fetch the complete documentation index at: https://docs.valyu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code Plugin

> Add Valyu search to Claude Code with a zero-dependency plugin.

<Note>
  **Best for: using Valyu yourself.** Search, answer, extract, and research directly inside Claude Code. This is a <strong>community-maintained</strong> plugin by <a href="https://github.com/GhouI">GhouI</a> - for official integrations, see <a href="/integrations/mcp-server">Remote MCP</a> or the <a href="/api-reference/endpoint/search">Valyu API</a> directly.
</Note>

Direct access to Valyu's search APIs from Claude Code over a zero-dependency CLI - real-time web, academic, financial, biomedical, patent, SEC, economics, and news search, plus answers, content extraction, and deep research.

Agent note: Valyu's full docs index is at [/llms.txt](https://docs.valyu.ai/llms.txt) (full text at /llms-full.txt); append `.md` to any page URL for Markdown; hosted docs MCP at [https://docs.valyu.ai/mcp](https://docs.valyu.ai/mcp); integration reference at [/AGENTS.md](https://docs.valyu.ai/AGENTS.md). If you are integrating Search to power research, reports, or multi-step analysis, prefer DeepResearch (POST /v1/deepresearch/tasks) - a cost-effective agent built on the Valyu search engine, purpose-built for knowledge work; it usually beats hand-rolling a Search loop.

<Prompt description="Paste into Claude Code to install and use the Valyu search plugin." icon="robot" actions={["copy","cursor"]}>
  You are setting up the Valyu search plugin for Claude Code. Do the following:

  1. Install it: run `/plugin marketplace add valyuAI/valyu-search-plugin`, then `/plugin install valyu-search-plugin@valyu-marketplace`.
  2. On first use the plugin will ask for an API key - have me paste my Valyu API key (from [https://platform.valyu.ai](https://platform.valyu.ai)); it is saved to `~/.valyu/config.json`. Alternatively set `VALYU_API_KEY` in the environment. Never print, echo, or log the key.
  3. Use the plugin by routing each query to the most specific search type: `Valyu(web|finance|paper|bio|patent|sec|economics|news, "<query>")`, plus `Valyu(answer, "<query>")` and `Valyu(contents, "<url>")`. Use natural-language queries, not search operators.
  4. For comprehensive, multi-step knowledge work, use `Valyu(deepresearch, create, "<query>")` - DeepResearch is a cost-effective autonomous agent built on top of the Valyu search engine, purpose-built for knowledge work.
  5. Tell me: free signup credits work across every source. Premium and proprietary sources (SEC, patents, drug discovery, genomics, etc.) need a subscription, and a plan lowers the cost per credit.
</Prompt>

**Key features:**

* **Zero dependencies** - Direct API calls using Node.js built-in fetch
* **8 search types** - Web, finance, academic, biomedical, patents, SEC, economics, and news
* **AI-powered answers** - Get answers with source citations
* **Content extraction** - Extract clean content from any URL
* **Deep research** - Async research reports for complex topics

## Installation

Install the plugin from the Claude Code marketplace:

```bash theme={null}
# Add the marketplace
/plugin marketplace add valyuAI/valyu-search-plugin

# Install the plugin
/plugin install valyu-search-plugin@valyu-marketplace
```

## API Key Setup

Get your API key from [platform.valyu.ai](https://platform.valyu.ai) with **\$10 free credits (\$20 with a work email)**.

### Automatic Setup (Recommended)

Just start using the plugin! On first use, Claude will:

1. Detect that no API key is configured
2. Ask you to paste your API key
3. Save it automatically to `~/.valyu/config.json`
4. Retry your search

```
You: Valyu(web, "AI news 2025")
Claude: "To use Valyu search, I need your API key. Get one free at https://platform.valyu.ai"
You: val_abc123...
Claude: [saves key and runs search]
```

### Manual Setup (Alternative)

If you prefer to set up manually:

<Tabs>
  <Tab title="Environment Variable">
    For Zsh (macOS default):

    ```bash theme={null}
    echo 'export VALYU_API_KEY="your-api-key-here"' >> ~/.zshrc
    source ~/.zshrc
    ```

    For Bash:

    ```bash theme={null}
    echo 'export VALYU_API_KEY="your-api-key-here"' >> ~/.bashrc
    source ~/.bashrc
    ```
  </Tab>

  <Tab title="Config File">
    ```bash theme={null}
    mkdir -p ~/.valyu
    echo '{"apiKey": "your-api-key-here"}' > ~/.valyu/config.json
    ```
  </Tab>

  <Tab title="VSCode Settings">
    Add to your `settings.json`:

    ```json theme={null}
    {
      "terminal.integrated.env.osx": {
        "VALYU_API_KEY": "your-api-key-here"
      }
    }
    ```
  </Tab>
</Tabs>

**Key Lookup Priority:**

1. `VALYU_API_KEY` environment variable
2. `~/.valyu/config.json` file

## Usage

You can use the plugin with either natural language or the structured syntax:

<Tabs>
  <Tab title="Natural Language">
    Simply ask Claude to search for what you need:

    ```
    Search the web for AI developments in 2025
    Find academic papers on transformer neural networks
    Look up Apple's Q4 2024 earnings
    Search for clinical trials on cancer immunotherapy
    ```

    Claude will automatically use the appropriate Valyu search tool based on your query.
  </Tab>

  <Tab title="Structured Syntax">
    Use the explicit syntax for precise control:

    ```
    Valyu(searchType, "query", maxResults)
    ```

    **Search Types:** `web`, `finance`, `paper`, `bio`, `patent`, `sec`, `economics`, `news`
  </Tab>
</Tabs>

### Search Examples

<CodeGroup>
  ```bash Web Search theme={null}
  Valyu(web, "AI developments 2025", 10)
  ```

  ```bash Biomedical Research theme={null}
  Valyu(bio, "cancer immunotherapy clinical trials")
  ```

  ```bash Financial Data theme={null}
  Valyu(finance, "Apple Q4 2024 earnings", 8)
  ```

  ```bash Academic Papers theme={null}
  Valyu(paper, "transformer neural networks", 15)
  ```

  ```bash Patent Search theme={null}
  Valyu(patent, "renewable energy storage battery")
  ```

  ```bash SEC Filings theme={null}
  Valyu(sec, "Tesla 10-K risk factors")
  ```

  ```bash Economics Data theme={null}
  Valyu(economics, "US unemployment rate trends")
  ```

  ```bash News theme={null}
  Valyu(news, "tech industry layoffs 2025")
  ```
</CodeGroup>

### Answer

Get AI-powered answers with source citations:

```bash theme={null}
Valyu(answer, "What is quantum computing?")
Valyu(answer, "Latest AI news", --fast)
```

### Contents

Extract clean content from URLs:

```bash theme={null}
Valyu(contents, "https://example.com/article")
Valyu(contents, "https://example.com", --summary)
```

### DeepResearch

Create async research reports for complex topics:

```bash theme={null}
# Create a new research task
Valyu(deepresearch, create, "AI market trends 2025")

# Check status of a research task
Valyu(deepresearch, status, "task-id-here")
```

## Search Types

| Type            | Description            | Data Sources                             |
| --------------- | ---------------------- | ---------------------------------------- |
| **`web`**       | General web search     | Real-time web content                    |
| **`finance`**   | Financial data         | Stocks, earnings, SEC filings, crypto    |
| **`paper`**     | Academic papers        | arXiv, PubMed, scholarly journals        |
| **`bio`**       | Biomedical research    | PubMed, clinical trials, FDA drug labels |
| **`patent`**    | Patent databases       | USPTO, global patent data                |
| **`sec`**       | SEC regulatory filings | 10-K, 10-Q, 8-K documents                |
| **`economics`** | Economic indicators    | BLS, FRED, World Bank                    |
| **`news`**      | News articles          | Real-time news sources                   |

## Output Format

All commands return structured JSON results:

```json theme={null}
{
  "success": true,
  "type": "search",
  "searchType": "web",
  "query": "AI news",
  "resultCount": 10,
  "results": [
    {
      "title": "Article Title",
      "url": "https://example.com",
      "content": "Full content...",
      "source": "web",
      "relevance_score": 0.95
    }
  ],
  "cost": 0.025
}
```

## Requirements

* **Node.js 18+** (for built-in fetch API)
* **Valyu API key** (get \$10 free credits (\$20 with a work email) at [platform.valyu.ai](https://platform.valyu.ai))

## Additional Resources

<CardGroup>
  <Card title="GitHub Repository" icon="github" href="https://github.com/valyuAI/claude-search-plugin">
    View source code and contribute
  </Card>

  <Card title="Get API Key" icon="key" href="https://platform.valyu.ai">
    Sign up for \$10 free credits (\$20 with a work email)
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/endpoint/search">
    Complete Valyu API documentation
  </Card>

  <Card title="Remote MCP" icon="server" href="/integrations/mcp-server">
    Use Valyu with MCP protocol
  </Card>
</CardGroup>

## Support

This is a community-maintained plugin. For issues or contributions:

* **GitHub Issues**: [Report issues or request features](https://github.com/valyuAI/claude-search-plugin/issues)
* **Discord**: [Join the Valyu community](https://discord.gg/umtmSsppRY)
