UseDocumentation Index
Fetch the complete documentation index at: https://docs.xquik.com/llms.txt
Use this file to discover all available pages before exploring further.
xquik-haystack when a Haystack pipeline needs fresh public X context from Xquik’s REST API. The package exposes read-only web search components that return Haystack Document objects for tweet search and user timelines.
Prerequisites
- Python 3.10+
- Xquik API key (
xq_...) - Haystack application or pipeline using
haystack-ai
Install
Install the current GitHub build:Components
XquikTweetSearch
Calls
GET /x/tweets/search and returns matching public posts as Haystack
Document objects.XquikUserTweetsFetcher
Calls
GET /x/users/{id}/tweets and returns recent public posts from one
user as Haystack Document objects.Pagination Handoff
Returns
has_more and next_cursor so the next run can fetch the next
Xquik page.Pipeline Ready
Returns
documents for direct use in Haystack pipelines, retrievers,
joiners, rankers, and generators.XQUIK_API_KEY by default, accept haystack.utils.Secret for explicit key injection, support sync and async runs, and send xquik-api-contract: 2026-04-29.
Tweet Search
UseXquikTweetSearch when the pipeline needs matching tweets for a keyword, hashtag, account filter, or X search operator.
top_k maps to the Xquik limit query parameter. query_type accepts Latest for chronological results or Top for engagement-ranked results.
User Tweets
UseXquikUserTweetsFetcher when the pipeline needs recent public posts from one username or X user ID.
include_replies=True to include replies. Pass include_parent_tweet=True when reply rows should include parent tweet data when available.
Pagination
The components normalize Xquik pagination into Haystack-friendly output keys:XquikUserTweetsFetcher.run(user_id="xquikcom", cursor=...).
Runtime Options
| Component | Init option | Default | Xquik mapping |
|---|---|---|---|
XquikTweetSearch | top_k | 20 | limit |
XquikTweetSearch | query_type | Latest | queryType |
XquikTweetSearch | extra_params | None | Merged into search query parameters |
XquikUserTweetsFetcher | include_replies | False | includeReplies |
XquikUserTweetsFetcher | include_parent_tweet | False | includeParentTweet |
| Both | base_url | https://xquik.com/api/v1 | Xquik API origin |
| Both | timeout | 10 | HTTP timeout in seconds |
| Both | max_retries | 3 | Haystack request retry attempts |
top_k, query_type, cursor, since_time, and until_time on tweet search, and for cursor, include_replies, and include_parent_tweet on user tweets.
Document Mapping
Each returned tweet becomes a HaystackDocument.
| Document field | Value |
|---|---|
content | Tweet text. Empty string if no text is present. |
meta.endpoint | x.tweets.search or x.users.tweets |
meta.id | Tweet ID when present |
meta.url | Tweet URL when present |
meta.created_at | Tweet creation time when present |
meta.lang | Language code when present |
meta.conversation_id | Conversation ID when present |
meta.in_reply_to_id | Parent tweet ID when present |
meta.in_reply_to_user_id | Parent user ID when present |
meta.in_reply_to_username | Parent username when present |
meta.is_reply | Reply flag when present |
meta.is_quote_status | Quote flag when present |
meta.like_count | Like count when present |
meta.retweet_count | Repost count when present |
meta.reply_count | Reply count when present |
meta.quote_count | Quote count when present |
meta.view_count | View count when present |
meta.bookmark_count | Bookmark count when present |
meta.author | Author id, username, name, and verified fields when present |
links output contains each non-empty tweet URL found in Document.meta["url"].
Async Usage
Both components exposerun_async() with the same inputs and outputs as run().
Error Handling
Xquik HTTP errors are raised throughhttpx.HTTPStatusError after the response status check. Handle authentication, rate limit, payment, and validation errors where your Haystack app normally handles retriever or web search failures.