Haystack web search components for Xquik public X data
Project description
Xquik Haystack
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, XquikUserTweetsFetcher
Components
XquikTweetSearch: 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
Installation
Install from PyPI:
pip install xquik-haystack
Usage
Tweet Search
from 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"]
User Tweets
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"]
Document Mapping
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
Development
This project uses Hatch for build and environment management.
pip install hatch
hatch run fmt-check
hatch run test:unit
hatch build
Unit tests mock all Xquik HTTP calls. Integration tests can be added later behind an XQUIK_API_KEY check.
Publishing
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.
License
xquik-haystack is distributed under the terms of the Apache-2.0 license.
Project details
Release history Release notifications | RSS feed
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 xquik_haystack-0.1.0.tar.gz.
File metadata
- Download URL: xquik_haystack-0.1.0.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ada309f4865a44e6e7edbdf45e3441e07403a7015d40eb5ae3f0459667e4683c
|
|
| MD5 |
8fee2f30376da50ade93c1c832a5e6c0
|
|
| BLAKE2b-256 |
1109f9d266a1807af0ff68df84324b761d41bc65aff016f314c0013f2348b594
|
Provenance
The following attestation bundles were made for xquik_haystack-0.1.0.tar.gz:
Publisher:
release.yml on Xquik-dev/xquik-haystack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xquik_haystack-0.1.0.tar.gz -
Subject digest:
ada309f4865a44e6e7edbdf45e3441e07403a7015d40eb5ae3f0459667e4683c - Sigstore transparency entry: 1547240219
- Sigstore integration time:
-
Permalink:
Xquik-dev/xquik-haystack@53c43539937b4a65ae3366ec9ce1b8f483723f25 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Xquik-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@53c43539937b4a65ae3366ec9ce1b8f483723f25 -
Trigger Event:
release
-
Statement type:
File details
Details for the file xquik_haystack-0.1.0-py3-none-any.whl.
File metadata
- Download URL: xquik_haystack-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e25a1a6a7b4e6e92fadc431c89e2a3334d6f7e94e0c2f9a689add44116f90510
|
|
| MD5 |
ebe198818c9abfcd019ed64295a80f71
|
|
| BLAKE2b-256 |
6aede2525ac1a68f112db806412f60721bd62df4e55a9bd9df006c6a6231734c
|
Provenance
The following attestation bundles were made for xquik_haystack-0.1.0-py3-none-any.whl:
Publisher:
release.yml on Xquik-dev/xquik-haystack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xquik_haystack-0.1.0-py3-none-any.whl -
Subject digest:
e25a1a6a7b4e6e92fadc431c89e2a3334d6f7e94e0c2f9a689add44116f90510 - Sigstore transparency entry: 1547240259
- Sigstore integration time:
-
Permalink:
Xquik-dev/xquik-haystack@53c43539937b4a65ae3366ec9ce1b8f483723f25 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Xquik-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@53c43539937b4a65ae3366ec9ce1b8f483723f25 -
Trigger Event:
release
-
Statement type: