Skip to main content
The Python XDK (X Developer Kit) is our official client library for interacting with the X API v2 using Python. It allows developers to get started with our API quickly and build applications with it. It is generated based on our official OpenAPI specification. It abstracts away low-level HTTP details while providing fine-grained control when needed.

Key Features

  • 🔐 OAuth Support: Full support for Bearer Token (app-only) auth, OAuth 2.0 with PKCE (user context), and OAuth 1.0.
  • 🔄 Pagination: Automatically page through large results. The XDK takes care of pagination without requiring you to make multiple API calls using the next_token.
  • 📡 Streaming: Supports real-time data streaming for endpoints like filtered stream that require persistent http connection.
  • 🎯 Comprehensive Coverage: Supports all X API v2 endpoints including such as search, timelines, filtered-stream and more.
Version Compatibility: Python 3.8+. Tested on CPython and PyPy. License: MIT License