Search X By Keywords avatar
Search X By Keywords

Pricing

$3.00 / 1,000 results

Go to Store
Search X By Keywords

Search X By Keywords

Developed by

Giichi Arai

Giichi Arai

Maintained by Community

Fast and reliable scraper for searching tweets and users on X (Twitter). Supports multiple output formats (JSON, CSV, Excel), advanced filtering options, and real-time data extraction. Perfect for social media monitoring, research, and business intelligence.

0.0 (0)

Pricing

$3.00 / 1,000 results

0

Total users

5

Monthly users

5

Runs succeeded

>99%

Last modified

a day ago

Search X (Twitter) by Keywords – Fast API-powered Scraper

This Apify Actor allows you to search for tweets and users on X (Twitter) using a fast API. It's designed to be efficient, user-friendly, and supports multiple output formats.

Features

  • 🔍 Dual Search Types: Search for tweets or users
  • 🎯 Multiple Keywords: Support for multiple keywords with separate API calls for maximum coverage
  • Fast API Integration: Uses optimized API endpoints for quick results
  • 📊 Multiple Output Formats: JSON, CSV, and Excel (XLSX)
  • 🔧 Flexible Sorting: Latest, popular, or mixed result ordering
  • 🔄 Retry Logic: Built-in retry mechanism with exponential backoff
  • 📈 Pagination Support: Handles large result sets efficiently
  • 🛡️ Proxy Support: Built-in proxy configuration for reliability

Input Configuration

Required Fields

  • Search Type: Choose between searching for tweets or users
  • Keywords: At least one keyword is required
  • Max Items Per Keyword: Number of results per keyword (1-200)

Search Keywords Options

  • Keywords: Array of keywords to search for (hashtags, usernames, phrases, etc.) - each will be searched separately via individual API calls
  • Max Items Per Keyword: Number of results to retrieve for each individual keyword (final results will be deduplicated across keywords)

Optional Fields

Tweet Search Options

  • Include Replies: Include reply tweets in results (client-side filtering)
  • Include Retweets: Include retweets in results (client-side filtering)
  • Sort By: Sort results by latest, popular, or mixed

Filtering Options

  • Sorting: Sort results by latest, popular, or mixed

Output Options

  • Output Format: Choose JSON, CSV, or Excel format
  • Proxy Configuration: Configure proxy settings

Usage Examples

Search for Tweets about AI (Multiple Keywords)

{
"searchType": "tweets",
"keywords": ["#AI", "MachineLearning", "ArtificialIntelligence", "DeepLearning", "NeuralNetworks"],
"maxItemsPerKeyword": 50,
"sortBy": "latest",
"outputFormat": "json"
}

Note: This will make 5 separate API calls (one for each keyword), getting 50 tweets per keyword, then deduplicate the combined results.

Search for Tech Users

{
"searchType": "users",
"keywords": ["tech entrepreneur", "startup", "CEO", "founder", "developer"],
"maxItemsPerKeyword": 20,
"outputFormat": "csv"
}

Note: This will make 5 separate API calls (one for each keyword), getting 20 users per keyword, then deduplicate the combined results.

Search for Cryptocurrency Tweets

{
"searchType": "tweets",
"keywords": ["cryptocurrency", "Bitcoin", "Ethereum", "blockchain", "DeFi"],
"maxItemsPerKeyword": 50,
"sortBy": "popular",
"outputFormat": "excel"
}

Note: This will make 5 separate searches (one for each keyword), getting 50 tweets per keyword, then deduplicate the combined results.

Output Schema

Tweet Data

Each tweet result includes:

  • id: Unique tweet identifier

  • text: Tweet content

  • author: Username of the author

  • author_name: Display name of the author

  • created_at: Tweet creation timestamp

  • retweet_count: Number of retweets

  • like_count: Number of likes

  • reply_count: Number of replies

  • quote_count: Number of quotes

  • is_retweet: Whether this is a retweet

  • is_reply: Whether this is a reply

  • hashtags: Array of hashtags used

  • mentions: Array of mentioned users

  • urls: Array of URLs in the tweet

  • url: Direct link to the tweet

User Data

Each user result includes:

  • id: Unique user identifier
  • username: User's handle (@username)
  • name: Display name
  • description: User bio/description
  • followers_count: Number of followers
  • following_count: Number of accounts following
  • tweets_count: Total number of tweets
  • created_at: Account creation date
  • verified: Verification status
  • location: User's location
  • profile_image_url: Profile picture URL
  • profile_url: Profile page URL

Performance & Limitations

  • Speed: Execution time depends on number of keywords (1 second delay between API calls)
  • Multiple API Calls: Each keyword triggers a separate API call for maximum results
  • Rate Limiting: Built-in retry logic and delays between requests
  • Data Freshness: Results are fetched in real-time from the API
  • Deduplication: Automatic removal of duplicate tweets/users across keyword results
  • Per-Keyword Control: Precise control over results per keyword (up to 200 per keyword)

Error Handling

The Actor includes comprehensive error handling:

  • API Failures: Automatic retry with exponential backoff
  • Invalid Queries: Clear error messages for malformed inputs
  • Network Issues: Graceful handling of connection problems
  • Data Format Errors: Robust parsing of API responses

Technical Details

  • Runtime: Python 3.11
  • Framework: Apify SDK for Python
  • API Integration: HTTP requests with session management
  • Data Processing: Pandas for CSV/Excel export
  • Logging: Comprehensive logging for debugging

Support

For issues or questions:

  1. Check the Actor logs for detailed error information
  2. Ensure your search keywords are properly formatted
  3. Verify API connectivity and quotas
  4. Contact support with specific error messages

Version History

  • v1.0.0: Initial release with tweet and user search functionality
  • Support for multiple output formats
  • Built-in retry logic and error handling
  • Comprehensive input validation

This Actor is designed for legitimate research, marketing, and business intelligence purposes. Please comply with X (Twitter) Terms of Service and applicable laws.