Skip to main content

llama-index-tools-xdataapi

LlamaIndex tool spec for xdataapi.io: read-only public X (Twitter) data. Profiles, posts, threads, replies, quotes, reposters, followers, and search with the x.com operators.

Read-only by design. No posting, no likes, no direct messages, no private data. Not affiliated with X Corp.

pip install llama-index-tools-xdataapi

Use

from llama_index.tools.xdataapi import XdataapiToolSpec

# Reads XDATAAPI_KEY from the environment.
tool_spec = XdataapiToolSpec()
tools = tool_spec.to_tool_list()

With an agent:

from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.anthropic import Anthropic
from llama_index.tools.xdataapi import XdataapiToolSpec

agent = FunctionAgent(
    tools=XdataapiToolSpec(max_results=25).to_tool_list(),
    llm=Anthropic(model="claude-opus-5"),
)
print(await agent.run("What is @vercel posting about this week?"))

One call on its own:

XdataapiToolSpec().search_tweets(q="from:vercel since:2026-09-01", count=10)

Tools

Tool Reads Credits
search_tweets Search with the x.com operators 1 per result
get_user One profile, by handle or by numeric user id 1
get_users Up to 100 profiles in one call, by handles or by ids 1 per profile
get_user_tweets Latest posts of a user 1 per post
get_tweet One post 1
get_tweets Up to 100 posts in one call 1 per post
get_thread A post with its thread and replies 1 per post
get_replies Direct replies to a post 1 per reply
get_quotes Posts that quote a post 1 per post
get_retweeters Accounts that reposted a post 0.5 per profile
get_followers Followers, as profiles 0.1 per profile
get_follower_ids Follower ids only 0.02 per id
get_following Accounts a user follows 0.1 per profile
get_balance Credits left and rate limit free

Empty results and failed requests cost nothing. A repeated read inside the cache window costs half. Every response carries credits_charged and balance_remaining, so the model can watch the budget and stop on its own.

Spending guards

max_results caps the page size of every paging tool:

tool_spec = XdataapiToolSpec(max_results=25)

Narrow the surface with the LlamaIndex argument:

tools = XdataapiToolSpec().to_tool_list(spec_functions=["search_tweets", "get_user", "get_balance"])

Errors

A failure the model can act on — no credits, not found, a search product X refused — comes back as a dict with error.code, so the model can change plan. None of those are charged. A missing or revoked key raises XdataapiAuthError, because no model can repair it. Rate limits and upstream faults raise XdataapiError.

MCP instead

An agent that speaks MCP needs no package. The hosted server is at https://api.xdataapi.io/mcp (Streamable HTTP, OAuth or x-api-key), on the official MCP Registry as io.xdataapi/xdataapi.

Keys and pricing

Get a key at xdataapi.io/dashboard. 5,000 credits to start, no card. Prepaid packs from $10; credits never expire. Live status: xdataapi.io/status.

MIT licensed.

Metadata

Release files for llama-index-tools-xdataapi 0.1.3

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

Source distribution (sdist)

Source distribution for llama-index-tools-xdataapi 0.1.3
File Size Uploaded Provenance Actions
llama_index_tools_xdataapi-0.1.3.tar.gz 8.7 kB Without provenance Details for llama_index_tools_xdataapi-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-tools-xdataapi 0.1.3
File Interpreter ABI Platform Actions
llama_index_tools_xdataapi-0.1.3-py3-none-any.whl Python 3 none any Details for llama_index_tools_xdataapi-0.1.3-py3-none-any.whl

Total release size: 17.6 kB

Release files / llama_index_tools_xdataapi-0.1.3.tar.gz

Download URL llama_index_tools_xdataapi-0.1.3.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1070947558c3b7df3c4eb8af340d42023242cee2f1a431e6018840c34d9c3490
BLAKE2b-256 checksum
How to use checksums
a9fb8d4c4fbd1b490d7bba8e56ad6793c955b0f7e528ccbf36ae1da89b982665
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.16 {"installer":{"name":"uv","version":"0.12.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / llama_index_tools_xdataapi-0.1.3-py3-none-any.whl

Download URL llama_index_tools_xdataapi-0.1.3-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36155d6114ff8214f1feba90dd6957682130ec3561d5e026d0e83aa1cea70b50
BLAKE2b-256 checksum
How to use checksums
69f9e8155fb7ab2a298b7cf7e97e345a973a6fd431e5ce1c9f14e0ead2199811
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.16 {"installer":{"name":"uv","version":"0.12.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for llama-index-tools-xdataapi 0.1.3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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