Skip to main content

Submodules

Module contents

This module provides access to the activity endpoints of the X API and serves as the main entry point for all activity-related functionality.

class xdk.activity.ActivityClient

Streaming Client for activity operations

Parameters

path.client
Client

__init__

Parameters

path.client
Client

create_subscription

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

Parameters

body.body
CreateSubscriptionRequest

delete_subscription

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

Parameters

path.subscription_id
Any
The ID of the subscription to delete.

Returns

DeleteSubscriptionResponse - Response data

get_subscriptions

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

Returns

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.

Parameters

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

update_subscription

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

Parameters

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