Twitter search & user timeline components for Haystack
Search Twitter and fetch public user timelines in Haystack RAG pipelines.
Each Xquik result becomes a Haystack Document.
Read the Xquik Haystack guide.
Components
| Task | Haystack Component | Xquik Route | Output |
|---|---|---|---|
| Search tweets for RAG | XquikTweetSearch |
GET /x/tweets/search |
Matching posts as Document objects |
| Retrieve a user's timeline | XquikUserTweetsFetcher |
GET /x/users/{id}/tweets |
Recent user posts as Document objects |
Import both read-only components from the Haystack integration namespace.
from haystack_integrations.components.websearch.xquik import XquikTweetSearch, XquikUserTweetsFetcher
Both components read XQUIK_API_KEY by default and accept a Haystack Secret.
They send x-api-key and xquik-api-contract: 2026-04-29 headers.
Set base_url for another Xquik-compatible endpoint. Results include documents, links,
has_more, and next_cursor.
Use an Xquik SDK for follower exports or posting.
Install
pip install xquik-haystack
Build a Haystack RAG pipeline with Twitter search
Search posts
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"]
Fetch user posts
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="example_user", include_replies=False)
documents = result["documents"]
Document mapping
Each tweet becomes a Haystack Document with this mapping.
Document.content: tweet text, or an empty string when text is missingDocument.meta["endpoint"]: Xquik endpoint family used by the componentDocument.meta: availableid,url, andcreated_atsource valuesDocument.meta["author"]: available author identity and verification dataDocument.meta: available like, repost, reply, quote, view & bookmark counts
Development
Use Hatch for builds and environment management.
pip install hatch==1.18.0
hatch run fmt-check
hatch run test:unit
hatch build
Unit tests mock all Xquik HTTP calls.
Support & project policies
License
xquik-haystack is distributed under the terms of the Apache-2.0 license.
Xquik is an independent third-party service. Not affiliated with X Corp. "Twitter" and "X" are trademarks of X Corp.
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.5.tar.gz.
File metadata
- Download URL: xquik_haystack-0.1.5.tar.gz
- Upload date:
- Size: 20.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b83bd3cc1475f51bbad3360f5b7db3488c8e6bee0e5a4124d5b2f054d1f3a8a2
|
|
| MD5 |
c83c72cb06dbbc57e13fb6127d308d18
|
|
| BLAKE2b-256 |
2486a578a40c46c57cbf0ffd29cae1001bfaef52ba343df72ceff43e1096d158
|
Provenance
The following attestation bundles were made for xquik_haystack-0.1.5.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.5.tar.gz -
Subject digest:
b83bd3cc1475f51bbad3360f5b7db3488c8e6bee0e5a4124d5b2f054d1f3a8a2 - Sigstore transparency entry: 2541057726
- Sigstore integration time:
-
Permalink:
Xquik-dev/xquik-haystack@0ff821090fc4a8fa0e46c975e8c6bba66a74ed91 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/Xquik-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0ff821090fc4a8fa0e46c975e8c6bba66a74ed91 -
Trigger Event:
release
-
Statement type:
File details
Details for the file xquik_haystack-0.1.5-py3-none-any.whl.
File metadata
- Download URL: xquik_haystack-0.1.5-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a09256f3bbbd05f2cf46ae857d73694699590ae6e681bd4aac6647bf6cb8e20d
|
|
| MD5 |
68b003b49d764c6eb0dbf497edfdcc75
|
|
| BLAKE2b-256 |
83b48c04ad67d5627944e85e827f742f48e23d7d4394138ebb8664befe7a0021
|
Provenance
The following attestation bundles were made for xquik_haystack-0.1.5-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.5-py3-none-any.whl -
Subject digest:
a09256f3bbbd05f2cf46ae857d73694699590ae6e681bd4aac6647bf6cb8e20d - Sigstore transparency entry: 2541057818
- Sigstore integration time:
-
Permalink:
Xquik-dev/xquik-haystack@0ff821090fc4a8fa0e46c975e8c6bba66a74ed91 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/Xquik-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0ff821090fc4a8fa0e46c975e8c6bba66a74ed91 -
Trigger Event:
release
-
Statement type: