ParallelWebSearchTool()Parallel Search tool with web research capabilities.
This tool calls Parallel's Search API, which streamlines the traditional
search -> scrape -> extract pipeline into a single API call. It supports
natural-language objectives, keyword queries, domain filters, two modes
(basic, advanced), location targeting, and async usage.
Setup:
Install langchain-parallel and set environment variable
PARALLEL_API_KEY.
pip install -U langchain-parallel
export PARALLEL_API_KEY="your-api-key"
Key init args:
api_key: Optional[SecretStr] Parallel API key. If not provided, will be read from PARALLEL_API_KEY env var. base_url: str Base URL for Parallel API. Defaults to "https://api.parallel.ai".
Instantiation:
from langchain_parallel import ParallelWebSearchTool
tool = ParallelWebSearchTool()
Invocation:
result = tool.invoke({
"objective": "Latest developments in AI agents",
"search_queries": ["AI agents 2026", "autonomous LLM systems"],
"mode": "advanced",
"max_results": 5,
})
print(result["search_id"], len(result["results"]))
Domain and freshness filters:
from langchain_parallel import SourcePolicy
result = tool.invoke({
"search_queries": ["climate research breakthroughs"],
"source_policy": SourcePolicy(
include_domains=["nature.com", "science.org"],
after_date="2025-01-01",
),
"location": "us",
})
Async:
result = await tool.ainvoke({"search_queries": ["..."]})
Response shape:
{
"search_id": "search_abc123",
"session_id": "sess_...",
"results": [
{"url": "...", "title": "...", "publish_date": "...",
"excerpts": ["..."]},
...
],
"warnings": [...],
"usage": {...},
"search_metadata": { # added by this tool when include_metadata=True
"search_duration_seconds": 2.451,
"search_timestamp": "2026-04-27T10:30:00",
"actual_results_returned": 5,
}
}