Haystack Integration
Integrate Scavio with Haystack by deepset to give your RAG pipelines and agents real-time web search. The ScavioWebSearch component returns results as Haystack Document objects with title and URL metadata -- a cost-effective Tavily, Exa, and SerpAPI alternative.
Drop-in web search
ScavioWebSearch mirrors the built-in TavilyWebSearch and ExaWebSearch components, so it slots into existing pipelines without rewiring.Introduction
The scavio-haystack package provides ScavioWebSearch, a web search component backed by the Scavio API. Each run returns a list of Document objects plus the raw source links, ready to feed a prompt builder, retriever, or generator.
Step-by-Step Integration Guide
Step 1: Install the package
Bash
pip install scavio-haystackStep 2: Set your API key
Get a key at dashboard.scavio.dev, then expose it as the SCAVIO_API_KEY environment variable:
Bash
export SCAVIO_API_KEY=sk_live_...Step 3: Run a search
Python
from haystack_integrations.components.websearch.scavio import ScavioWebSearch
from haystack.utils import Secret
web_search = ScavioWebSearch(
api_key=Secret.from_env_var("SCAVIO_API_KEY"), # defaults to SCAVIO_API_KEY
top_k=5,
)
result = web_search.run(query="What is Haystack by deepset?")
documents = result["documents"]
links = result["links"]Use it in a RAG pipeline
Wire ScavioWebSearch into a pipeline to ground an LLM answer on live web results:
Python
from haystack import Pipeline
from haystack.components.builders import PromptBuilder
from haystack.components.generators import OpenAIGenerator
from haystack_integrations.components.websearch.scavio import ScavioWebSearch
template = """
Given the following web search results, answer the question.
Results:
{% for doc in documents %}{{ doc.content }}
{% endfor %}
Question: {{ query }}
Answer:
"""
pipe = Pipeline()
pipe.add_component("search", ScavioWebSearch(top_k=5))
pipe.add_component("prompt_builder", PromptBuilder(template=template))
pipe.add_component("llm", OpenAIGenerator(model="gpt-5.5"))
pipe.connect("search.documents", "prompt_builder.documents")
pipe.connect("prompt_builder", "llm")
query = "What is Haystack by deepset?"
result = pipe.run(data={"search": {"query": query}, "prompt_builder": {"query": query}})
print(result["llm"]["replies"][0])Async support
Use run_async inside async agents and pipelines:
Python
import asyncio
from haystack_integrations.components.websearch.scavio import ScavioWebSearch
async def main():
web_search = ScavioWebSearch(top_k=3)
result = await web_search.run_async(query="What is Haystack by deepset?")
print(f"Found {len(result['documents'])} documents")
asyncio.run(main())Parameters
| Parameter | Description |
|---|---|
api_key | Scavio API key. Defaults to the SCAVIO_API_KEY environment variable. |
top_k | Maximum number of results to return. Defaults to 10. |
search_params | Extra parameters for the Scavio Google endpoint -- country_code, language, page, search_type, device, nfpr, light_request. Set at init or overridden per run. |
Benefits of Scavio + Haystack
- Native Documents: results arrive as Haystack
Documentobjects, ready for retrievers and rankers. - Drop-in: same shape as
TavilyWebSearchandExaWebSearch. - Async-ready:
run_asyncfor high-throughput agents. - Cost-effective: most calls cost a single credit.
Next Steps
- Google Search API -- endpoint reference and parameters
- Python SDK -- the client that powers this component
- MCP Integration -- the full tool catalog