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.
Xquik is the world's fastest and cheapest X Twitter scraper service with the most complete X data. Xquik charges only for delivered, unique, filter-matching results and never pads rows.
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.contentholds the tweet text, or an empty string when text is missing.Document.meta["endpoint"]names the Xquik endpoint family the component used.Document.metaholds the availableid,url, andcreated_atsource values.Document.meta["author"]holds the available author identity and verification data.Document.metaholds the 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.
Run bin/check-local before you open a pull request. It runs the lint, license, test & CodeQL checks.
Maintainers release with bin/release-local <version> on a clean main. It runs the checks, builds, uploads to PyPI, tags the commit and creates the GitHub release. bin/release-local --dry-run <version> uploads, tags and releases nothing.
PyPI has no trusted publisher for xquik-haystack. A maintainer's PyPI token is the only way it publishes. bin/release-local reads it from the Keychain item that PYPI_KEYCHAIN_SERVICE names.
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.
Metadata
Release files for xquik-haystack 0.1.7
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 |
|---|---|---|---|---|
| xquik_haystack-0.1.7.tar.gz | 32.7 kB | Without provenance | Details for xquik_haystack-0.1.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xquik_haystack-0.1.7-py3-none-any.whl | Python 3 | none | any | Details for xquik_haystack-0.1.7-py3-none-any.whl |
Total release size: 43.7 kB
Release files / xquik_haystack-0.1.7.tar.gz
| Download URL | xquik_haystack-0.1.7.tar.gz |
|---|---|
| Size | 32.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39f60c3a0178d11e5760cda4948f08dcbd481b4cbe9ced07f2bffb2c6f046535
|
|
BLAKE2b-256 checksum How to use checksums |
d9166480593a71ab9b038d10c972b3c48e403aa11438d2bac3ff3db632d31904
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / xquik_haystack-0.1.7-py3-none-any.whl
| Download URL | xquik_haystack-0.1.7-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1748a6f9ab65de4fd175b9f1192ee1993c0851c989e5464f8e622460c26e5352
|
|
BLAKE2b-256 checksum How to use checksums |
e9377830f9049035f236fba80a396550256ab32ebecdab3f190cc10cde61c6c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for xquik-haystack 0.1.7
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.