OpenClaw X
Control your X/Twitter account via a local API.
Prerequisites
- Download the executable from GitHub Release
- Export your X cookies from Chrome (using Cookie-Editor extension), save as
cookies.jsonin the same directory - Run the executable, ensure the service is running at
http://localhost:19816
Available Actions
1. Get Home Timeline
curl http://localhost:19816/timeline?count=20
Returns the latest tweets including content, author, media URLs, etc.
2. Get Tweet Details
curl http://localhost:19816/tweet/{tweet_id}
Supports both tweet ID and full URL (e.g. https://x.com/user/status/123456).
3. Search Tweets
curl "http://localhost:19816/search?q=keyword&sort=Latest&count=20"
Parameters:
q: Search keyword (required)sort:LatestorTop, default Latestcount: Number of results, default 20
4. Post a Tweet
curl -X POST http://localhost:19816/tweet \
-H "Content-Type: application/json" \
-d '{"text": "Hello world"}'
Reply to a tweet:
curl -X POST http://localhost:19816/tweet \
-H "Content-Type: application/json" \
-d '{"text": "Reply content", "reply_to": "original_tweet_id"}'
5. Like a Tweet
curl -X POST http://localhost:19816/tweet/{tweet_id}/like
6. Retweet
curl -X POST http://localhost:19816/tweet/{tweet_id}/retweet
7. Bookmark a Tweet
curl -X POST http://localhost:19816/tweet/{tweet_id}/bookmark
8. Get User Info
curl http://localhost:19816/user/{username}
Returns username, avatar, bio, follower count, etc.
9. Get User Tweets
curl http://localhost:19816/user/{username}/tweets?count=20
Common Use Cases
- "Show me what's new on my timeline"
- "Search for the latest tweets about AI Agents"
- "Post a tweet saying: What a beautiful day!"
- "Like this tweet https://x.com/xxx/status/123"
- "Check what @elonmusk has been posting"
- "Bookmark this tweet"