Skip to main content
This module provides a client for interacting with the activity endpoints of the X API. Real-time streaming operations return generators that yield data as it arrives. Streaming connections are automatically managed with exponential backoff retry logic for robust handling.

ActivityClient

Class Bases: object Streaming Client para operações de activity

Construtores

__init__

Parâmetros

Client

create_subscription

Create X activity subscription Creates a subscription for an X activity event body: Request body :returns: Response data :rtype: CreateSubscriptionResponse

Parâmetros

CreateSubscriptionRequest

delete_subscription

Deletes X activity subscription Deletes a subscription for an X activity event

Parâmetros

Any
The ID of the subscription to delete.

Retorna

DeleteSubscriptionResponse - Response data

get_subscriptions

Get X activity subscriptions Get a list of active subscriptions for XAA :returns: Response data :rtype: GetSubscriptionsResponse

Retorna

GetSubscriptionsResponse

stream

Activity Stream (Streaming) Stream of X Activities This is a streaming endpoint that yields data in real-time as it becomes available. Each yielded item represents a single data point from the stream. The connection is automatically managed with exponential backoff retry logic. If the stream disconnects, the SDK will automatically reconnect without client intervention.

Parâmetros

int or None
default:"None"
The number of minutes of backfill requested.
str or None
default:"None"
YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Post labels will be provided.
str or None
default:"None"
YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp from which the Post labels will be provided.
StreamConfig
Optional StreamConfig for customizing retry behavior, timeouts, and callbacks.

update_subscription

Update X activity subscription Updates a subscription for an X activity event

Parâmetros

Any
The ID of the subscription to update.
UpdateSubscriptionRequest
Request body