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.
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.
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.
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!
| 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
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.
dataarray1 item · schema from #0 1 item
contentobject4 fields
itemContentobject4 fields
tweet_resultsobject1 field
resultobject10 fields
coreobject1 field
user_resultsobject1 field
resultobject8 fields
affiliates_highlighted_labelobject0 fields
legacyobject27 fields
entitiesobject2 fields
descriptionobject1 field
urlsarray0 items
urlobject1 field
urlsarray1 item · schema from #0 1 item
indicesarray2 items · schema from #0 2 items
pinned_tweet_ids_strarray0 items
withheld_in_countriesarray0 items
tipjar_settingsobject9 fields
unmention_dataobject0 fields
edit_controlobject4 fields
edit_tweet_idsarray1 item · schema from #0 1 item
viewsobject1 field
legacyobject17 fields
display_text_rangearray2 items · schema from #0 2 items
entitiesobject5 fields
hashtagsarray0 items
symbolsarray0 items
timestampsarray0 items
urlsarray0 items
user_mentionsarray1 item · schema from #0 1 item
indicesarray2 items · schema from #0 2 items
quick_promote_eligibilityobject1 field
clientEventInfoobject2 fields
Response Codes
Status codes this endpoint can return, so you can handle errors before they surprise you in production.
API Pricing
Fetch Twitter Data at Scale
Collect Twitter post data at scale for trend discovery, sentiment research, or building datasets for social media analysis.
Tweet History
Paginate through an account's entire public tweet timeline.
RTs & Replies
Get retweet counts and reply totals for every tweet returned.
Impression Data
Pull impression figures to measure real tweet-level reach.