Appearance
User Tweets
GET /v1/twitter/user-tweets
Fetches tweets from a Twitter user's profile by handle. Note: Twitter publicly returns only ~100 of the user's most popular tweets, not chronological or latest. Each tweet includes rest_id, full_text, views count, favorite_count, retweet_count, reply_count, bookmark_count, quote_count, created_at, media entities, and url. Supports a trim parameter for a lighter response.
Authentication
All requests require the x-api-key header. Get your key at scrapecreators.com.
Query Parameters
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
handle | string | yes | Twitter handle | levelsio |
trim | boolean | no | Set to true for a trimmed down version of the response | false |
Example Request
curl
bash
curl 'https://api.scrapecreators.com/v1/twitter/user-tweets?handle=levelsio' \
-H 'x-api-key: $SCRAPECREATORS_API_KEY'Node / TypeScript
js
const params = new URLSearchParams({ handle: 'levelsio' });
const res = await fetch(`https://api.scrapecreators.com/v1/twitter/user-tweets?${params}`, {
headers: { 'x-api-key': process.env.SCRAPECREATORS_API_KEY }
});
const data = await res.json();
console.log(data);Python
python
import os, requests
r = requests.get(
'https://api.scrapecreators.com/v1/twitter/user-tweets',
headers={'x-api-key': os.environ['SCRAPECREATORS_API_KEY']},
params={'handle': 'levelsio'},
)
r.raise_for_status()
print(r.json())CLI
bash
scrapecreators twitter user-tweets --helpExample Response
json
{
"tweets": [
{
"rest_id": "1834021269559501236",
"views": {
"count": "4710824",
"state": "EnabledWithCount"
},
"source": "<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>",
"legacy": {
"bookmark_count": 2634,
"bookmarked": false,
"created_at": "Thu Sep 12 00:08:39 +0000 2024",
"conversation_id_str": "1834021269559501236",
"display_text_range": [
0
],
"entities": {
"hashtags": [],
"symbols": [],
"timestamps": [],
"urls": [],
"user_mentions": []
},
"favorite_count": 129276,
"favorited": false,
"full_text": "Wife: “What did your teacher remember about September 11th?”\n\nNine-year-old: “She was only four then, she doesn’t remember it at all.”",
"is_quote_status": false,
"lang": "en",
"quote_count": 674,
"reply_count": 388,
"retweet_count": 2901,
"retweeted": false,
"user_id_str": "221838349",
"id_str": "1834021269559501236"
},
"url": "https://x.com/Austen/status/1935730646267158797"
}
]
}Credits
Most ScrapeCreators endpoints consume 1 credit per successful response. Some heavier endpoints (transcripts, AI-driven enrichment, ad detail lookups) may cost more. Check GET /v1/credit-balance for your remaining balance.
Errors
| Status | Meaning | Action |
|---|---|---|
| 200 | Success. | Use the JSON payload. |
| 400 | Invalid or missing parameter. | Verify required parameters and value format. |
| 401 | Missing or invalid x-api-key. | Pass a valid API key in the header. |
| 402 | Out of credits. | Top up at scrapecreators.com or wait for plan reset. |
| 404 | Resource not found or private. | Confirm the handle, URL, or id and that the resource is public. |
| 429 | Rate limited. | Backoff and retry with exponential delay. |
| 500 | Server error or upstream platform failure. | Retry with backoff; report persistent errors to support. |