Twitter Command Center
Twitter/X data access and automation for AI agents. Powered by AIsa.
One API key. Full Twitter intelligence. No scraping, no cookies, no proxies.
Setup
export AISA_API_KEY="your-key"
Get a key at aisa.one. Pay-as-you-go, ~$0.0004 per read query.
Typical Workflow
- User asks about Twitter data → skill activates
- Agent picks the right endpoint from the reference table below
- Agent runs
curlor the bundled Python client - Agent presents structured results
Read Operations
All read endpoints use GET with Authorization: Bearer $AISA_API_KEY.
Users
# Profile
curl "https://api.aisa.one/apis/v1/twitter/user/info?userName=elonmusk" \
-H "Authorization: Bearer $AISA_API_KEY"
# Recent 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
curl "https://api.aisa.one/apis/v1/twitter/user/followers?userName=elonmusk" \
-H "Authorization: Bearer $AISA_API_KEY"
# Search users
curl "https://api.aisa.one/apis/v1/twitter/user/search?query=AI+researcher" \
-H "Authorization: Bearer $AISA_API_KEY"
# Check follow relationship
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"
Tweets
# Search tweets (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"
# Get tweet by ID
curl "https://api.aisa.one/apis/v1/twitter/tweets?tweet_ids=1895096451033985024" \
-H "Authorization: Bearer $AISA_API_KEY"
# Replies / quotes / retweeters / thread
curl "https://api.aisa.one/apis/v1/twitter/tweet/replies?tweetId=1895096451033985024" \
-H "Authorization: Bearer $AISA_API_KEY"
Trends, Lists, Communities & Spaces
# Worldwide trends
curl "https://api.aisa.one/apis/v1/twitter/trends?woeid=1" \
-H "Authorization: Bearer $AISA_API_KEY"
# Community info
curl "https://api.aisa.one/apis/v1/twitter/community/info?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"
Posting (OAuth Relay)
No passwords or cookies. Uses AIsa's OAuth relay.
Important: Post endpoints use aisa_api_key in the JSON body, NOT the Authorization header.
# 1. Get authorization URL — user opens this in browser
curl -X POST "https://api.aisa.one/apis/v1/twitter/auth_twitter" \
-H "Content-Type: application/json" \
-d "{\"aisa_api_key\":\"$AISA_API_KEY\"}"
# 2. After user authorizes in browser, publish
curl -X POST "https://api.aisa.one/apis/v1/twitter/post_twitter" \
-H "Content-Type: application/json" \
-d "{\"aisa_api_key\":\"$AISA_API_KEY\",\"content\":\"Hello from my AI agent!\"}"
Gotchas
- queryType is required for tweet search — must be
LatestorTop. Omitting it returns an error. - Post endpoints use body auth, not Bearer header. Send
aisa_api_keyin JSON body. - verifiedFollowers requires
user_id(numeric), notuserName. - Do not claim a post succeeded until
post_twitterreturns success. - Never ask for Twitter passwords — only use the OAuth relay flow.
- Every response includes
usage.costandusage.credits_remaining.
Python Client
A bundled client is available at scripts/twitter_client.py:
# User operations
python3 scripts/twitter_client.py user-info --username elonmusk
python3 scripts/twitter_client.py tweets --username elonmusk
python3 scripts/twitter_client.py search --query "AI agents"
python3 scripts/twitter_client.py trends --woeid 1
# Posting
python3 scripts/twitter_client.py authorize
python3 scripts/twitter_client.py post --text "Hello from my agent"
See references/api-endpoints.md for the full endpoint reference with all parameters.