x-api
БесплатноБез исполняемых скриптовНе проверенRead X/Twitter via API, post tweets with OAuth 1.0a, and draft X Articles through `shitrat x`. Check mentions, search, and ingest posts. Use app bearer tokens…
от joelhooks★ 69 звёзд на GitHubОб этом скилле
X/Twitter API Skill
Read paths stay here. X Articles writes go through shitrat x. Tweets still use OAuth 1.0a until that lands on the same CLI.
Authentication
Recommended for read-only access: app bearer token
There is no stored x_bot_bearer_token secret right now. Derive the app bearer token from the X app consumer key + secret, then use that bearer token for read-only endpoints like tweet lookup.
python3 <<'PY'
import base64, json, subprocess
from urllib import request, parse
def lease(name: str) -> str:
raw = subprocess.check_output(['secrets', 'lease', name], text=True)
data = json.loads(raw)
return data.get('secret') or data.get('result') or raw.strip()
ck = lease('x_consumer_key')
cs = lease('x_consumer_secret')
cred = base64.b64encode(f'{ck}:{cs}'.encode()).decode()
req = request.Request(
'https://api.twitter.com/oauth2/token',
data=parse.urlencode({'grant_type': 'client_credentials'}).encode(),
headers={
'Authorization': f'Basic {cred}',
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
},
method='POST',
)
with request.urlopen(req) as r:
bearer = json.loads(r.read().decode())['access_token']
req2 = request.Request(
'https://api.twitter.com/2/tweets/TWEET_ID',
headers={'Authorization': f'Bearer {bearer}'},
)
with request.urlopen(req2) as r:
print(r.read().decode())
PY
# Revoke only the exact lease ids acquired by this task; never all sessions’ leases.
Use this for:
- reading a specific tweet/post
- fetching public user metadata
- recent search
- full-archive search when the app has access
- reply/context passes for source ingestion
- other public read-only X v2 endpoints
Reply/context pass for ingestion
When ingesting an X post/article as a source, do a reply pass before writing the final note. The replies often contain the correction, missing caveat, source link, or better framing. Do not blindly archive the whole reply swamp; extract the high-signal replies and keep receipts.
Minimum pass:
- Fetch the root post with
conversation_id,author_id,created_at,entities,public_metrics,referenced_tweets,note_tweet, andarticlewhen available. - Search replies with
conversation_id:ROOT_ID is:reply -is:retweet. - Capture high-signal replies: author clarification, author thread continuation, cited source/link, strong objection, correction, implementation detail, or unusually crisp language.
- Store reply receipts with
tweet_id, author handle/name, created time, URL, text basis, metrics, and why it matters. - In the Brain/source note, separate the root quote from Reply signals so public claims do not blur root-author text with commenter interpretation.
For posts inside the recent-search window:
# After deriving bearer as above:
curl "https://api.x.com/2/tweets/search/recent?query=conversation_id%3AROOT_ID%20is%3Areply%20-is%3Aretweet&max_results=100&tweet.fields=author_id,conversation_id,created_at,entities,id,in_reply_to_user_id,note_tweet,public_metrics,referenced_tweets,text&expansions=author_id,referenced_tweets.id,referenced_tweets.id.author_id&user.fields=username,name,verified,verified_type" \
-H "Authorization: Bearer $bearer"
For older posts, use Full-Archive Search when access allows it; otherwise fall back to browser inspection and mark the limitation in the verification note.
Full-Archive Search
The bot app can call Full-Archive Search if the access tier permits it. Do not use Recent Search for YTD/backfill research; it rejects older start_time values.
# After deriving bearer as above:
curl "https://api.x.com/2/tweets/search/all?query=from%3Athreepointone%20-is%3Areply&start_time=2026-01-01T00%3A00%3A00Z&end_time=2026-05-02T00%3A00%3A00Z&max_results=100&tweet.fields=created_at,public_metrics" \
-H "Authorization: Bearer $bearer"
Notes:
- Full archive endpoint:
/2/tweets/search/all. - Recent endpoint:
/2/tweets/search/recent; last-7-days style window only. tweet.fields=context_annotationsforcesmax_results <= 100; X returns 400 if paired withmax_results=500.- Full-archive docs: https://docs.x.com/x-api/posts/search/quickstart/full-archive-search
Alternative: OAuth 1.0a User Context (for posting and account actions)
Tokens do not expire — no refresh dance needed.
Secrets (in agent-secrets)
x_consumer_key— API Key (OAuth 1.0a consumer key)x_consumer_secret— API Key Secret (OAuth 1.0a consumer secret)x_access_token— Access Token (OAuth 1.0a, format:numeric-alphanumeric)x_access_token_secret— Access Token Secret (OAuth 1.0a)
@joelhooks / shitrat-joel app
Use these scoped secret names for Joel's personal X account so they don't collide with the @joelclaw bot app:
x_joelhooks_consumer_keyx_joelhooks_consumer_secretx_joelhooks_bearer_tokenx_joelhooks_access_tokenx_joelhooks_access_token_secret
PIN OAuth note, 2026-06-28: `
Установить x-api в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл x-api?
Read X/Twitter via API, post tweets with OAuth 1.0a, and draft X Articles through `shitrat x`. Check mentions, search, and ingest posts. Use app bearer tokens for read-only fetches. Use OAuth 1.0a user context for tweets. Use `shitrat x` for Articles.
Как установить скилл x-api?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл x-api запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic