> ## 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.

# Fast search

> Default search mode optimized for speed, returning results in ~1 second.

Fast search is the default mode. It returns results in approximately 1 second, making it suitable for real-time applications and high-volume workloads.

<CodeGroup>
  ```bash curl theme={null}
  curl "https://search-api.andisearch.com/api/v1/search?q=latest+AI+news" \
    -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": "latest AI news"},
      headers={"x-api-key": "YOUR_API_KEY"}
  )

  data = response.json()
  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=latest+AI+news",
    { headers: { "x-api-key": "YOUR_API_KEY" } }
  );

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

Fast search is the default — no `depth` parameter is needed. Setting `depth=fast` explicitly has the same effect.

## When to use fast search

* Real-time search in user-facing applications
* High-volume automated queries
* AI agents that need quick answers
* Applications where latency matters more than exhaustive coverage

## Example response

```json theme={null}
{
  "results_type": "news",
  "answer": "",
  "type": "news",
  "title": "latest AI news",
  "results": [
    {
      "title": "Latest AI News and Developments",
      "link": "https://example.com/ai-news",
      "desc": "A roundup of the latest developments in artificial intelligence...",
      "source": "example.com",
      "type": "news"
    }
  ],
  "metrics": {
    "query": "latest AI news",
    "intent": "LatestNewsIntent",
    "duration": 890,
    "results_returned": 10,
    "total_results_found": 50
  }
}
```

### Parsing the response

```python theme={null}
data = response.json()

# Check what type of results came back
print(data["results_type"])  # e.g., "news", "search", "images"

# Access results
for result in data["results"]:
    print(result["title"], result["link"])

# Check performance
print(f"Returned {data['metrics']['results_returned']} results in {data['metrics']['duration']}ms")
```

<Accordion title="Adding extracts and metadata">
  Get richer data from each result:

  ```bash theme={null}
  # Text extracts from result pages
  curl "https://search-api.andisearch.com/api/v1/search?q=latest+AI+news&extracts=true" \
    -H "x-api-key: YOUR_API_KEY"

  # Full metadata including content type and reader data
  curl "https://search-api.andisearch.com/api/v1/search?q=latest+AI+news&metadata=full" \
    -H "x-api-key: YOUR_API_KEY"

  # Markdown format for passing to LLMs
  curl "https://search-api.andisearch.com/api/v1/search?q=latest+AI+news&format=context" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  <Warning>
    `metadata=full` adds latency because it fetches additional data from each result page. Use `metadata=basic` (the default) unless you need `contentType` or `reader` data.
  </Warning>
</Accordion>

## Fast search vs. deep search

|                  | Fast search  | Deep search     |
| ---------------- | ------------ | --------------- |
| Response time    | \~1 second   | \~2–3 seconds   |
| Spell correction | No           | Yes             |
| Topic coverage   | Single angle | Multiple angles |
| Result quality   | Good         | Thorough        |

<Tip>
  Start with fast search. Switch to deep search when you need results a quick search might miss, or when thoroughness matters more than speed.
</Tip>

## Next steps

<CardGroup cols={2}>
  <Card title="Deep search" icon="microscope" href="/search/deep-search">
    Enhanced search with spell correction and more sources.
  </Card>

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

  <Card title="Basic search example" icon="code" href="/examples/basic-search">
    Complete integration with error handling.
  </Card>

  <Card title="Response format" icon="brackets-curly" href="/features/response-format">
    Understand the response structure.
  </Card>
</CardGroup>
