> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Twitter Autopilot

> Full X/Twitter intelligence for autonomous agents — profiles, timelines, mentions, followers, tweet search, trends, lists, communities, and Spaces. Plus OAuth-gated write operations for posting, liking, and following.

[View on GitHub →](https://github.com/AIsa-team/agent-skills/tree/main/twitter-autopilot)

**Full Twitter intelligence for autonomous agents.** One `AISA_API_KEY` unlocks every read endpoint; OAuth unlocks write actions (post, like, follow).

## Install

First, install the AIsa CLI if you have not already:

```bash theme={null}
npm install -g @aisa-one/cli
```

Then install the skill:

```bash theme={null}
aisa skills install twitter-autopilot
```

## What can agents do with it?

<CardGroup cols={2}>
  <Card title="Monitor influencers" icon="user-magnifying-glass">
    "Get Elon Musk's latest tweets and notify me of AI-related posts."
  </Card>

  <Card title="Track trends" icon="arrow-trend-up">
    "What's trending on Twitter worldwide right now?"
  </Card>

  <Card title="Social listening" icon="ear-listen">
    "Search for tweets mentioning our product and analyze sentiment."
  </Card>

  <Card title="Competitor intel" icon="eye">
    "Monitor @anthropic and @GoogleAI — alert me on new announcements."
  </Card>

  <Card title="Thread context" icon="comments">
    "Fetch the full conversation thread around a viral tweet."
  </Card>

  <Card title="Engagement workflows" icon="thumbs-up">
    "Like, unlike, follow, or unfollow via OAuth (requires user consent)."
  </Card>
</CardGroup>

## Core capabilities

* **Users** — profile info, "about" metadata, batch lookup by IDs, latest tweets, mentions, followers, followings, verified followers, follow-relationship check, keyword search
* **Tweets** — advanced search (Latest/Top), by IDs, replies, quotes, retweeters, full thread context, article extraction
* **Trends** — worldwide and regional trending topics by WOEID
* **Lists** — members and followers
* **Communities** — info, members, moderators, tweets, cross-community search
* **Spaces** — Space detail lookup
* **Engagement (OAuth)** — like / unlike / follow / unfollow / post / reply / quote via the local relay

## Quick start

```bash theme={null}
export AISA_API_KEY="your-key"
```

### User endpoints

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

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

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

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

# Verified followers (note: requires numeric user_id, not userName)
curl "https://api.aisa.one/apis/v1/twitter/user/verifiedFollowers?user_id=44196397" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Follow-relationship check
curl "https://api.aisa.one/apis/v1/twitter/user/check_follow_relationship?source_user_name=elonmusk&target_user_name=BillGates" \
  -H "Authorization: Bearer $AISA_API_KEY"

# User search
curl "https://api.aisa.one/apis/v1/twitter/user/search?query=AI+researcher" \
  -H "Authorization: Bearer $AISA_API_KEY"
```

### Tweet endpoints

```bash theme={null}
# Advanced 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"

# Tweets by IDs
curl "https://api.aisa.one/apis/v1/twitter/tweets?tweet_ids=1895096451033985024" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Replies, quotes, retweeters, thread context
curl "https://api.aisa.one/apis/v1/twitter/tweet/replies?tweetId=1895096451033985024" \
  -H "Authorization: Bearer $AISA_API_KEY"
curl "https://api.aisa.one/apis/v1/twitter/tweet/thread_context?tweetId=1895096451033985024" \
  -H "Authorization: Bearer $AISA_API_KEY"
```

### Trends, lists, communities, Spaces

```bash theme={null}
# Worldwide trends
curl "https://api.aisa.one/apis/v1/twitter/trends?woeid=1" \
  -H "Authorization: Bearer $AISA_API_KEY"

# List members
curl "https://api.aisa.one/apis/v1/twitter/list/members?list_id=1585430245762441216" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Community tweets
curl "https://api.aisa.one/apis/v1/twitter/community/tweets?community_id=1708485837274263614" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Space detail
curl "https://api.aisa.one/apis/v1/twitter/spaces/detail?space_id=1dRJZlbLkjexB" \
  -H "Authorization: Bearer $AISA_API_KEY"
```

## Python client

```bash theme={null}
# User
python3 scripts/twitter_client.py user-info --username elonmusk
python3 scripts/twitter_client.py user-about --username elonmusk
python3 scripts/twitter_client.py tweets --username elonmusk
python3 scripts/twitter_client.py mentions --username elonmusk
python3 scripts/twitter_client.py followers --username elonmusk
python3 scripts/twitter_client.py followings --username elonmusk
python3 scripts/twitter_client.py verified-followers --user-id 44196397
python3 scripts/twitter_client.py check-follow --source elonmusk --target BillGates
python3 scripts/twitter_client.py user-search --query "AI researcher"

# Search & trends
python3 scripts/twitter_client.py search --query "AI agents"
python3 scripts/twitter_client.py search --query "AI agents" --type Top
python3 scripts/twitter_client.py trends --woeid 1

# Tweets
python3 scripts/twitter_client.py detail --tweet-ids 1895096451033985024
python3 scripts/twitter_client.py replies --tweet-id 1895096451033985024
python3 scripts/twitter_client.py quotes --tweet-id 1895096451033985024
python3 scripts/twitter_client.py retweeters --tweet-id 1895096451033985024
python3 scripts/twitter_client.py thread --tweet-id 1895096451033985024

# Lists & communities
python3 scripts/twitter_client.py list-members --list-id 1585430245762441216
python3 scripts/twitter_client.py community-info --community-id 1708485837274263614
python3 scripts/twitter_client.py community-tweets --community-id 1708485837274263614

# Engagement (OAuth-gated; use the local relay)
python3 scripts/twitter_engagement_client.py like-latest --user "@elonmusk"
python3 scripts/twitter_engagement_client.py follow-user --user "@elonmusk"
```

## Endpoint reference

| Endpoint                                           | Method | Purpose                                                                                            |
| -------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------- |
| `/twitter/user/info`                               | GET    | [User profile](/api-reference/twitter/get_twitter-user-info)                                       |
| `/twitter/user_about`                              | GET    | [User about](/api-reference/twitter/get_twitter-user-about)                                        |
| `/twitter/user/batch_info_by_ids`                  | GET    | [Batch user info](/api-reference/twitter/get_twitter-user-batch-info-by-ids)                       |
| `/twitter/user/last_tweets`                        | GET    | [User last tweets](/api-reference/twitter/get_twitter-user-last-tweets)                            |
| `/twitter/user/mentions`                           | GET    | [User mentions](/api-reference/twitter/get_twitter-user-mentions)                                  |
| `/twitter/user/followers`                          | GET    | [User followers](/api-reference/twitter/get_twitter-user-followers)                                |
| `/twitter/user/followings`                         | GET    | [User followings](/api-reference/twitter/get_twitter-user-followings)                              |
| `/twitter/user/verifiedFollowers`                  | GET    | [Verified followers](/api-reference/twitter/get_twitter-user-verifiedfollowers)                    |
| `/twitter/user/check_follow_relationship`          | GET    | [Follow relationship](/api-reference/twitter/get_twitter-user-check-follow-relationship)           |
| `/twitter/user/search`                             | GET    | [User search](/api-reference/twitter/get_twitter-user-search)                                      |
| `/twitter/tweet/advanced_search`                   | GET    | [Tweet advanced search](/api-reference/twitter/get_twitter-tweet-advanced-search)                  |
| `/twitter/tweets`                                  | GET    | [Tweets by IDs](/api-reference/twitter/get_twitter-tweets)                                         |
| `/twitter/tweet/replies`                           | GET    | [Tweet replies](/api-reference/twitter/get_twitter-tweet-replies)                                  |
| `/twitter/tweet/quotes`                            | GET    | [Tweet quotes](/api-reference/twitter/get_twitter-tweet-quotes)                                    |
| `/twitter/tweet/retweeters`                        | GET    | [Tweet retweeters](/api-reference/twitter/get_twitter-tweet-retweeters)                            |
| `/twitter/tweet/thread_context`                    | GET    | [Thread context](/api-reference/twitter/get_twitter-tweet-thread-context)                          |
| `/twitter/article`                                 | GET    | [Article by tweet](/api-reference/twitter/get_twitter-article)                                     |
| `/twitter/trends`                                  | GET    | [Trends](/api-reference/twitter/get_twitter-trends)                                                |
| `/twitter/list/members`                            | GET    | [List members](/api-reference/twitter/get_twitter-list-members)                                    |
| `/twitter/list/followers`                          | GET    | [List followers](/api-reference/twitter/get_twitter-list-followers)                                |
| `/twitter/community/info`                          | GET    | [Community info](/api-reference/twitter/get_twitter-community-info)                                |
| `/twitter/community/members`                       | GET    | [Community members](/api-reference/twitter/get_twitter-community-members)                          |
| `/twitter/community/moderators`                    | GET    | [Community moderators](/api-reference/twitter/get_twitter-community-moderators)                    |
| `/twitter/community/tweets`                        | GET    | [Community tweets](/api-reference/twitter/get_twitter-community-tweets)                            |
| `/twitter/community/get_tweets_from_all_community` | GET    | [All-community search](/api-reference/twitter/get_twitter-community-get-tweets-from-all-community) |
| `/twitter/spaces/detail`                           | GET    | [Space detail](/api-reference/twitter/get_twitter-spaces-detail)                                   |

## Get started

1. Sign up at [aisa.one](https://aisa.one) (new accounts start with \$2 free credit).
2. Generate an API key from the console.
3. `export AISA_API_KEY="your-key"` and install the skill:
   ```bash theme={null}
   npm install -g @aisa-one/cli
   aisa skills install twitter-autopilot
   ```
4. For write actions (post, like, follow), complete OAuth via the local relay — see `./references/post_twitter.md` and `./references/engage_twitter.md` in the skill folder.

## Related

<CardGroup cols={3}>
  <Card title="Twitter API reference" icon="twitter" href="/api-reference/twitter/get_twitter-user-info">
    Every read endpoint with interactive playgrounds.
  </Card>

  <Card title="Authentication" icon="key" href="/guides/authentication">
    Bearer-token auth plus OAuth for write actions.
  </Card>

  <Card title="Rate Limits" icon="gauge-high" href="/api-reference/rate-limits">
    Twitter RPM caps per key.
  </Card>
</CardGroup>
