Communitygithub.com

twitterapi-io-read

Read-only skill for twitterapi.io — look up public X/Twitter data (tweets, user profiles, followers and followings, advanced search, replies, quotes, trends, lists, communities) through the twitterapi.io REST API with a single x-api-key header. Use when the user wants to search, analyze or monitor public posts and accounts. Read-only: no posting, no account login, no credentials beyond the API key.

What is twitterapi-io-read?

twitterapi-io-read is a Cursor agent skill that read-only skill for twitterapi.io — look up public X/Twitter data (tweets, user profiles, followers and followings, advanced search, replies, quotes, trends, lists, communities) through the twitterapi.io REST API with a single x-api-key header. Use when the user wants to search, analyze or monitor public posts and accounts. Read-only: no posting, no account login, no credentials beyond the API key.

Works with~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/kaitoInfra/twitterapi-io/tree/main/skills/twitterapi-io-read

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation


name: twitterapi-io-read description: Read-only skill for twitterapi.io — look up public X/Twitter data (tweets, user profiles, followers and followings, advanced search, replies, quotes, trends, lists, communities) through the twitterapi.io REST API with a single x-api-key header. Use when the user wants to search, analyze or monitor public posts and accounts. Read-only: no posting, no account login, no credentials beyond the API key.

twitterapi.io (read-only)

Read-only skill maintained by the twitterapi.io team. It covers public X/Twitter data only: it never logs in to an X account, never handles cookies, passwords or proxies, and never posts, likes, follows or sends messages.

twitterapi.io is an independent third-party REST API for public X data, not affiliated with X Corp. If you need X's own API, the official one is at https://developer.x.com.

When to use this skill

  • Search posts with X search operators (from:, since_time:, min_faves:, lang: …)
  • Look up user profiles, followers, followings
  • Get a user's recent posts, replies, quote posts, retweeters, thread context
  • Trends, lists, communities
  • Build dashboards, research datasets or monitoring jobs on public data

Core facts

Base URLhttps://api.twitterapi.io
Auth headerx-api-key: YOUR_KEY (from https://twitterapi.io/dashboard)
Docshttps://docs.twitterapi.io
Pricingpay per call, see https://twitterapi.io/pricing
Hosted MCP serverhttps://mcp.twitterapi.io/mcp (12 read-only tools)

Security

Read the API key from the environment variable TWITTERAPI_IO_KEY. Never hardcode it, print it or commit it. If it is missing, ask the user to create one on the dashboard.

Minimal example

curl -s "https://api.twitterapi.io/twitter/user/info?userName=jack" \
  -H "x-api-key: $TWITTERAPI_IO_KEY"
import os, requests

BASE = "https://api.twitterapi.io"
HEADERS = {"x-api-key": os.environ["TWITTERAPI_IO_KEY"]}

r = requests.get(f"{BASE}/twitter/tweet/advanced_search",
                 headers=HEADERS,
                 params={"query": "from:jack", "queryType": "Latest"},
                 timeout=30)
r.raise_for_status()
for t in r.json().get("tweets", []):
    print(t["createdAt"], t["text"][:80])

Read endpoints

Parameter names differ per endpoint (some camelCase, some snake_case). Copy them exactly as shown.

CapabilityMethodPath & key param
User by screen nameGET/twitter/user/info?userName=
Extended profileGET/twitter/user_about?userName=
Users by IDsGET/twitter/user/batch_info_by_ids?userIds=
Search usersGET/twitter/user/search?query=
Recent postsGET/twitter/user/last_tweets?userName= (or userId=)
MentionsGET/twitter/user/mentions?userName=
FollowersGET/twitter/user/followers?userName=&pageSize=200
FollowingsGET/twitter/user/followings?userName=
Posts by IDsGET/twitter/tweets?tweet_ids=
RepliesGET/twitter/tweet/replies?tweetId=
Quote postsGET/twitter/tweet/quotes?tweetId=
RetweetersGET/twitter/tweet/retweeters?tweetId=
Thread contextGET/twitter/tweet/thread_context?tweetId=
Advanced searchGET/twitter/tweet/advanced_search?query=&queryType=Latest
TrendsGET/twitter/trends?woeid=1
List postsGET/twitter/list/tweets?listId=
List membersGET/twitter/list/members?list_id=
Community postsGET/twitter/community/tweets?community_id=
Account balanceGET/oapi/my/info

Patterns

Pagination

List endpoints return has_next_page and next_cursor. Pass next_cursor back as cursor; stop when has_next_page is false. Always set a page limit so a bug can't page forever.

Errors

  • 400 → a required parameter is missing or the search query is invalid (the response detail says what to fix)
  • 401 / 403 → missing or wrong x-api-key
  • 402 → out of credits; stop and tell the user to top up (don't retry)
  • 429 → rate-limited; retry with backoff
  • 5xx → transient; retry with backoff

Cost awareness

Each call is billed. Before a loop that could run long (all followers of a large account, months of search), estimate the number of calls and confirm with the user.

Anti-patterns

  • Don't normalise parameter names; copy them from the table
  • Don't retry on 402
  • Don't log or commit the API key

Related Skills