Skip to main content
This example builds a research assistant that searches multiple related queries, deduplicates and aggregates the results, and uses deep search for thorough coverage.

Complete example

# Multi-query search with a JSON array
curl -G -s "https://search-api.andisearch.com/api/v1/search" \
  --data-urlencode 'q=["quantum computing applications", "quantum computing challenges", "quantum computing 2025"]' \
  -d "depth=deep" \
  -d "limit=10" \
  -H "x-api-key: $ANDI_API_KEY" | jq '{
    correctedQuery,
    result_count: (.results | length),
    results: [.results[] | {title, link, source}]
  }'

How it works

  1. Multiple queries — search the same topic from different angles to get broader coverage
  2. Deep searchdepth=deep enables spell correction and extended source coverage
  3. Deduplication — track URLs already seen to avoid duplicate results across queries
  4. Spell correction trackingcorrectedQuery shows when deep search fixed a typo

Using multi-query in a single request

The API also supports passing a JSON array of up to 5 queries in the q parameter:
import json

response = requests.get(
    "https://search-api.andisearch.com/api/v1/search",
    params={
        "q": json.dumps([
            "quantum computing applications",
            "quantum computing challenges",
            "quantum computing 2025",
        ]),
        "depth": "deep",
        "limit": 10,
    },
    headers={"x-api-key": api_key},
)
Multi-query via JSON array returns combined results in a single response. The sequential approach above gives you per-query control and deduplication, but uses more API calls.

Variations

With source filtering

Focus research on academic or authoritative sources:
research_data = research(
    queries=["quantum computing applications"],
    depth="deep",
    limit=20,
)

# Post-filter by domain
academic_results = [
    r for r in research_data["results"]
    if any(d in r["source"] for d in ["arxiv.org", "nature.com", "ieee.org", "acm.org"])
]
Or use includeDomains to restrict at the API level:
response = requests.get(
    "https://search-api.andisearch.com/api/v1/search",
    params={
        "q": "quantum computing",
        "depth": "deep",
        "includeDomains": "arxiv.org,nature.com,ieee.org",
    },
    headers={"x-api-key": api_key},
)

Generating a research summary

Combine results with an LLM for a synthesized report:
# Gather context from research
context_parts = []
for result in research_data["results"][:15]:
    text = result["desc"]
    if result.get("extracts"):
        text = " ".join(result["extracts"])
    context_parts.append(f"[{result['title']}]({result['link']})\n{text}")

context = "\n\n".join(context_parts)

prompt = f"""Write a research summary based on these search results.
Organize by theme. Cite sources with URLs.

{context}"""

# Send to your LLM of choice

Next steps