GETusers

Scrape Any User's Twitter Timeline

Get all tweets from any user's timeline with text, media, engagement metrics, and metadata. Paginate through their entire tweet history.

Average response time: 95ms

Code Examples

const response = await fetch(
  'https://scrapebadger.com/v1/twitter/users/elonmusk/latest_tweets',
  { headers: { 'x-api-key': 'YOUR_API_KEY' } }
);
const tweets = await response.json();
tweets.data.forEach(t => console.log(t.text, t.favorite_count));
Response
{
  "data": [
    {
      "id": "1001",
      "text": "Latest tweet from this user",
      "favorite_count": 5400,
      "retweet_count": 312,
      "created_at": "2025-01-20T16:00:00Z"
    }
  ],
  "next_cursor": "timeline_cursor_xyz"
}

API Reference

GET/v1/twitter/users/{username}/latest_tweets
ParameterTypeRequiredDescription
usernamestringRequiredThe Twitter username to get tweets from
cursorstringOptionalPagination cursor for next page

Use Cases

Competitor Analysis

Track competitor accounts, engagement rates, and content strategies to benchmark performance and identify opportunities.

Content Curation

Aggregate top-performing content by topic or industry to fuel newsletters, social feeds, and content marketing calendars.

Academic Research

Collect large-scale Twitter datasets for computational social science, NLP research, political analysis, and network studies.

Sentiment Analysis

Feed tweet text into NLP pipelines to classify sentiment, detect emotions, and measure public opinion on products, events, or topics.

Brand Monitoring

Get alerts when your brand is mentioned, track share of voice, and respond quickly to customer feedback or PR crises.

Growth Tracking

Monitor follower growth, engagement trends, and content performance over time to optimize your Twitter strategy.

Frequently Asked Questions

You can paginate through a user's entire tweet history, typically going back thousands of tweets.

Yes. The timeline includes original tweets, retweets, and replies. Each type is labeled in the response.

The endpoint returns all tweet types. Filter in your application code by checking the tweet type field.

Each page returns up to 20 tweets. Use the cursor to paginate through all available tweets.