# Send Twitter/X API to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "twitter-x-api",
    "name": "Twitter/X API",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/klemenska/twitter-x-api",
    "canonicalUrl": "https://clawhub.ai/klemenska/twitter-x-api",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/twitter-x-api",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=twitter-x-api",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "references/api-limits.md",
      "references/search-operators.md",
      "scripts/tweet.py"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "twitter-x-api",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-10T07:55:02.004Z",
      "expiresAt": "2026-05-17T07:55:02.004Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=twitter-x-api",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=twitter-x-api",
        "contentDisposition": "attachment; filename=\"twitter-x-api-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "twitter-x-api"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/twitter-x-api"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/twitter-x-api",
    "downloadUrl": "https://openagent3.xyz/downloads/twitter-x-api",
    "agentUrl": "https://openagent3.xyz/skills/twitter-x-api/agent",
    "manifestUrl": "https://openagent3.xyz/skills/twitter-x-api/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/twitter-x-api/agent.md"
  }
}
```
## Documentation

### Twitter/X API Skill

Interact with X (Twitter) via API v2 for reading, posting, replying, DMs, search, and analytics.

### Credentials

Store credentials in environment variables or ~/.config/twitter/credentials.json:

export TWITTER_API_KEY="your-api-key"
export TWITTER_API_SECRET="your-api-secret"
export TWITTER_ACCESS_TOKEN="your-access-token"
export TWITTER_ACCESS_SECRET="your-access-secret"
export TWITTER_BEARER_TOKEN="your-bearer-token"  # For read-only operations

Or create credentials file:

mkdir -p ~/.config/twitter
cat > ~/.config/twitter/credentials.json << 'EOF'
{
  "api_key": "your-api-key",
  "api_secret": "your-api-secret",
  "access_token": "your-access-token",
  "access_secret": "your-access-secret",
  "bearer_token": "your-bearer-token"
}
EOF
chmod 600 ~/.config/twitter/credentials.json

### Install Dependencies

pip install tweepy

### Quick Reference

TaskCommandPost tweet{baseDir}/scripts/tweet.py post "text"Post with image{baseDir}/scripts/tweet.py post "text" --media image.pngReply{baseDir}/scripts/tweet.py reply TWEET_ID "text"Thread{baseDir}/scripts/tweet.py thread "tweet1" "tweet2" ...Get timeline{baseDir}/scripts/tweet.py timeline [--count 20]Get mentions{baseDir}/scripts/tweet.py mentions [--count 20]Get DMs{baseDir}/scripts/tweet.py dms [--count 20]Send DM{baseDir}/scripts/tweet.py dm USERNAME "message"Search{baseDir}/scripts/tweet.py search "query" [--count 20]User info{baseDir}/scripts/tweet.py user USERNAMETweet info{baseDir}/scripts/tweet.py show TWEET_IDAnalytics{baseDir}/scripts/tweet.py analytics TWEET_ID

### tweet.py

Main script for all Twitter operations. Run with --help for details:

{baseDir}/scripts/tweet.py --help
{baseDir}/scripts/tweet.py post --help

### Common Workflows

Post a simple tweet:

{baseDir}/scripts/tweet.py post "Hello, world!"

Post with image:

{baseDir}/scripts/tweet.py post "Check this out!" --media photo.png
{baseDir}/scripts/tweet.py post "Multiple images" --media img1.png --media img2.png

Reply to a tweet:

{baseDir}/scripts/tweet.py reply 1234567890 "Great point!"

Post a thread:

{baseDir}/scripts/tweet.py thread \\
  "First tweet in thread" \\
  "Second tweet" \\
  "Third tweet"

Read your mentions:

{baseDir}/scripts/tweet.py mentions --count 50

Search for tweets:

{baseDir}/scripts/tweet.py search "openclaw agent" --count 20
{baseDir}/scripts/tweet.py search "#AI lang:en" --count 20

Get user info:

{baseDir}/scripts/tweet.py user elonmusk

Send a DM:

{baseDir}/scripts/tweet.py dm username "Hello from OpenClaw!"

View tweet analytics:

{baseDir}/scripts/tweet.py analytics 1234567890

### API Tiers & Limits

TierCostReadWriteSearchFree$0Limited--Basic$100/mo10k/mo1.5k/mo50/moPro$5000/mo1M/mo300k/mo500/mo

Free tier can only post tweets (no read access to timeline/mentions).
Basic tier required for reading mentions, timeline, and search.
Write-only operations work on free tier.

See {baseDir}/references/api-limits.md for detailed rate limits.

### Error Handling

Common errors:

ErrorCauseSolution403 ForbiddenInsufficient tierUpgrade API tier or check endpoint access429 Too Many RequestsRate limit hitWait and retry; check rate limit headers401 UnauthorizedInvalid credentialsVerify API keys and tokens404 Not FoundTweet/user deletedHandle gracefully, inform user422 UnprocessableDuplicate tweetWait before posting same content

### Notes

Rate limits: X API has strict rate limits. Scripts include retry logic.
Media uploads: Images must be <5MB (PNG/JPG) or <15MB (GIF). Videos <512MB.
Character limit: 280 characters per tweet. Threads for longer content.
DMs: Require OAuth 1.0a user context (not Bearer token).
Search operators: {baseDir}/references/search-operators.md for advanced queries.

### Related Files

{baseDir}/scripts/tweet.py - Main CLI for all operations
{baseDir}/references/api-limits.md - Detailed rate limits by endpoint
{baseDir}/references/search-operators.md - Twitter search syntax
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: klemenska
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-10T07:55:02.004Z
- Expires at: 2026-05-17T07:55:02.004Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/twitter-x-api)
- [Send to Agent page](https://openagent3.xyz/skills/twitter-x-api/agent)
- [JSON manifest](https://openagent3.xyz/skills/twitter-x-api/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/twitter-x-api/agent.md)
- [Download page](https://openagent3.xyz/downloads/twitter-x-api)