webz-haystack
Search global news from Haystack with Webz.io News Search.
WebzWebSearch is a Haystack component. It returns one Document per article: the matching excerpt is content, and the title, URL, publish time, source, and entities are in meta. Coverage is the last 30 days.
Install
pip install webz-haystack
export WEBZ_API_TOKEN="your-webz-api-token"
Get a token from your Webz.io dashboard. It is the same token as the News Search API.
Pipeline
from haystack import Pipeline
from haystack_integrations.components.websearch.webz import WebzWebSearch
pipeline = Pipeline()
pipeline.add_component(
"news",
WebzWebSearch(top_k=5, days=7, language=["english"], country=["US"]),
)
result = pipeline.run({"news": {"query": "recent developments on EU AI regulation"}})
for document in result["news"]["documents"]:
print(document.meta["title"])
print(document.meta["url"])
print(document.content)
WebzWebSearch() reads WEBZ_API_TOKEN. To pass the token in code, use a Haystack Secret:
from haystack.utils import Secret
from haystack_integrations.components.websearch.webz import WebzWebSearch
news = WebzWebSearch(api_key=Secret.from_token("your-webz-api-token"), top_k=5)
result = news.run(query="renewable energy investments", domain=["reuters.com"])
The same inputs are available on run() and override the values from __init__.
Filters
| Input | Sent as |
|---|---|
top_k |
k |
language |
filters.language |
country |
filters.country |
domain |
filters.domain |
days |
filters.published_from (YYYY-MM-DD, UTC, today minus N days) |
score_gte, score_lte |
top-level score bounds, 0-10 |
The API has no days field. A bare string is accepted for the list filters: language="english" becomes ["english"].
Token and endpoint
The component calls POST https://api.webz.io/api/news/context and sends the token as a bearer header. api_url or WEBZ_NEWS_SEARCH_URL can replace that endpoint. A URL that is not HTTPS is rejected before the token is sent.
Coverage
The News Search index is the last 30 days. Leave days unset to search that whole window, or set days to narrow it. See the News Search API.
Metadata
Release files for webz-haystack 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| webz_haystack-0.1.0.tar.gz | 9.0 kB | Without provenance | Details for webz_haystack-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| webz_haystack-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for webz_haystack-0.1.0-py3-none-any.whl |
Total release size: 15.9 kB
Release files / webz_haystack-0.1.0.tar.gz
| Download URL | webz_haystack-0.1.0.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
76de45b83eb5da36d7e902741fa618ca192224764f22126c52d58a019019a5cd
|
|
BLAKE2b-256 checksum How to use checksums |
fb696eb4a4a3f8482ea74b52fddcb1fc1961502472a40ee37c4c74fc03163fc1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.0
|
Release files / webz_haystack-0.1.0-py3-none-any.whl
| Download URL | webz_haystack-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a425d716f79ccd435d522e65234df9ad59e599dcbb946c6e9093aaacbc904258
|
|
BLAKE2b-256 checksum How to use checksums |
26cf8c3acbdd88826948066c5ae77193a43dcf1520a893243cef3b7bf2278547
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.0
|
Security for webz-haystack 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.