CE

ClawExplorer

OpenClaw skill

aisa-twitter-api

An OpenClaw skill that enables agents to interact with the Twitter API v2. It supports posting tweets and replies, fetching the home timeline, searching recent tweets, and retrieving user information. The skill requires a Twitter Bearer Token for authentication.

Files

Review the files below to add this skill to your agents.

Security notice: review the SKILL.md file and repository content first before using any third-party skill.

SKILL.md content

---
name: Twitter Command Center (Search + Post)
description: "Search X (Twitter) in real time, extract relevant posts, and publish tweets/replies instantly—perfect for social listening, engagement, and rapid content ops."
homepage: https://openclaw.ai
metadata: {"openclaw":{"emoji":"🐦","requires":{"bins":["curl","python3"],"env":["AISA_API_KEY"]},"primaryEnv":"AISA_API_KEY"}}
---

# OpenClaw Twitter 🐦

**Twitter/X data access and automation for autonomous agents. Powered by AIsa.**

One API key. Full Twitter intelligence.

## 🔥 What Can You Do?

### Monitor Influencers
```
"Get Elon Musk's latest tweets and notify me of any AI-related posts"
```

### Track Trends
```
"What's trending on Twitter worldwide right now?"
```

### Social Listening
```
"Search for tweets mentioning our product and analyze sentiment"
```

### Automated Engagement
```
"Like and retweet posts from @OpenAI that mention GPT-5"
```

### Competitor Intel
```
"Monitor @anthropic and @GoogleAI - alert me on new announcements"
```

## Quick Start

```bash
export AISA_API_KEY="your-key"
```

## Core Capabilities

### Read Operations (No Login Required)

```bash
# Get user info
curl "https://api.aisa.one/apis/v1/twitter/user/info?userName=elonmusk" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Get user's latest tweets
curl "https://api.aisa.one/apis/v1/twitter/user/user_last_tweet?userName=elonmusk" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Advanced tweet search (queryType is required: Latest or Top)
curl "https://api.aisa.one/apis/v1/twitter/tweet/advanced_search?query=AI+agents&queryType=Latest" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Search top tweets
curl "https://api.aisa.one/apis/v1/twitter/tweet/advanced_search?query=AI+agents&queryType=Top" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Get trending topics (worldwide)
curl "https://api.aisa.one/apis/v1/twitter/trends?woeid=1" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Search users by keyword
curl "https://api.aisa.one/apis/v1/twitter/user/search_user?keyword=AI+researcher" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Get tweets by ID
curl "https://api.aisa.one/apis/v1/twitter/tweet/tweetById?tweet_ids=123456789" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Get user followers
curl "https://api.aisa.one/apis/v1/twitter/user/user_followers?userName=elonmusk" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Get user followings
curl "https://api.aisa.one/apis/v1/twitter/user/user_followings?userName=elonmusk" \
  -H "Authorization: Bearer $AISA_API_KEY"
```

### Write Operations (Requires Login)

> ⚠️ **Warning**: Posting requires account login. Use responsibly to avoid rate limits or account suspension.

```bash
# Step 1: Login first (async, check status after)
curl -X POST "https://api.aisa.one/apis/v1/twitter/user_login_v3" \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"user_name":"myaccount","email":"me@example.com","password":"xxx","proxy":"http://user:pass@ip:port"}'

# Step 2: Check login status
curl "https://api.aisa.one/apis/v1/twitter/get_my_x_account_detail_v3?user_name=myaccount" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Send tweet
curl -X POST "https://api.aisa.one/apis/v1/twitter/send_tweet_v3" \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"user_name":"myaccount","text":"Hello from OpenClaw!"}'

# Like a tweet
curl -X POST "https://api.aisa.one/apis/v1/twitter/like_tweet_v3" \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"user_name":"myaccount","tweet_id":"1234567890"}'

# Retweet
curl -X POST "https://api.aisa.one/apis/v1/twitter/retweet_v3" \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"user_name":"myaccount","tweet_id":"1234567890"}'

# Update profile
curl -X POST "https://api.aisa.one/apis/v1/twitter/update_profile_v3" \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"user_name":"myaccount","name":"New Name","bio":"New bio"}'
```

## Python Client

```bash
# User operations
python3 {baseDir}/scripts/twitter_client.py user-info --username elonmusk
python3 {baseDir}/scripts/twitter_client.py tweets --username elonmusk
python3 {baseDir}/scripts/twitter_client.py followers --username elonmusk
python3 {baseDir}/scripts/twitter_client.py followings --username elonmusk

# Search & Discovery
python3 {baseDir}/scripts/twitter_client.py search --query "AI agents"
python3 {baseDir}/scripts/twitter_client.py user-search --keyword "AI researcher"
python3 {baseDir}/scripts/twitter_client.py trends --woeid 1

# Post operations (requires login)
python3 {baseDir}/scripts/twitter_client.py login --username myaccount --email me@example.com --password xxx --proxy "http://user:pass@ip:port"
python3 {baseDir}/scripts/twitter_client.py post --username myaccount --text "Hello!"
python3 {baseDir}/scripts/twitter_client.py like --username myaccount --tweet-id 1234567890
python3 {baseDir}/scripts/twitter_client.py retweet --username myaccount --tweet-id 1234567890
```

## API Endpoints Reference

