To use X/Twitter in OpenClaw, run `clawhub install x-twitter` in your terminal, create a Twitter developer app at developer.x.com to get API credentials, and configure X_API_KEY, X_API_SECRET, X_ACCESS_TOKEN, and X_ACCESS_TOKEN_SECRET in OpenClaw. Once set up, you can post tweets, read timelines, search hashtags, and monitor mentions directly from OpenClaw chat.
Read, Post, and Search X/Twitter Directly from OpenClaw Chat
X/Twitter remains one of the highest-signal real-time information channels available — tech announcements, industry commentary, breaking news, and niche community discussions flow through it faster than any other platform. The OpenClaw X/Twitter skill gives you programmatic read and write access to all of this from your AI agent workflow, letting you search discussions, monitor competitors, track hashtags, and publish posts without opening a browser.
The integration covers the full range of common X/Twitter interactions: post new tweets, read your home timeline, check your notifications and mentions, search the platform for any keyword or hashtag, look up specific user timelines, and retrieve thread context for any post. Because OpenClaw drives the interaction with natural language, you can describe what you want in plain terms — 'find all tweets mentioning our product from the last 24 hours with more than 10 likes' — and the skill translates that into the appropriate API queries.
Setting up the X/Twitter skill requires a few more steps than skills that use a single API key, because X/Twitter's API uses OAuth 1.0a with four credentials rather than a simple bearer token. You need to create a developer app on X's developer portal and generate access tokens for your specific account. The process takes about ten minutes once you have a developer account, and the extra steps are a one-time setup cost that pays off every time you interact with Twitter from OpenClaw without touching the web interface.
Integration method
The X/Twitter skill is a native ClawHub integration that authenticates with the X/Twitter API using OAuth 1.0a credentials. Once configured, OpenClaw can read your home timeline, search the platform, post tweets, check mentions, and monitor hashtags through natural language chat prompts. The skill handles all API authentication, rate limiting, and response parsing automatically.
Prerequisites
- OpenClaw installed and running (see openclaw.ai for installation instructions)
- ClawHub CLI available in your terminal (bundled with OpenClaw)
- An X/Twitter account you want to connect
- An X Developer account at developer.x.com (free tier available)
- A Twitter developer app with read and write permissions and OAuth 1.0a configured
Step-by-step guide
Install the X/Twitter Skill via ClawHub
Install the X/Twitter Skill via ClawHub
Open your terminal and run the ClawHub install command. The skill downloads from the ClawHub registry and registers with your local OpenClaw instance. The install output will show four required configuration variables — you will generate these in the next step. The x-twitter skill requires more credentials than single-key integrations because X/Twitter uses OAuth 1.0a with both app-level and user-level credentials. This is normal and necessary for both reading your timeline and posting on your behalf. Don't be concerned by the number of required config keys — the developer portal provides all of them in one place. If `clawhub install` fails, check your network connection and retry. Use `clawhub install x-twitter --force` if a partial install is causing issues.
1clawhub install x-twitterPro tip: Run `clawhub info x-twitter` to see the full list of configuration variables and their descriptions before proceeding to the developer portal.
Expected result: Terminal confirms installation with a message listing the four required config keys: X_API_KEY, X_API_SECRET, X_ACCESS_TOKEN, and X_ACCESS_TOKEN_SECRET.
Create a Twitter Developer App and Generate API Credentials
Create a Twitter Developer App and Generate API Credentials
Go to developer.x.com and sign in with your X/Twitter account. If this is your first time using the developer portal, you will need to apply for a developer account — the free Basic tier is sufficient for OpenClaw integration. The approval process is usually instant for existing accounts in good standing. Once inside the developer portal, click 'Create Project' (or navigate to Projects & Apps). Create a new project, then create a new App within that project. Give it a name like 'OpenClaw Integration'. After creating the app, navigate to the app's Settings tab. Under 'User authentication settings', click 'Set up'. Set app permissions to 'Read and Write' (you need write access to post tweets). The app type should be 'Web App, Automated App or Bot'. For the callback URI and website URL fields, you can use `http://localhost:8080` and `https://openclaw.ai` respectively — these are not used but required by the form. After saving settings, go to the 'Keys and tokens' tab. Here you'll find your API Key and API Secret (app-level credentials). Click 'Generate' next to Access Token and Secret — these are user-level credentials tied to your specific account. Copy all four values immediately and store them safely — the secrets are only shown once.
Pro tip: The X developer portal distinguishes between API Key/Secret (app-level, for authentication) and Access Token/Secret (user-level, for acting as your account). You need all four. If you regenerate any of them, the others remain valid — they are independent pairs.
Expected result: You have four credentials: API Key (starts with a character string), API Secret, Access Token (format: numeric-string), and Access Token Secret. All four are copied and ready to configure.
Configure All Four Credentials in OpenClaw
Configure All Four Credentials in OpenClaw
Add your four X/Twitter credentials to OpenClaw's configuration. Because there are four variables, using the `clawhub config set` command for each is clean and straightforward. Alternatively, add all four to your `~/.openclaw/.env` file in one edit session. The variable names must be exactly as shown — the skill checks for these specific names. After setting all four, run `clawhub reload` to apply the configuration. Verify each one with `clawhub config get` to confirm they're all properly set. If you're setting up OpenClaw for a team where multiple people need Twitter access, each person should generate their own Access Token and Access Token Secret from the same app — they authenticate as their own Twitter account. The API Key and API Secret are app-level and can be shared within a team.
1# Add to ~/.openclaw/.env2X_API_KEY=your-api-key-here3X_API_SECRET=your-api-secret-here4X_ACCESS_TOKEN=your-access-token-here5X_ACCESS_TOKEN_SECRET=your-access-token-secret-here67# Or set each via clawhub config8clawhub config set X_API_KEY your-api-key-here9clawhub config set X_API_SECRET your-api-secret-here10clawhub config set X_ACCESS_TOKEN your-access-token-here11clawhub config set X_ACCESS_TOKEN_SECRET your-access-token-secret-here1213# Verify all four are set14clawhub config get X_API_KEY15clawhub config get X_ACCESS_TOKEN1617clawhub reloadPro tip: After running `clawhub reload`, test the connection immediately with a simple read prompt before trying to post. Reading is a lower-stakes test that confirms the credentials are valid.
Expected result: All four config values return (masked) values when queried. OpenClaw confirms the x-twitter skill is active after reload.
Test the Skill with a Read Query and a Post
Test the Skill with a Read Query and a Post
Open OpenClaw chat and start with a read query — this tests your credentials without posting anything publicly. Ask OpenClaw to read your home timeline or search for a specific hashtag. A successful read confirms your API Key and API Secret are correct and that your Access Token is properly authorized. Once reading works, test posting with a simple tweet. Write something you don't mind appearing on your timeline — it will post immediately. Include a note to yourself that this is a test, so it's clear in your timeline history. The x-twitter skill returns rich metadata with posts: tweet ID, author, timestamp, text, likes, retweets, reply count, and any attached media URLs. Use this metadata in follow-up prompts — for example, 'reply to tweet ID 12345...' or 'retweet the post from @username about...'. RapidDev can help configure automated Twitter monitoring workflows in OpenClaw — for example, routing specific mention alerts to Slack or setting up competitor tracking that runs on a schedule.
Search Twitter for 'OpenClaw' and show me the 5 most recent tweets mentioning it. Include the author username, post date, like count, and full text.
Paste this in OpenClaw chat
Pro tip: If you get a 403 error on posting but reads work, double-check your app permissions in the X developer portal — the app must have 'Read and Write' permission enabled, not just 'Read'. You may need to regenerate your access tokens after changing app permissions.
Expected result: OpenClaw returns a list of tweets matching the search query with author details, timestamps, and engagement counts. The skill successfully authenticated and retrieved live data from X/Twitter.
Advanced Usage: Timeline Monitoring and Automated Engagement
Advanced Usage: Timeline Monitoring and Automated Engagement
Beyond basic reading and posting, the X/Twitter skill supports several advanced patterns: monitoring specific user timelines on a schedule, tracking hashtag trends over time, and building engagement workflows that draft replies to relevant mentions. **Mention monitoring**: Ask OpenClaw to check your mentions and filter for posts that require a response — questions from customers, positive feedback worth amplifying, or criticism worth addressing. OpenClaw can draft replies for you to review before posting. **List and timeline reading**: If you maintain Twitter lists of industry accounts, ask OpenClaw to read a list timeline and summarize the most important posts from the last 24 hours. This turns Twitter's overwhelming timeline into a curated digest. **Trend detection**: Search for a topic multiple times over a period and ask OpenClaw to identify whether engagement is growing. Combine with the Postiz or Upload Post skill to react quickly when a trend is accelerating. **Thread reading**: Ask OpenClaw to retrieve the full context of a thread by post ID — useful when someone replies to a conversation and you want to see the full chain before engaging.
Read my Twitter mentions from the last 6 hours. Categorize them as: questions needing a response, positive feedback I should like/retweet, and neutral/spam I can ignore. For any genuine questions, draft a short reply I could post.
Paste this in OpenClaw chat
1# Optional skill config2# ~/.openclaw/skills/x-twitter.yaml3x-twitter:4 default_count: 20 # number of results per query (max 100)5 include_retweets: false # exclude retweets from timeline reads6 default_language: en # filter search results by language7 tweet_mode: extended # get full text (not truncated at 140 chars)Pro tip: X/Twitter's free API tier has rate limits: 50 posts per month for writes, 500,000 reads per month. If you're building automated read-heavy monitoring, stay within these limits or upgrade your developer plan.
Expected result: OpenClaw returns a categorized list of mentions with drafted reply suggestions. The workflow confirms you can both read and prepare responses without opening the Twitter interface.
Common use cases
Hashtag and Keyword Monitoring
Search X/Twitter for specific hashtags, keywords, or phrases and extract the most engaged posts. Use this to track trending conversations in your industry, monitor what's being said about your brand, or find relevant discussions to join.
Search X for tweets mentioning 'OpenClaw' OR 'openclaw.ai' from the last 48 hours. Find posts with more than 5 likes or retweets. List them with the author, timestamp, engagement counts, and full text.
Copy this prompt to try it in OpenClaw
Competitor and Trend Intelligence
Monitor competitor accounts or industry hashtags to stay informed about product launches, community reactions, and emerging topics. OpenClaw can pull and summarize this information on demand without you manually scrolling Twitter.
Read the last 20 tweets from @anthropic, @openai, and @GoogleDeepMind. Summarize any product announcements or major news. Flag anything that sounds like a new model release or pricing change.
Copy this prompt to try it in OpenClaw
Engaging with Mentions and Conversations
Check your Twitter mentions and draft or post replies to relevant conversations from OpenClaw chat. This is useful for founders and creators who want to stay responsive on Twitter without spending hours in the interface.
Check my Twitter mentions from the last 24 hours. List any questions or comments that seem like they need a response. For the top 3 most important ones, draft a reply I could approve and post.
Copy this prompt to try it in OpenClaw
Troubleshooting
OpenClaw returns '401 Unauthorized' when trying to read or post on Twitter
Cause: One or more of the four OAuth credentials is incorrect, missing, or the access tokens have been revoked. This also occurs if app permissions changed after the access tokens were generated.
Solution: Run `clawhub config get` for all four variables to confirm they are set. If any are empty, re-set them. If all are set but the error persists, regenerate your Access Token and Access Token Secret from the X developer portal (Keys and tokens tab) and update them in OpenClaw config. Note: if you change app permissions after generating tokens, you must regenerate the tokens.
1# Verify all four credentials2clawhub config get X_API_KEY3clawhub config get X_API_SECRET4clawhub config get X_ACCESS_TOKEN5clawhub config get X_ACCESS_TOKEN_SECRET6clawhub reloadReading works but posting returns '403 Forbidden'
Cause: The Twitter developer app has 'Read Only' permissions instead of 'Read and Write'. Access tokens generated before changing to Read and Write permissions will not inherit the new permissions.
Solution: In the X developer portal, go to your app settings, change User authentication permissions to 'Read and Write', save the settings, then regenerate your Access Token and Access Token Secret. Update both values in OpenClaw config.
1# After regenerating tokens in developer portal2clawhub config set X_ACCESS_TOKEN new-access-token3clawhub config set X_ACCESS_TOKEN_SECRET new-access-token-secret4clawhub reloadclawhub install x-twitter fails with a registry error or hangs
Cause: Temporary ClawHub registry availability issue or rate limit on installs.
Solution: Wait 2-3 minutes and retry. Use `--force` if the install is stuck in a partial state.
1clawhub install x-twitter --forceOpenClaw X/Twitter search returns no results for keywords that clearly have tweets
Cause: The search syntax may need adjustment, or the default time window is filtering out results. X's API search defaults can be restrictive.
Solution: Specify the time window explicitly in your prompt ('from the last 24 hours', 'from this week'). Also check if the search term is being interpreted as an exact phrase — try breaking compound terms into separate words or using quotes intentionally.
Best practices
- Store all four X/Twitter credentials (X_API_KEY, X_API_SECRET, X_ACCESS_TOKEN, X_ACCESS_TOKEN_SECRET) in your OpenClaw .env file, never in chat prompts or code repositories.
- Set your Twitter app permissions to 'Read and Write' before generating Access Tokens — tokens generated under 'Read Only' permissions won't work for posting even after you upgrade the app.
- Be explicit about time ranges in search prompts ('last 24 hours', 'this week') — X's API has default time windows that may return older content than you expect.
- Monitor your X developer plan's API rate limits — the free tier allows 50 posts per month and 500K reads per month. Automated monitoring workflows can consume read quotas quickly.
- If you're monitoring competitor accounts or specific hashtags regularly, ask OpenClaw to summarize and diff results rather than returning raw data — this reduces the cognitive load of reviewing large result sets.
- Use the tweet_mode: extended config option to avoid truncated tweet text — by default the API returns text truncated at 140 characters even for longer tweets.
- For brand monitoring, search for both your brand name as a keyword AND as a hashtag — users mention brands both ways and the results sets can differ significantly.
Alternatives
Postiz supports Twitter/X as one of many platforms in a unified social media scheduling workflow — better for planning content calendars across multiple platforms.
Upload Post publishes to Twitter/X immediately alongside other platforms — better when you need instant cross-platform publishing rather than Twitter-specific features.
Reddit Read-Only monitors longer-form community discussions — use it alongside X/Twitter for a more complete picture of public sentiment across different platform types.
The LinkedIn skill handles professional network posting and engagement — use it alongside X/Twitter to cover both real-time social and professional audiences.
Frequently asked questions
How do I install X/Twitter in OpenClaw?
Run `clawhub install x-twitter` in your terminal. Then create a developer app at developer.x.com, set app permissions to 'Read and Write', and generate your API Key, API Secret, Access Token, and Access Token Secret from the Keys and Tokens tab. Add all four to OpenClaw config with `clawhub config set` for each, then run `clawhub reload`.
Why does the OpenClaw X Twitter skill need four API credentials?
X/Twitter uses OAuth 1.0a authentication, which requires two pairs of credentials: API Key + API Secret (app-level, identifying your developer application) and Access Token + Access Token Secret (user-level, authorizing the app to act as your specific account). All four are required for read and write access. This is X's standard API authentication model — it's the same for any app integrating with the X API.
Can I use the OpenClaw X/Twitter skill to read other people's tweets?
Yes — searching the public Twitter feed, reading public user timelines, and looking up specific tweets by ID all work without any special permission. The skill can read any public content on X/Twitter. Reading private (protected) accounts or DMs requires additional authorization that the standard skill configuration does not support.
Does RapidDev help with OpenClaw X/Twitter integration setup?
Yes — RapidDev can help you set up the X/Twitter skill, configure monitoring workflows, and connect Twitter data to other OpenClaw skills like Slack or email for automated alerting. The credential setup described on this page is self-serve, but complex monitoring or engagement automation workflows benefit from a structured configuration approach.
Why is OpenClaw X search not finding recent tweets?
X's API search has a default time window that may exclude very recent content that hasn't been indexed yet. Also, the free developer tier has some search restrictions. Try specifying the time range explicitly in your prompt ('from the last 2 hours') and ensure your developer app is approved and in good standing. If searches return empty results consistently, verify your API credentials are correct and the app has Read permissions.
How many tweets can I post per month using the OpenClaw X/Twitter skill?
The X developer free tier allows 50 write operations (posts, likes, follows) per month. This is typically sufficient for manual use via OpenClaw chat. If you're building automated posting workflows, you may need to upgrade to a paid X developer plan. Read operations have much higher limits — 500,000 reads per month on the free tier.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation