read-tweet
Purpose
Fetch a public X post by URL with the app-only bearer token stored in X_API_KEY.
Inputs
- An
x.comortwitter.compost URL
Workflow
- Extract the post ID from the
/status/segment. - Use
xurl read <id>to fetch the post.xurlhandles authentication automatically. - Prefer
note_tweettext over truncatedtext. If the text ends with..., re-fetch with the raw API path andnote_tweetfield to get the full long-form text. - Fetch 1 post only — do not walk reply chains or make additional API calls.
Example request
# Preferred: shortcut command
xurl read 2033746732996313488
# Fallback: raw API path (use when you need note_tweet or specific fields)
xurl "/2/tweets/2033746732996313488?tweet.fields=created_at,text,note_tweet,author_id,public_metrics,referenced_tweets,conversation_id&expansions=author_id,referenced_tweets.id,referenced_tweets.id.author_id&user.fields=username,name"
Return
Author:URL:Posted:Text:Include public metrics only if they matter to the task.
If the user asks only for the contents, return just the text unless metadata is helpful.
Failure handling
- Missing
X_API_KEY→ stop and report that it is not set. CreditsDepleted→ report that the credential is valid but has no remaining read credits.404, protected, or otherwise inaccessible → report that the post is unavailable instead of guessing.