Haystack web search components for retrieving public X/Twitter context through the Xquik REST API.
Documentation: https://docs.xquik.com/guides/haystack
This package is maintained by Xquik as a standalone Haystack integration. It follows the haystack_integrations namespace convention and exposes read-only components under:
from haystack_integrations.components.websearch.xquik import XquikTweetSearch, XquikUserTweetsFetcherXquikTweetSearch: callsGET /x/tweets/searchand returns matching posts as HaystackDocumentobjects.XquikUserTweetsFetcher: callsGET /x/users/{id}/tweetsand returns recent public posts for a user as HaystackDocumentobjects.
Both components:
- read the API key from
XQUIK_API_KEYby default - accept
haystack.utils.Secretfor explicit API key injection - send the
x-api-keyandxquik-api-contract: 2026-04-29headers - keep
base_urlconfigurable for tests and controlled deployments - return
documents,links,has_more, andnext_cursor
Install from PyPI:
pip install xquik-haystackfrom haystack import Pipeline
from haystack.utils import Secret
from haystack_integrations.components.websearch.xquik import XquikTweetSearch
search = XquikTweetSearch(api_key=Secret.from_env_var("XQUIK_API_KEY"), top_k=10)
pipeline = Pipeline()
pipeline.add_component("x_search", search)
result = pipeline.run({"x_search": {"query": "haystack ai"}})
documents = result["x_search"]["documents"]from haystack.utils import Secret
from haystack_integrations.components.websearch.xquik import XquikUserTweetsFetcher
fetcher = XquikUserTweetsFetcher(api_key=Secret.from_env_var("XQUIK_API_KEY"))
result = fetcher.run(user_id="xquikcom", include_replies=False)
documents = result["documents"]Each tweet becomes a Haystack Document.
Document.content: tweet text, or an empty string when text is missingDocument.meta["endpoint"]: Xquik endpoint family used by the componentDocument.meta["id"]: tweet ID when presentDocument.meta["url"]: tweet URL when presentDocument.meta["created_at"]: tweet creation time when presentDocument.meta["author"]: author ID, username, display name, and verification status when presentDocument.metaalso includes available public metrics such as like, repost, reply, quote, view, and bookmark counts
This project uses Hatch for build and environment management.
pip install hatch
hatch run fmt-check
hatch run test:unit
hatch buildUnit tests mock all Xquik HTTP calls. Integration tests can be added later behind an XQUIK_API_KEY check.
The release workflow publishes to PyPI with trusted publishing when a GitHub release is published.
After a first PyPI version is published, submit a listing PR to deepset-ai/haystack-integrations as requested by the Haystack maintainers.
xquik-haystack is distributed under the terms of the Apache-2.0 license.