xdk
Python SDK for the X API
What it is and what it does
XDK is a Python SDK for the X API that wraps OAuth-authenticated HTTP requests into a typed client interface. It provides methods to fetch posts by ID, search recent posts, and create new posts, with support for Python 3.8 through 3.12. The package depends on pydantic for validation, requests for HTTP, and requests-oauthlib for OAuth credential handling.
The SDK is in alpha status and actively maintained, with a growing user base. It abstracts away the details of constructing X API requests and managing OAuth tokens, letting developers focus on application logic rather than authentication plumbing.
Use it for:
- Fetch and analyze posts from X by ID in a Python application
- Search for recent posts matching a query and process results programmatically
- Publish posts to X from an automated workflow or bot
- Build a Python application that reads and writes to X without manual HTTP request construction
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Python SDK for interacting with the X API, providing typed client methods to retrieve, search, and create posts with OAuth authentication.
Yes, if you need to interact with the X API from Python. The package has low install friction, permissive licensing, no known vulnerabilities, and active maintenance. The alpha status and small user base mean edge cases may not be fully tested; verify that it covers the API endpoints you need before committing to it in production.
Install
xdk on PyPI
pip
pip install xdkuv
uv add xdkpoetry
poetry add xdkInstalling xdk
Before you install
Low install friction; pure Python wheel with three common dependencies (pydantic, requests, requests-oauthlib). Active maintenance with a release 20 days old and recent commits.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package with minimal restrictions in commercial or private projects.
Quickstart
pip install xdk
from xdk import Client
client = Client(
api_key="your_api_key",
api_secret="your_api_secret",
access_token="your_access_token",
access_token_secret="your_access_token_secret"
)
posts = client.posts.get(ids=["1234567890"])
Requires valid X API credentials (API key, secret, and OAuth tokens) to authenticate.
Verify before relying
- Whether the SDK covers the full X API v2 surface or a subset of endpoints
- Whether rate-limiting or retry logic is built in or left to the caller
- Whether the package is officially maintained by X Corp or a third party
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — pydantic, requests-oauthlib, requests |
| Maintenance | actively maintained — 20 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 102,521/month — #12,865 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: xdk-0.10.6-py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
late-sdkOfficial Python SDK for publishing social media…
permissive · top 15,000 on PyPI
requests-oauthAdds OAuth 1.0 authentication support to the…
permissive · top 5,000 on PyPI
zernio-sdkUnified Python client for publishing social…
permissive · top 15,000 on PyPI
linkedin-api-clientProvides a Python client for LinkedIn's Rest.li…
unclear · top 5,000 on PyPI
hubspot-api-clientPython SDK for the HubSpot API v3 that provides…
permissive · top 5,000 on PyPI
auth0-pythonProvides Python bindings to Auth0's…
permissive · top 5,000 on PyPI
vonageVonage provides a unified Python interface to…
permissive · top 15,000 on PyPI
dropbox-signPython client library for the Dropbox Sign v3…
permissive · top 5,000 on PyPI
python-twitterA Python wrapper that provides programmatic…
permissive · top 15,000 on PyPI
python-youtubeA Python wrapper for the YouTube Data API V3…
permissive · top 15,000 on PyPI