Skip to main content

Crate twikit

Crate twikit 

Source
Expand description

Async Rust client for the same Twitter/X web APIs used by Python twikit.

The crate intentionally keeps the raw JSON beside typed convenience models. X changes response shapes often, and preserving the original payload prevents data loss while still giving callers a Rust-first API for common workflows.

Re-exports§

pub use captcha::Capsolver;
pub use captcha::CaptchaSolver;
pub use captcha::UnlockHTML;
pub use client::Client;
pub use client::ClientBuilder;
pub use client::ConversationControl;
pub use client::CreateTweetOptions;
pub use client::GuestClient;
pub use client::LoginOptions;
pub use client::RawApiResponse;
pub use client::RequestOptions;
pub use client::SearchGeoOptions;
pub use client::TrendsOptions;
pub use client::TweetDetail;
pub use client::TweetSearchProduct;
pub use client::TweetType;
pub use error::Error;
pub use error::Result;
pub use flow::Flow;
pub use gql::GQLClient;
pub use media::AnimatedGif;
pub use media::Media;
pub use media::MediaKind;
pub use media::MediaVariant;
pub use media::Photo;
pub use media::Stream;
pub use media::Video;
pub use models::BookmarkFolder;
pub use models::Community;
pub use models::CommunityMember;
pub use models::CommunityNote;
pub use models::Group;
pub use models::GroupMessage;
pub use models::List;
pub use models::Location;
pub use models::Message;
pub use models::Notification;
pub use models::Place;
pub use models::PlaceTrend;
pub use models::PlaceTrends;
pub use models::Poll;
pub use models::ScheduledTweet;
pub use models::Trend;
pub use models::Tweet;
pub use models::User;
pub use result::Timeline;
pub use v11::V11Client;

Modules§

captcha
Captcha solver interfaces.
client
Async clients for authenticated and guest Twitter/X web API access.
constants
Constants and GraphQL feature maps copied from the web client surface.
endpoints
Twitter/X web API endpoint constants.
error
Error types.
flow
Login flow helper.
gql
GraphQL method-for-method wrapper mirroring Python twikit’s GQLClient.
media
Media models and download helpers.
models
Typed models backed by raw Twitter/X JSON.
result
Paginated timeline results.
streaming
Streaming topic helpers and payload model.
transaction
X-Client-Transaction-Id generator.
ui_metrics
Minimal DOM mocks and ui_metrics extraction helpers.
utils
Utility helpers for nested Twitter/X JSON payloads.
v11
V1.1 method-for-method wrapper mirroring Python twikit’s V11Client.