X profile posts API
Public posts of an account, as X shows them to logged-out visitors.
- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
- Status
- Betashape may still gain fields
About 20 popular posts and reposts, or, when X's public timeline widget is rate limited, the 5 newest original posts. X offers logged-out visitors no way to page further, so there is no next-page cursor.
You send handle.
Request
Send your key in the x-api-key header.
curl -G "https://api.socialscrape.io/v1/twitter/profile/tweets" \
-H "x-api-key: $SOCIALSCRAPE_API_KEY" \
--data-urlencode 'handle=NASA'import os
import requests
params = {
"handle": "NASA",
}
res = requests.get(
"https://api.socialscrape.io/v1/twitter/profile/tweets",
headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
params=params,
timeout=60,
)
body = res.json()
if body["ok"]:
print(body["data"])
else:
print(body["error"]["code"], body["error"]["message"])const url = new URL("https://api.socialscrape.io/v1/twitter/profile/tweets");
url.search = new URLSearchParams({
handle: "NASA",
}).toString();
const res = await fetch(url, {
headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();
if (body.ok) {
console.log(body.data);
} else {
console.error(body.error.code, body.error.message);
}{
"nodes": [
{
"name": "SocialScrape X profile posts",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
0,
0
],
"parameters": {
"method": "GET",
"url": "https://api.socialscrape.io/v1/twitter/profile/tweets",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "handle",
"value": "NASA"
}
]
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-api-key",
"value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
}
]
}
}
}
],
"connections": {}
}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
handle | string | yes | Username, with or without the leading @. Also accepted as username, screen_name. |
cursor | string | Opaque cursor from the previous page; pass it back unchanged. Also accepted as continuationToken, continuation_token, next_max_id, max_id, max_cursor, min_time, after, page_token, pageToken, paginationToken, next_page_id, page. |
Every request also accepts trim, raw and max_age_days.
Response
Sample from a recorded response, shortened. Values are public data, not yours.
{
"ok": true,
"credits_charged": 1,
"credits_remaining": 4999,
"cached": false,
"cached_at": null,
"request_id": "req_2f3acfff478c2a97370e067a",
"data": {
"object": "list",
"items": [
{
"object": "post",
"platform": "twitter",
"id": "2115900247230537920",
"url": "https://x.com/NASA/status/2115900247230537920",
"type": "tweet",
"author": {
"id": "11348282",
"handle": "NASA",
"name": "NASA",
"url": "https://x.com/NASA",
"avatar_url": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg",
"verified": true
},
"title": null,
"text": "Your name could fly on Saturn’s largest moon.\n\nNASA’s Dragonfly mission will launch in 2028 to explore the dunes, lakes, and rivers of Saturn’s moon, Titan, ...",
"published_at": "2026-10-29T20:15:05Z",
"duration_seconds": null,
"language": "en",
"hashtags": null,
"mentions": null,
"stats": {
"views": 280499,
"likes": 1594,
"comments": 107,
"shares": 386,
"saves": 394,
"dislikes": null
},
"media": {
"thumbnail_url": "https://pbs.twimg.com/media/HV0wDfrWEAEN_2v.jpg",
"video_url": null,
"audio_url": null,
"image_urls": [
"https://pbs.twimg.com/media/HV0wDfrWEAEN_2v.jpg"
],
"width": 8000,
"height": 4501
},
"song": null,
"location": null,
"is_pinned": false,
"is_sponsored": null,
"extra": {
"is_edited": false,
"links": [
{
"display_url": "go.nasa.gov/dragonfly-names",
"url": "https://go.nasa.gov/dragonfly-names"
}
],
"media": [
{
"alt_text": "A poster-style graphic of the the Dragonfly rotorcraft and two example boarding passes with a reddish-tan background. Text on the graphic reads \"Journey to T...",
"height": 4501,
"type": "photo",
"url": "https://pbs.twimg.com/media/HV0wDfrWEAEN_2v.jpg",
"width": 8000
}
],
"possibly_sensitive": false,
"quote_count": 64,
"retweet_count": 322
}
},
{
"object": "post",
"platform": "twitter",
"id": "2115753332958433574",
"url": "https://x.com/NASA/status/2115753332958433574",
"type": "tweet",
"author": {
"id": "11348282",
"handle": "NASA",
"name": "NASA",
"url": "https://x.com/NASA",
"avatar_url": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg",
"verified": true
},
"title": null,
"text": "LIVE: NASA's Anil Menon and @csa_asc's Joshua Kutryk are setting up a new solar array outside the @Space_Station. Today's spacewalk is scheduled to start aro...",
"published_at": "2026-10-29T10:31:18Z",
"duration_seconds": null,
"language": "en",
"hashtags": null,
"mentions": [
"csa_asc",
"Space_Station"
],
"stats": {
"views": 1026589,
"likes": 3039,
"comments": 219,
"shares": 626,
"saves": 173,
"dislikes": null
},
"media": {
"thumbnail_url": null,
"video_url": null,
"audio_url": null,
"image_urls": null,
"width": null,
"height": null
},
"song": null,
"location": null,
"is_pinned": false,
"is_sponsored": null,
"extra": {
"card": {
"url": "https://t.co/xoJPYWty9Z"
},
"is_edited": false,
"links": [
{
"display_url": "x.com/i/broadcasts/1…",
"url": "https://x.com/i/broadcasts/1rxmqpBDDpWxy"
}
],
"possibly_sensitive": false,
"quote_count": 79,
"retweet_count": 547
}
}
],
"cursor": null,
"has_more": false,
"parent": {
"object": "profile",
"platform": "twitter",
"id": "11348282",
"handle": "NASA",
"name": "NASA",
"headline": null,
"url": "https://x.com/NASA",
"kind": "organization",
"bio": "Making the seemingly impossible, possible. ✨",
"avatar_url": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg",
"banner_url": "https://pbs.twimg.com/profile_banners/11348282/1788992290",
"verified": true,
"is_private": false,
"external_url": "http://www.nasa.gov/",
"links": [
{
"title": "nasa.gov",
"url": "http://www.nasa.gov/"
}
],
"location": "Pale Blue Dot",
"category": null,
"created_at": "2007-12-19T20:20:32Z",
"stats": {
"followers": 92300985,
"following": 115,
"posts": 74471,
"likes": null,
"views": null
},
"extra": {
"affiliates_count": 85,
"birthdate": {
"day": 1,
"month": 10,
"year": 1958
},
"creator_subscriptions_count": 0,
"highlighted_posts": 288,
"is_blue_verified": true,
"possibly_sensitive": false
}
}
},
"cursor": null,
"has_more": false
}Fields
A page of results. Each entry in items is a Post. cursor and has_more page through the rest.
A field the platform does not give is null, never made up. Extra platform details are in extra.
| Field | Type | Always | Notes |
|---|---|---|---|
object | "post" | ||
platform | Platform | yes | |
id | string | yes | |
url | string or null | ||
type | "video" or "short" or "reel" or "image" or "carousel" or "story" or "live" or "clip" or "text" or "link" or "tweet" or "pin" or "community_post" or "episode" or "unknown" | ||
author | Author or null | ||
title | string or null | ||
text | string or null | ||
published_at | string (ISO 8601 date-time) or null | ||
duration_seconds | number or null | ||
language | string or null | ||
hashtags | string[] or null | ||
mentions | string[] or null | ||
stats | Stats |
Show the other 6 fields
Full field list in the reference for this endpoint and the data models. Errors are listed under Errors.
Questions
Which errors can it return?
invalid_params (do not retry), not_found (do not retry). Account and platform errors from the errors list can also happen. A failure always costs 0 credits.
How do I get more than one page?
Send the same request with cursor set to the cursor you received, until has_more is false. Each page costs its own price. See pagination.
Is there an SDK call for it?
The preview Python client has client.twitter.profile_tweets(...) and the TypeScript client client.twitter.profileTweets(). Both return the same envelope as the HTTP API. The packages are not published yet; plain HTTP works today in any language.
Can an AI agent call it?
Yes. The MCP server reaches every built endpoint, with the same prices.