skillfed

xdk

Python SDK for the X API

xdk v0.10.6 102.5K downloads/30d#12,865 on PyPI39
Permissive license Active released

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 xdk

uv

uv add xdk

poetry

poetry add xdk

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

X API Python clientX posts API wrapperPython OAuth API integrationX API v2 SDKsocial media API client
oauthsocial-media-api

More WWW/HTTP packages