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.

Documents

  • sdk-core: docs/conventions.md — the conventions every xippios source package follows: its layout, names, results, tests and releases.
  • sdk-core: docs/adr.md — the index of the family's architecture decisions, which the conventions cite.
  • sdk-core: docs/definition-of-done.md — what a change satisfies before its pull request is opened.
  • sdk-core: docs/review-checklist.md — what the review of a pull request checks, in order.
  • sdk-x: docs/adr.md — the index of this package's own decisions, generated from the records in docs/adr/.
  • sdk-x: docs/upstream/FETCHED.md — the snapshot of the upstream documentation, the reference for names, parameters and semantics.

Licence

Apache-2.0. See LICENSE.

Metadata

Release files for xippios-x 0.2.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.2.0
File Size Uploaded Provenance Actions
xippios_x-0.2.0.tar.gz 187.0 kB With provenance Details for xippios_x-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 236.6 kB

Release files / xippios_x-0.2.0.tar.gz

Download URL xippios_x-0.2.0.tar.gz
Size 187.0 kB
Tags Source
SHA-256 checksum
How to use checksums
734e0e66fe4896dd130a8bd4aea02bc55aa87d5d58ae8412d1a24ab08a3f9535
BLAKE2b-256 checksum
How to use checksums
bef10a078b774b393f61efcaecf77464ac3de0b78e69cabacfbc39c6e10eb818
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 Nov 21, 2026.

Transparency log

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

Download URL xippios_x-0.2.0-py3-none-any.whl
Size 49.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5bab151871cba29bb77da52a661899e7f84876e96afc08fb106c82a735a6fcfa
BLAKE2b-256 checksum
How to use checksums
3b65f2e3cfca0f8e3d7dcb586e6a43b4e673bfc92042c5d5cb6e1886c99bb54f
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 Nov 21, 2026.

Transparency log

Security for xippios-x 0.2.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for xippios_x-0.2.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 Nov 21, 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.2.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