langchain-webz
Search global news with Webz.io from Python - in natural language, with the most relevant articles first.
Webz.io News Search covers news and current events from sources worldwide. Ask a question in plain language, narrow results with filters (language, country, date, sentiment, domain, ticker, and more), and get back focused article excerpts with titles, URLs, and metadata.
Use this package on its own, or plug it into LangChain / LangGraph agents.
What you get
- Natural-language search - no keyword hacking. Example:
"EU AI Act enforcement updates"or"How is Tesla stock reacting to earnings?" - Worldwide coverage - semantic search over Webz.io's global news index.
- Rich filters - language, country, days, sentiment, domain, ticker, person, organization, topic, and more. See the MCP tool reference.
- Live schema - filters are loaded from the hosted MCP server (
tools/list). New Webz filters appear automatically, without republishing this package.
Install
pip install langchain-webz
export WEBZ_API_TOKEN="your-webz-api-token"
Get a token from your Webz.io dashboard (same token as the News Search API).
Full setup and client options: MCP Server docs.
Direct search (no agent required)
from langchain_webz import WebzNewsSearch
tool = WebzNewsSearch() # reads WEBZ_API_TOKEN from the environment
# tool = WebzNewsSearch(api_token="your-webz-api-token")
print(tool.invoke({
"query": "recent developments on EU AI regulation",
"k": 10,
"days": 30,
}))
Filtered search
from langchain_webz import WebzNewsSearch
tool = WebzNewsSearch()
# language, country, and date window
print(tool.invoke({
"query": "trade agreements between USA and Germany",
"k": 10,
"days": 7,
"language": ["english"],
"country": ["US", "GR"],
}))
# ticker and trusted publishers
print(tool.invoke({
"query": "earnings guidance and analyst reactions",
"ticker": ["NVDA"],
"domain": ["yahoo.com", "cnn.com"],
"k": 5,
}))
To see every filter your connection supports:
print(sorted(WebzNewsSearch().args))
With a LangChain / LangGraph agent
from langchain.agents import create_agent
from langchain_webz import get_webz_tools
tools = get_webz_tools()
agent = create_agent("openai:gpt-4.1-mini", tools)
result = agent.invoke({
"messages": [{
"role": "user",
"content": (
"Search Webz news for renewable energy investments "
"from the past 30 days and summarize with sources."
),
}]
})
print(result["messages"][-1].content)
Async helpers (when you already run inside an event loop):
from langchain_webz import aget_webz_tools, awebz_news_search
tools = await aget_webz_tools()
tool = await awebz_news_search()
How it works
This package connects to the hosted Webz News Search MCP server at https://news-search-mcp.webz.io/mcp. Each call runs a regular News Search API request with your token (same credits and rate limits). It does not hardcode filter fields - the tool schema comes from the live server.
Configuration
| Name | Default | Purpose |
|---|---|---|
WEBZ_API_TOKEN |
required | Webz API token from the dashboard |
WEBZ_MCP_URL |
https://news-search-mcp.webz.io/mcp |
Override for local MCP testing |
You can also pass api_token= and mcp_url= to the helpers.
Links
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_webz-0.1.1.tar.gz.
File metadata
- Download URL: langchain_webz-0.1.1.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e48560624f8748c407a7b9fc44038b281b6d8030331abbfb3d55204f0f2a791a
|
|
| MD5 |
b201fde6850ad29dd248bd864464471a
|
|
| BLAKE2b-256 |
329407d43e8687198ed35e5f88386438e6873eb0b5ffbbd497693d023248def5
|
File details
Details for the file langchain_webz-0.1.1-py3-none-any.whl.
File metadata
- Download URL: langchain_webz-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2ff8f8c3a4b72ad22bc8916cb1b34cd81d2caf68d86e37a0a5412300757da71
|
|
| MD5 |
f462521453ebaa1beba7eb70a1ab0bde
|
|
| BLAKE2b-256 |
c19768b355f4c32502fd70d934b6a0f09c272317e1644235b38200b9d80d09c3
|