Skip to main content

Overview

The favorite and unfavorite commands manage your Twitter bookmarks collection. Bookmarks are private - only you can see which tweets you’ve bookmarked.
In Twitter’s API terminology, bookmarks are referred to as “favorites”, which is different from “likes”. The CLI uses the favorite/unfavorite commands for bookmark management.

Bookmark a Tweet

twitter favorite <tweet_id>
Save a tweet to your private bookmarks collection for later reference.

Remove a Bookmark

twitter unfavorite <tweet_id>
Remove a tweet from your bookmarks collection.

Examples

Bookmark a Tweet

twitter favorite 1234567890123456789
Output:
🔖 Bookmarking tweet 1234567890123456789...
✅ Done.

Remove a Bookmark

twitter unfavorite 1234567890123456789
Output:
🔖 Removing bookmark 1234567890123456789...
✅ Done.

View Your Bookmarks

To see all your bookmarked tweets:
twitter favorites
This displays your bookmark collection. See the Favorites command for more details.

Command Reference

Favorite (Bookmark)

Arguments:
  • tweet_id (required): The numeric tweet ID to bookmark
Syntax:
twitter favorite <tweet_id>

Unfavorite (Remove Bookmark)

Arguments:
  • tweet_id (required): The numeric tweet ID to remove from bookmarks
Syntax:
twitter unfavorite <tweet_id>

Finding Tweet IDs

You can find tweet IDs from:
  1. Tweet URL: https://x.com/user/status/[TWEET_ID]
  2. Feed commands: twitter feed, twitter search
  3. Tweet detail: twitter tweet <url>
Example URL:
https://x.com/elonmusk/status/1234567890123456789
                              └─ This is the tweet ID

Rate Limits and Anti-Detection

Private Collection: Bookmarks are private and not visible to other users. They’re perfect for saving content without publicly liking it.
Rate Limit Protection: twitter-cli automatically adds random delays (1.5-4 seconds) after bookmark operations to avoid triggering anti-bot detection.

Anti-Detection Features

The CLI includes several features to avoid detection:
  • Random delays: 1.5-4 second waits after operations
  • Chrome impersonation: TLS fingerprint matching real browsers
  • Transaction IDs: Dynamic generation for each request
  • Exponential backoff: Automatic retry logic on rate limits

Rate Limit Guidelines

Safe usage:
  • Maximum: ~100 bookmarks per hour
  • Recommended: 30-50 bookmarks per hour
  • Burst limit: ~20 bookmarks per 15 minutes
If rate limited:
  • Wait 15-20 minutes before retrying
  • The CLI will automatically retry with backoff
  • Error code 88 indicates general rate limiting

Error Handling

Common Errors

Already bookmarked:
 Twitter API: You have already bookmarked this tweet
Not bookmarked:
 Twitter API: This tweet is not in your bookmarks
Rate limited:
 Rate limited: Try again later (recommended wait: 15+ minutes)
Tweet not found:
 Twitter API error 404: Tweet not found or unavailable
Authentication error:
 Twitter API error 401: Authentication failed
The CLI automatically handles rate limits with exponential backoff (5 seconds → 10 seconds → 20 seconds) across up to 3 retries before failing.

Use Cases

Research and Curation

# Search for relevant content
twitter search "machine learning" -t Latest -n 50

# Bookmark interesting threads
twitter favorite 1234567890123456789
twitter favorite 9876543210987654321

Save for Later

# Browse your feed
twitter feed -n 100

# Bookmark tweets to read in detail later
twitter favorite <tweet_id>

Export Bookmarks

# Export bookmarks to JSON
twitter favorites --json -o bookmarks.json

# Export with filtering
twitter favorites --filter --json -o curated.json

Bookmarks vs Likes

FeatureBookmarks (favorite)Likes (like)
VisibilityPrivatePublic
Commandtwitter favoritetwitter like
View collectiontwitter favoritesCheck profile on web
PurposeSave for laterShow appreciation
Notification to authorNoYes
Don’t confuse favorite (bookmarks) with like (hearts). While both save content, likes are public and notify the author, while bookmarks are private.

Best Practices

  1. Organize with searches: Use bookmarks to save tweets from specific searches for later review
  2. Export regularly: Back up your bookmarks using --json -o bookmarks.json
  3. Clean up: Periodically remove old bookmarks with unfavorite
  4. Combine with filtering: Use twitter favorites --filter to analyze your saved content
  5. Respect rate limits: Don’t bookmark in rapid succession

Build docs developers (and LLMs) love