| Endpoint | Method | Description |
|----------|--------|-------------|
| `/twitter/user/info` | GET | Get user profile |
| `/twitter/user/user_last_tweet` | GET | Get user's recent tweets |
| `/twitter/user/user_followers` | GET | Get user followers |
| `/twitter/user/user_followings` | GET | Get user followings |
| `/twitter/user/search_user` | GET | Search users by keyword |
| `/twitter/tweet/advanced_search` | GET | Advanced tweet search |
| `/twitter/tweet/tweetById` | GET | Get tweets by IDs |
| `/twitter/trends` | GET | Get trending topics |
| `/twitter/user_login_v3` | POST | Login to account |
| `/twitter/send_tweet_v3` | POST | Send a tweet |
| `/twitter/like_tweet_v3` | POST | Like a tweet |
| `/twitter/retweet_v3` | POST | Retweet |

## Pricing

| API | Cost |
|-----|------|
| Twitter read query | ~$0.0004 |
| Twitter post/like/retweet | ~$0.001 |

Every response includes `usage.cost` and `usage.credits_remaining`.

## Get Started

1. Sign up at [aisa.one](https://aisa.one)
2. Get your API key
3. Add credits (pay-as-you-go)
4. Set environment variable: `export AISA_API_KEY="your-key"`

## Full API Reference

See [API Reference](https://aisa.mintlify.app/api-reference/introduction) for complete endpoint documentation.

How this skill works

  • The skill is named 'aisa-twitter-api'
  • It provides Twitter API v2 functionality for posting tweets
  • Configuration requires BEARER_TOKEN from Twitter developer portal
  • Supports task 'post_tweet' with required parameter 'text'
  • Internally uses Python requests library
  • Authenticates requests using Authorization: Bearer {BEARER_TOKEN}
  • Posts to https://api.twitter.com/2/tweets with JSON body {"text": "{text}"}
  • Parses successful response to return tweet metadata including id
  • Handles API errors by returning error details

When to use it

  • When posting a new tweet via the Aisa Twitter API
  • When replying to an existing tweet using the Aisa Twitter API
  • When retrieving a user's recent tweets with the Aisa Twitter API
  • When searching for tweets matching specific keywords via the Aisa Twitter API

Best practices

  • Obtain Twitter API v2 Bearer Token from developer.twitter.com
  • Store bearer_token securely using environment variables
  • Ensure Twitter app has Elevated access for v2 endpoints
  • Do not hardcode or commit bearer_token to source control
  • Handle Twitter API rate limits in skill logic

Example use cases

  • Post a new tweet: Uses the post_tweet tool to publish a new message on Twitter with the provided text.
  • Retrieve user tweets: Uses the get_user_tweets tool to fetch recent tweets from a specified Twitter username.
  • Search for tweets: Uses the search_tweets tool to find tweets matching a given search query.

FAQs

What is the purpose of the aisa-twitter-api skill?

The Aisa Twitter API skill enables OpenClaw agents to interact with Twitter (now X) using Aisa's proxy service. This skill provides several tools for searching tweets, posting tweets, retrieving user information, and more.

How is authentication handled for the aisa-twitter-api skill?

This skill requires an Aisa API key. Set the environment variable `AISA_API_KEY`.

What tools are provided by the aisa-twitter-api skill?

search_tweets, post_tweet, get_user_by_username, get_user_tweets

What is the description of the search_tweets tool?

Search for Tweets based on a query.

What parameters does the search_tweets tool require?

- `query` (string, required): The search query. - `max_results` (integer, optional): Number of tweets to return. Default: 10.

What does the post_tweet tool do?

Post a new tweet.

What parameter is required for the post_tweet tool?

`text` (string, required): The text of the tweet.

What is the function of the get_user_by_username tool?

Get user information by username.

What parameters does get_user_tweets accept?

- `username` (string, required) - `max_results` (integer, optional, default 10)

More similar skills to explore

  • achurch

    An OpenClaw skill for church administration that handles member management, event scheduling, sermon retrieval, and donation processing. It provides tools to list members, add new members, schedule events, fetch sermons, and record donations.

  • agent-config

    An OpenClaw skill that enables agents to manage their configuration by loading from files, environment variables, or remote sources. It supports retrieving, setting, and validating configuration values. The skill allows for hot-reloading of configurations.

  • agent-council

    An OpenClaw skill named agent-council that enables the primary agent to summon a council of specialized sub-agents for deliberating on tasks. The council members discuss the query from unique perspectives, propose solutions, and vote to select the best response. The skill outputs the winning proposal with supporting rationale from the council.

  • agent-identity-kit

    An OpenClaw skill that equips agents with tools to craft, manage, and evolve digital identities, including generating personas, bios, avatars, and communication styles. It supports creating detailed agent personas with name, background, goals, personality traits; crafting bios for specific platforms; designing avatars; tuning voice and style; and adapting identities to new contexts.

  • agenticflow-skill

    An OpenClaw skill that provides tools for interacting with Agentic Flow. The tools enable agents to create agentic flows with defined tasks, execute existing flows, and retrieve flow status and outputs.

  • agentlens

    AgentLens is an OpenClaw skill that enables agents to inspect the internal cognition and actions of other agents. It provides visibility into reasoning traces (thoughts), tool calls and arguments, retrieved memories, and response generation. The skill supports analysis in multi-agent conversations via the "inspect" action targeting a specific agent.