X/Twitter Tweet Search & User Timeline Retrieval for Haystack
Retrieve public X/Twitter context through Xquik.
Choose these components when Haystack pipelines need tweet Document objects.
Read the Xquik Haystack guide.
Choose a Component
| Retrieval question | Haystack component | Xquik route | Output |
|---|---|---|---|
| How do I search tweets for RAG? | XquikTweetSearch |
GET /x/tweets/search |
Matching posts as Document objects |
| How do I retrieve a user's timeline? | XquikUserTweetsFetcher |
GET /x/users/{id}/tweets |
Recent user posts as Document objects |
This package exposes 2 read-only components. Use an Xquik SDK for follower exports or posting.
Import both read-only components from the Haystack integration namespace:
from haystack_integrations.components.websearch.xquik import XquikTweetSearch, XquikUserTweetsFetcher
Both components:
- Read
XQUIK_API_KEYby default. - Accept
haystack.utils.Secretfor explicit keys. - Send
x-api-keyandxquik-api-contract: 2026-04-29. - Allow a custom
base_urlfor controlled deployments. - Return
documents,links,has_more, andnext_cursor.
Install
Install from PyPI:
pip install xquik-haystack
Search Public X Data
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.
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.
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.4.tar.gz.
File metadata
- Download URL: xquik_haystack-0.1.4.tar.gz
- Upload date:
- Size: 20.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
202769722fff12c28c0fe05f1f3ebe3771dede54d4f98f7a1fab3e572182ed51
|
|
| MD5 |
dea055040f0eee53150cbb40f3eaea1e
|
|
| BLAKE2b-256 |
1034f0e9fd6600ffd4badb9c6c8ca11aba703e83ad6690c2b3ae967921fc1b8a
|
Provenance
The following attestation bundles were made for xquik_haystack-0.1.4.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.4.tar.gz -
Subject digest:
202769722fff12c28c0fe05f1f3ebe3771dede54d4f98f7a1fab3e572182ed51 - Sigstore transparency entry: 2446833647
- Sigstore integration time:
-
Permalink:
Xquik-dev/xquik-haystack@4c45b2b38cd47a546c00397143db42b020a7ea82 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/Xquik-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4c45b2b38cd47a546c00397143db42b020a7ea82 -
Trigger Event:
release
-
Statement type:
File details
Details for the file xquik_haystack-0.1.4-py3-none-any.whl.
File metadata
- Download URL: xquik_haystack-0.1.4-py3-none-any.whl
- Upload date:
- Size: 11.1 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 |
706343415a5d2d542abc6e8c32154219ffde3d411eedb5437cdcc535bb0b8834
|
|
| MD5 |
fbace10064e05f87770da6e4c4f3c8f1
|
|
| BLAKE2b-256 |
50b194e67a765f2b9778c3f741e5ef161b238cb4a5537363cf1adc00d37d5638
|
Provenance
The following attestation bundles were made for xquik_haystack-0.1.4-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.4-py3-none-any.whl -
Subject digest:
706343415a5d2d542abc6e8c32154219ffde3d411eedb5437cdcc535bb0b8834 - Sigstore transparency entry: 2446834104
- Sigstore integration time:
-
Permalink:
Xquik-dev/xquik-haystack@4c45b2b38cd47a546c00397143db42b020a7ea82 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/Xquik-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4c45b2b38cd47a546c00397143db42b020a7ea82 -
Trigger Event:
release
-
Statement type: