User Information
Retrieve detailed user profile information, statistics, and recent activity for specific Twitter/X users.Endpoint
HTTP Request
Path Parameters
identifier
- Type: String
- Description: User identifier (username or user ID)
- Examples:
twitter_user,1234567890
Query Parameters
fields
- Type: String
- Description: Comma-separated list of fields to include
- Options:
id,username,name,description,location,url,profile_image_url,protected,verified,created_at,public_metrics,pinned_tweet_id - Default: All fields
- Example:
?fields=id,username,name,public_metrics
include_tweets
- Type: Boolean
- Description: Include recent tweets in response
- Default:
false - Example:
?include_tweets=true
tweet_count
- Type: Integer
- Description: Number of recent tweets to include (if include_tweets=true)
- Default: 10
- Maximum: 100
- Example:
?include_tweets=true&tweet_count=20
Response Format
Success Response (200 OK)
Error Response (404 Not Found)
Implementation Examples
JavaScript (Node.js)
Python
cURL
Advanced Usage
Batch User Lookup
User Comparison
Error Handling
Common Error Responses
404 Not Found
401 Unauthorized
429 Too Many Requests
Error Handling Implementation
Data Analysis
User Metrics Analysis
Best Practices
For Efficient Queries
- Specific Fields: Request only the fields you need
- Batch Processing: Process multiple users together when possible
- Caching: Cache user data to reduce API calls
- Rate Limiting: Implement rate limiting for batch operations
For Data Management
- Data Validation: Validate user data before processing
- Error Handling: Handle user not found and rate limit errors
- Storage Planning: Plan appropriate storage for user data
- Privacy Compliance: Respect user privacy and data protection
For Analysis
- Context Analysis: Consider user context when analyzing metrics
- Comparative Analysis: Compare users relative to their peers
- Temporal Analysis: Consider account age and activity patterns
- Quality Assessment: Assess data quality and completeness