Developer tutorial
How to scrape Twitter (X) tweets with cURL (2026)
This tutorial shows how to scrape Twitter (X) tweets in cURL using the SocialCrawl API. You get a user's recent tweets with text, media, timestamp, and reply, retweet, and like counts, paginated by cursor from one GET request, with no X developer account, proxies, or HTML parsing. The code below is runnable as-is, and the response underneath it is a real, unedited call.
Code tested July 2026
How it works
- 1Get a free API keyCreate a SocialCrawl account and copy your API key from the dashboard. Every new account starts with free credits.
- 2Set up cURLUse curl, which ships with macOS, Linux, and Windows 10 and later.
- 3Call the X User Tweets endpointSend a GET request to /v1/twitter/user/tweets with your API key in the x-api-key header and the `handle` parameter.
- 4Read the responseParse the JSON. SocialCrawl returns a user's recent tweets with text, media, timestamp, and reply, retweet, and like counts, paginated by cursor in one normalized schema, so you write no HTML parsing or proxy code.
The code
A real, unedited response from the request above.
curl -G "https://www.socialcrawl.dev/v1/twitter/user/tweets" \
-H "x-api-key: YOUR_API_KEY" \
--data-urlencode "handle=NASA"[ RESPONSE ]
{
"success": true,
"platform": "twitter",
"endpoint": "/v1/twitter/user/tweets",
"data": {
"items": [
{
"post": {
"id": "2078226501024227542",
"url": "https://x.com/NASA/status/2078226501024227542",
"content": {
"text": "RT @NASASpox: Full steam ahead this week at @NASA 🚀\n\n🧑🚀 @Astro_Anil arrives at the ISS\n🪐 Dragonfly progress\n✈️ Future of autonomous flight…",
"media_urls": null,
"thumbnail_url": null,
"duration_seconds": null
},
"author": {
"username": "NASA",
"display_name": "NASA",
"avatar_url": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_normal.jpg",
"verified": true
},
"engagement": {
"views": 64929,
"likes": 0,
"comments": 0,
"shares": 92,
"saves": 0
},
"flags": {
"nsfw": null,
"spoiler": null,
"pinned": false,
"deleted": false
},
"published_at": "Fri Jul 17 21:13:04 +0000 2026"
},
"computed": {
"engagement_rate": 0.001417,
"language": "en",
"content_category": "other",
"estimated_reach": 77915
}
},
{
"post": {
"id": "2078214686453985351",
"url": "https://x.com/NASA/status/2078214686453985351",
"content": {
"text": "RT @NASADepAdmin: The Artemis Accords continue to bring the world together around a shared vision for the peaceful future of exploration.…",
"media_urls": null,
"thumbnail_url": null,
"duration_seconds": null
},
"author": {
"username": "NASA",
"display_name": "NASA",
"avatar_url": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_normal.jpg",
"verified": true
},
"engagement": {
"views": 66502,
"likes": 0,
"comments": 0,
"shares": 79,
"saves": 0
},
"flags": {
"nsfw": null,
"spoiler": null,
"pinned": false,
"deleted": false
},
"published_at": "Fri Jul 17 20:26:07 +0000 2026"
},
"computed": {
"engagement_rate": 0.001188,
"language": "en",
"content_category": "other",
"estimated_reach": 79802
}
}
],
"total": null,
"dropped": 0
},
"credits_used": 1,
"credits_remaining": 9999,
"request_id": "req_example000000",
"cached": false,
"pagination": {
"next_cursor": null,
"has_more": false,
"page_size": 14
}
}Prefer another language?
자주 묻는 질문
궁금한 점이 있으신가요? 답변해 드립니다
SocialCrawl의 API, 요금제, 기능에 대한 자주 묻는 질문을 확인하세요.
문의하기Do I need a X developer account to scrape Twitter (X) tweets?
No. SocialCrawl handles authentication and proxies upstream, so you never register a X app, manage OAuth tokens, or run your own scrapers. One API key returns X data directly.
What does the X User Tweets endpoint return?
It returns a user's recent tweets with text, media, timestamp, and reply, retweet, and like counts, paginated by cursor. The response is normalized into SocialCrawl's unified schema, identical in shape across every platform.
How much does it cost to scrape Twitter (X) tweets?
Each call costs a small number of credits, and new accounts start with free credits. There are no monthly minimums, so you pay only for the calls you make.
Can I use this cURL code in production?
Yes. The snippet on this page is the real request against the live API. For production, add error handling and follow the response cursor to paginate through large result sets.
AI에게 SocialCrawl을 물어보세요
