Skip to main content

Schedule X/Twitter data workflows with Prefect

Xquik is an independent third-party service. Not affiliated with X Corp. "Twitter" and "X" are trademarks of X Corp.

Prefect Guide · Releases · Xquik API Reference · Prefect Docs

Run scheduled X/Twitter data reads in Prefect 3 flows with a reusable XquikCredentials block, async tasks, retries, and normal Prefect deployment patterns.

Use prefect-xquik when a workflow needs public X/Twitter signals for research, monitoring, enrichment, dashboards, or alerts without maintaining scraper code in each flow.

What you can schedule

Workflow Need Prefect Task Xquik Endpoint
Search recent or top posts search_tweets GET /x/tweets/search
Look up a specific post get_tweet GET /x/tweets/{id}
Search public users search_users GET /x/users/search
Look up a user profile get_user GET /x/users/{id}
Fetch a user's timeline get_user_tweets GET /x/users/{id}/tweets
Read regional or global trends get_trends GET /x/trends

Install

pip install prefect-xquik

For local development:

uv sync
uv run ruff format --check .
uv run ruff check .
uv run pytest
uv build
uv run twine check dist/*

Register blocks

prefect block register -m prefect_xquik

Create a block in the Prefect UI or with Python:

from prefect_xquik import XquikCredentials

credentials = XquikCredentials(api_key="your_xquik_api_key_here")
credentials.save("xquik", overwrite=True)

Store API keys in Prefect blocks, not in flow source files.

Create a flow

from prefect import flow
from prefect_xquik import XquikCredentials, get_trends, search_tweets


@flow
async def social_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 the raw Xquik JSON response as a Python dictionary. Configure Prefect runtime behavior with with_options:

from prefect_xquik import search_tweets

search_recent_tweets = search_tweets.with_options(
    name="Search Recent X Posts",
    retries=2,
    retry_delay_seconds=10,
)

API contract

The credentials block sends x-api-key and the current xquik-api-contract header. The default contract is 2026-04-29, matching the public OpenAPI contract used to build this collection.

Documentation

Development

uv sync
uv run ruff format --check .
uv run ruff check .
uv run pytest
uv build
uv run twine check dist/*

This repository follows Prefect's external collection layout so it can be moved under src/integrations/prefect-xquik later if Prefect maintainers request it.

Release files for prefect-xquik 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prefect-xquik 0.1.8
File Size Uploaded
prefect_xquik-0.1.8.tar.gz 15.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for prefect-xquik 0.1.8
File Interpreter ABI Platform
prefect_xquik-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 27.8 kB

Release files / prefect_xquik-0.1.8.tar.gz

Download URL prefect_xquik-0.1.8.tar.gz
Size 15.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c35cbfbc2e1c3ee23fcfb904e39916f34f0c0f6790faf45820c4f2ff98e18cdd
BLAKE2b-256 checksum
How to use checksums
6164f2c5410a06d2e776b765ceb7abfdf5971d94ae567ddc61556ed09bfd55a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 21, 2026.

Transparency log

Release files / prefect_xquik-0.1.8-py3-none-any.whl

Download URL prefect_xquik-0.1.8-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
669b817741d6dac4f1eeba7e0bee46570144f989b75ddd13223f404b2d5dfbe7
BLAKE2b-256 checksum
How to use checksums
5d7d0f8d632313840bc8c978d8998c2356128e37f3727d5e22b781ced3964087
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 21, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.10

2 release files

0.1.9

2 release files

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page