Support needed? Reach out! 📧

How to Scrape Twitter User Tweets

This tutorial shows how to use Twitter User Tweets API to scrape and crawl structured Twitter data in real-time.
Extract tweet histories for any public Twitter account through our API and retrieve full post text, retweet counts, reply totals, and impression data for content and trend analysis.

Access Twitter Data in 3 Steps

Start crawling Twitter user tweets data. Follow these steps to extract social media data in minutes.

1

Create Your Account

Go to our registration page and make an account. It's free, no credit card, and you get credits right away to play around with.

2

Verify Your Email Address

You'll get a verification email, click the link in it. Once that's done, you can grab your API token from the dashboard.

3

Make Your First API Call

Copy the code snippet below, swap in your API key, and run it. You'll get Twitter data back as JSON within a few seconds.

Code Sample

Here's a JavaScript example to get you going. Swap out the token and you're good, works the same way in any language that can make HTTP requests. Start collecting user tweets data via our REST API!

javascript-logo JavaScript
Twitter User Tweets
1 const root = 'https://ensembledata.com/apis'
2 const endpoint = '/twitter/user/tweets'
3 const params = {
4   "id"50393960,
5   "token""YOUR-TOKEN-HERE"
6 }
7  
8 const queryString = new URLSearchParams(params).toString();
9 const url = `${root}${endpoint}?${queryString}`;
10  
11 await fetch(url)
12   .then(response => response.json())
13   .then(data => console.log(data))
14   .catch(error => console.error(error));
15  

Parameters

id (integer) User ID. REQUIRED
token (string) Private token assigned to each client to access the APIs. REQUIRED

Example Response

Explore the fields returned by this endpoint. Click a row to expand nested objects and arrays, hover a value to copy it, or use "Expand all" to see everything at once.

JSON
Twitter User Tweets
dataarray1 item · schema from #0 1 item
entryIdstring"tweet-1250292126643941376"
sortIndexstring"1838341124998037504"
contentobject4 fields
entryTypestring"TimelineTimelineItem"
__typenamestring"TimelineTimelineItem"
itemContentobject4 fields
itemTypestring"TimelineTweet"
__typenamestring"TimelineTweet"
tweet_resultsobject1 field
resultobject10 fields
__typenamestring"Tweet"
rest_idstring"1250292126643941376"
coreobject1 field
user_resultsobject1 field
resultobject8 fields
__typenamestring"User"
idstring"VXNlcjo1MDM5Mzk2MA=="
rest_idstring"50393960"
affiliates_highlighted_labelobject0 fields
empty
is_blue_verifiedbooleantrue
profile_image_shapestring"Circle"
legacyobject27 fields
created_atstring"Wed Jun 24 18:44:10 +0000 2009"
default_profilebooleanfalse
default_profile_imagebooleanfalse
descriptionstring"Sharing things I'm learning through my foundation work and other inter…"
entitiesobject2 fields
descriptionobject1 field
urlsarray0 items
empty
urlobject1 field
urlsarray1 item · schema from #0 1 item
display_urlstring"gatesnot.es/blog"
expanded_urlstring"https://gatesnot.es/blog"
urlstring"https://t.co/UkvHzxDwkH"
indicesarray2 items · schema from #0 2 items
empty
fast_followers_countnumber0
favourites_countnumber560
followers_countnumber65597182
friends_countnumber590
has_custom_timelinesbooleantrue
is_translatorbooleanfalse
listed_countnumber119677
locationstring"Seattle, WA"
media_countnumber1521
namestring"Bill Gates"
normal_followers_countnumber65597182
pinned_tweet_ids_strarray0 items
empty
possibly_sensitivebooleanfalse
profile_banner_urlstring"https://pbs.twimg.com/profile_banners/50393960/1672784571"
profile_image_url_httpsstring"https://pbs.twimg.com/profile_images/1674815862879178752/nTGMV1Eo_norm…"
profile_interstitial_typestring""
screen_namestring"BillGates"
statuses_countnumber4481
translator_typestring"regular"
urlstring"https://t.co/UkvHzxDwkH"
verifiedbooleanfalse
withheld_in_countriesarray0 items
empty
tipjar_settingsobject9 fields
is_enabledbooleanfalse
bandcamp_handlestring""
bitcoin_handlestring""
cash_app_handlestring""
ethereum_handlestring""
gofundme_handlestring""
patreon_handlestring""
pay_pal_handlestring""
venmo_handlestring""
unmention_dataobject0 fields
empty
edit_controlobject4 fields
edit_tweet_idsarray1 item · schema from #0 1 item
0string"1"
1string"2"
2string"5"
3string"0"
4string"2"
5string"9"
6string"2"
7string"1"
8string"2"
9string"6"
10string"6"
11string"4"
12string"3"
13string"9"
14string"4"
15string"1"
16string"3"
17string"7"
18string"6"
editable_until_msecsstring"1586929646953"
is_edit_eligiblebooleantrue
edits_remainingstring"5"
is_translatablebooleanfalse
viewsobject1 field
statestring"Enabled"
sourcestring"<a href="https://mobile.twitter.com" rel="nofollow">Twitter Web App</a…"
legacyobject17 fields
bookmark_countnumber897
bookmarkedbooleanfalse
created_atstring"Wed Apr 15 05:17:26 +0000 2020"
conversation_id_strstring"1250292126643941376"
display_text_rangearray2 items · schema from #0 2 items
empty
entitiesobject5 fields
hashtagsarray0 items
empty
symbolsarray0 items
empty
timestampsarray0 items
empty
urlsarray0 items
empty
user_mentionsarray1 item · schema from #0 1 item
id_strstring"14499829"
namestring"World Health Organization (WHO)"
screen_namestring"WHO"
indicesarray2 items · schema from #0 2 items
empty
favorite_countnumber326122
favoritedbooleanfalse
full_textstring"Halting funding for the World Health Organization during a world healt…"
is_quote_statusbooleanfalse
langstring"en"
quote_countnumber12639
reply_countnumber57313
retweet_countnumber80697
retweetedbooleanfalse
user_id_strstring"50393960"
id_strstring"1250292126643941376"
quick_promote_eligibilityobject1 field
eligibilitystring"IneligibleUserUnauthorized"
tweetDisplayTypestring"Tweet"
clientEventInfoobject2 fields
componentstring"profile_best_highlights"
elementstring"tweet"

Response Codes

Status codes this endpoint can return, so you can handle errors before they surprise you in production.

200SuccessSuccessful Response
422Client ErrorValidation Error
491Client ErrorToken not found
492Client ErrorEmail not verified
493Client ErrorSubscription expired
495Client ErrorAll daily units used
500Server ErrorSomething went wrong

API Pricing

4 units Cost per successful call to this endpoint.

Fetch Twitter Data at Scale

Collect Twitter post data at scale for trend discovery, sentiment research, or building datasets for social media analysis.

deco-icon

Tweet History

Paginate through an account's entire public tweet timeline.

deco-icon

RTs & Replies

Get retweet counts and reply totals for every tweet returned.

deco-icon

Impression Data

Pull impression figures to measure real tweet-level reach.