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

# Deep search

> Searches your topic from multiple angles to find higher-quality results, with spell correction, in ~2–3 seconds.

Deep search explores your topic from multiple angles to find results that a single quick search might miss. It keeps searching until it finds strong, relevant matches — then corrects any typos in your query. Responses take approximately 2–3 seconds.

Enable deep search by setting `depth=deep`:

<CodeGroup>
  ```bash curl theme={null}
  curl "https://search-api.andisearch.com/api/v1/search?q=quantm+computing+applications&depth=deep" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://search-api.andisearch.com/api/v1/search",
      params={"q": "quantm computing applications", "depth": "deep"},
      headers={"x-api-key": "YOUR_API_KEY"}
  )

  data = response.json()

  # Check if the query was spell-corrected
  if data.get("correctedQuery"):
      print(f"Corrected: {data['correctedQuery']}")

  for result in data["results"]:
      print(f"{result['title']} — {result['source']}")
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://search-api.andisearch.com/api/v1/search?q=quantm+computing+applications&depth=deep",
    { headers: { "x-api-key": "YOUR_API_KEY" } }
  );

  const data = await response.json();

  if (data.correctedQuery) {
    console.log(`Corrected: ${data.correctedQuery}`);
  }

  data.results.forEach(r => console.log(`${r.title} — ${r.source}`));
  ```
</CodeGroup>

<Note>
  The example query intentionally misspells "quantum" — deep search corrects it automatically.
</Note>

## What deep search adds

* **Thorough coverage** — finds results across multiple angles of your topic, covering sources a single search might miss
* **Higher quality results** — keeps searching until it finds strong, relevant matches
* **Spell correction** — fixes typos and misspellings in the query

## When to use deep search

* You need results a quick search might miss — niche topics, multi-faceted queries, or less obvious sources
* Thoroughness matters more than speed
* Queries come from user input that may contain typos
* You want the highest quality results and can accept a 2–3 second response

## Example response

```json theme={null}
{
  "results_type": "search",
  "answer": "",
  "type": "search",
  "title": "quantum computing applications",
  "results": [
    {
      "title": "Quantum Computing: Current Applications and Future Potential",
      "link": "https://example.com/quantum-applications",
      "desc": "Quantum computing is being applied in cryptography, drug discovery, and optimization problems...",
      "source": "example.com",
      "type": "website"
    }
  ],
  "correctedQuery": "quantum computing applications",
  "metrics": {
    "query": "quantum computing applications",
    "intent": "FallbackSearchIntent",
    "duration": 2340,
    "results_returned": 10,
    "total_results_found": 85
  }
}
```

### Handling corrected queries

The `correctedQuery` field appears only when deep search detects and fixes a misspelling. Use it to show users what query was actually searched:

```python theme={null}
data = response.json()
if data.get("correctedQuery"):
    print(f"Showing results for: {data['correctedQuery']}")
```

<Note>
  `correctedQuery` is only present on deep search responses where a correction was made. Fast search does not perform spell correction.
</Note>

<Accordion title="Adding extracts and metadata">
  Combine deep search with richer output options:

  ```bash theme={null}
  # Deep search with text extracts
  curl "https://search-api.andisearch.com/api/v1/search?q=quantum+computing&depth=deep&extracts=true" \
    -H "x-api-key: YOUR_API_KEY"

  # Deep search with full metadata
  curl "https://search-api.andisearch.com/api/v1/search?q=quantum+computing&depth=deep&metadata=full" \
    -H "x-api-key: YOUR_API_KEY"

  # Deep search as LLM context
  curl "https://search-api.andisearch.com/api/v1/search?q=quantum+computing&depth=deep&format=context" \
    -H "x-api-key: YOUR_API_KEY"
  ```
</Accordion>

## Next steps

<CardGroup cols={2}>
  <Card title="Fast search" icon="bolt" href="/search/fast-search">
    Default mode for real-time applications.
  </Card>

  <Card title="Response format" icon="brackets-curly" href="/features/response-format">
    Response structure and result types.
  </Card>

  <Card title="Research assistant" icon="book-open" href="/examples/research-assistant">
    Multi-query search with result aggregation.
  </Card>

  <Card title="Query parameters" icon="sliders" href="/features/query-parameters">
    Full parameter reference.
  </Card>
</CardGroup>
