Skip to main content

xippios-x

Typed Python client, MCP server and FastAPI routes for X API v2, part of the xippios SDK family. Names and semantics follow the upstream documentation; every response carries release metadata (source, endpoint, retrieved_at, published_at, vintage).

Install

uv add xippios-x            # client only
uv add "xippios-x[mcp]"     # + MCP server
uv add "xippios-x[http]"    # + FastAPI router

Set X_API_KEY in the environment to your X app's Bearer Token, which X also calls the App only Access Token (Developer Console, Keys and tokens), not the console's API Key, the OAuth 1.0a consumer key. Nothing is read from files.

30-second example

from xippios.x import tasks

users = tasks.lookup_users(["USDA", "FAO"])  # 0.010 USD a user found
usda = next(user for user in users.data.data if user.username == "USDA")

page = tasks.get_user_posts(usda.id, max_results=10)  # 0.005 USD a post returned
for post in page.data.data or []:
    print(post.created_at, post.public_metrics.like_count, post.text)
print(page.meta.retrieved_at, page.meta.request, page.data.meta.result_count)

older = tasks.get_user_posts(usda.id, pagination_token=page.data.meta.next_token)

Every task returns one page as X sends it, in result.data; a call that returns data spends X credits at the prices of X's pricing page, which each task's docstring names (the page states none for get_usage). Paging is the caller's, with the next_token of the previous page's meta. Underneath the tasks, xippios.x.api wraps nine X API v2 operations one page at a time (users by username, posts by id, a user's posts, post counts over the archive, recent search, post counts over the last seven days, a List's posts, a List's members and the project's usage).

MCP

{
  "mcpServers": {
    "x": {
      "command": "uvx",
      "args": ["--from", "xippios-x[mcp]", "xippios-x-mcp"],
      "env": { "X_API_KEY": "..." }
    }
  }
}

xippios-x-mcp serves stdio; --http serves streamable HTTP instead. Tools are read-only and named x_<verb>_<noun>; every call that returns data spends X credits, and each tool's description gives its price (the pricing page states none for x_get_usage). A tool returns one page, which its result cap holds whole for Latin-script text: up to 100 posts in 128,000 bytes, 100 users in 160,000, and 64 KB for the counts, which a month of hourly buckets fits. A page of mostly non-Latin text, or minute counts over more than about 14 hours, can be cut, with a note on how to see the rest.

Status

Upstream operation Task function MCP tool Status
GET /2/users/by (getUsersByUsernames) lookup_users(usernames, most_recent_post) x_lookup_users alpha; 0.010 USD a user, 0.005 USD more with most_recent_post
GET /2/users/{id}/tweets (getUsersPosts) get_user_posts(id, max_results, pagination_token, start_time, end_time) x_get_user_posts alpha; 0.005 USD a post
GET /2/tweets/search/recent (searchPostsRecent) search_recent_posts(query, max_results, next_token, start_time, end_time) x_search_recent_posts alpha; 0.005 USD a post; query of 512 characters at most
GET /2/tweets/counts/all (getPostsCountsAll) count_posts(query, granularity, start_time, end_time, next_token) x_count_posts alpha; 0.010 USD a request; query of 1,024 characters at most
GET /2/lists/{id}/tweets (getListsPosts) get_list_posts(id, max_results, pagination_token) x_get_list_posts alpha; 0.005 USD a post
GET /2/tweets/search/recent (searchPostsRecent, conversation_id:) get_conversation_posts(conversation_id, max_results, next_token) x_get_conversation_posts alpha; 0.005 USD a post
GET /2/usage/tweets (getUsage) get_usage(days) x_get_usage alpha; no price stated

Prices are those of X's pricing page in the snapshot of 2026-10-29 (docs/upstream/pages/pricing.md); a post or user read again the same UTC day is not billed again, a counts request always is.

Upstream terms and attribution

Data comes from X API v2 (https://x.com) under the X Developer Agreement and the X Developer Policy, which bind every app that uses it; this package adds no rights to it. Documentation snapshot and its attribution: docs/upstream/FETCHED.md.

Licence

Apache-2.0. See LICENSE.

Metadata

Release files for xippios-x 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xippios-x 0.1.0
File Size Uploaded Provenance Actions
xippios_x-0.1.0.tar.gz 183.3 kB With provenance Details for xippios_x-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xippios-x 0.1.0
File Interpreter ABI Platform Actions
xippios_x-0.1.0-py3-none-any.whl Python 3 none any Details for xippios_x-0.1.0-py3-none-any.whl

Total release size: 233.3 kB

Release files / xippios_x-0.1.0.tar.gz

Download URL xippios_x-0.1.0.tar.gz
Size 183.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6e9d6278636fc548d29da3ddd42ac94c9b691d4e3e615b0d139cf22380f9bf93
BLAKE2b-256 checksum
How to use checksums
4f7746423c7b50195b42e0b34741a22f3fb139f9af6483ffbf572001a6e10a13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / xippios_x-0.1.0-py3-none-any.whl

Download URL xippios_x-0.1.0-py3-none-any.whl
Size 50.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06848943c2def1309cda6d7a442948902736254be5a0e9673a139f7ff1237694
BLAKE2b-256 checksum
How to use checksums
fd9b9b514455ea57a8cc39c3a1ee09c3153e342a46997bd31ac69d968c8b3255
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for xippios-x 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for xippios_x-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page