Prefect tasks for Twitter search & X API workflows
Schedule 6 read-only Twitter search, profile, timeline, and trend tasks in Prefect 3. Store X API keys in Prefect blocks.
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.
Tasks
| Workflow step | Prefect task | Xquik endpoint |
|---|---|---|
| Search tweets | search_tweets |
GET /x/tweets/search |
| Read one tweet | get_tweet |
GET /x/tweets/{id} |
| Search X profiles | search_users |
GET /x/users/search |
| Read one profile | get_user |
GET /x/users/{id} |
| Read a profile timeline | get_user_tweets |
GET /x/users/{id}/tweets |
| Read regional trends | get_trends |
GET /x/trends |
Use the REST API for follower exports or publishing.
Install
pip install prefect-xquik
Store X API credentials
prefect block register -m prefect_xquik
Create a Prefect block in the UI or with Python.
from prefect_xquik import XquikCredentials
credentials = XquikCredentials(api_key="your_xquik_api_key_here")
credentials.save("xquik", overwrite=True)
Keep API keys in Prefect blocks. Never put them in flow source files.
Create a flow
from prefect import flow
from prefect_xquik import XquikCredentials, get_trends, search_tweets
@flow
async def twitter_signal_flow() -> dict:
credentials = XquikCredentials.load("xquik")
tweets = await search_tweets(
credentials,
query='"prefect" OR "workflow orchestration"',
query_type="Latest",
limit=25,
)
trends = await get_trends(credentials, woeid=1, count=10)
return {"tweets": tweets, "trends": trends}
Import tasks
from prefect_xquik import (
get_trends,
get_tweet,
get_user,
get_user_tweets,
search_tweets,
search_users,
)
Tasks return raw Xquik JSON dictionaries and support Prefect's with_options.
from prefect_xquik import search_tweets
search_recent_tweets = search_tweets.with_options(
name="Search recent tweets",
retries=2,
retry_delay_seconds=10,
)
API contract
The credentials block sends x-api-key and xquik-api-contract: 2026-04-29 headers.
Documentation
- Xquik Prefect guide
- Xquik API reference
- Prefect workflows and tasks
- Organization support policy
- Security policy
- Contributing
Develop locally
uv sync
uv run ruff format --check .
uv run ruff check .
uv run pip-audit
uv run pytest
./scripts/build_reproducibly.sh
uv run twine check dist/*
Pytest enforces 100% coverage. bin/check-local checks REUSE 3.3 metadata, dependencies, and byte-for-byte builds.
Xquik is an independent third-party service. Not affiliated with X Corp. "Twitter" and "X" are trademarks of X Corp.
Metadata
Release files for prefect-xquik 0.1.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| prefect_xquik-0.1.11.tar.gz | 242.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| prefect_xquik-0.1.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 253.7 kB
Release files / prefect_xquik-0.1.11.tar.gz
| Download URL | prefect_xquik-0.1.11.tar.gz |
|---|---|
| Size | 242.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af95ea04587a4a2c88a8f174bfa1af396a26195ca3e873575a760b518b259507
|
|
BLAKE2b-256 checksum How to use checksums |
4e22d8921df4c593aa7b30034fb316609a2f2e04610a9d5fa9c7a9cef623848e
|
| 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 / prefect_xquik-0.1.11-py3-none-any.whl
| Download URL | prefect_xquik-0.1.11-py3-none-any.whl |
|---|---|
| Size | 11.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70394124e8fc0724f3cd3d8524e4ef8c861e7b6ac7499b213880a0030f2d72e6
|
|
BLAKE2b-256 checksum How to use checksums |
abcf1fb2a38aea90a880d62d2d9ce08235585a1bdd743010e7e82fa7e99847f0
|
| 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}
|