X profile posts API
  1. Docs
  2. X (Twitter)
  3. X profile posts API

X profile posts API

Posts of an account: about 20 popular posts and reposts, or, when X's public timeline widget is rate limited, the 5 newest original posts.

GET /v1/twitter/profile/tweets

GET /v1/twitter/profile/tweets

Posts of an account: about 20 popular posts and reposts, or, when X's public timeline widget is rate limited, the 5 newest original posts. X offers no way to page further, so there is no next-page cursor.

  • Cost: 1 credit
  • Cache: Results are kept up to 30 days; send max_age_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescription
handlestringyesUsername, with or without the leading @. Also accepted as username, screen_name.

Every request also accepts:

  • cursor: the cursor from the previous page (Pagination).
  • trim: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).

Example request#

Set your key in the environment first (see Authentication).

1curl -G "https://api.socialscrape.dev/v1/twitter/profile/tweets" \2  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3  --data-urlencode "handle=NASA"

Example response#

This is a sample from a recorded response, lists and long text are shortened. Status 200.

200 OKSample response
1{2  "ok": true,3  "credits_charged": 1,4  "credits_remaining": 4999,5  "cached": false,6  "cached_at": null,7  "request_id": "req_2f3acfff478c2a97370e067a",8  "data": {9    "object": "list",10    "items": [11      {12        "object": "post",13        "platform": "twitter",14        "id": "2115900247230537920",15        "url": "https://x.com/NASA/status/2115900247230537920",16        "type": "tweet",17        "author": {18          "id": "11348282",19          "handle": "NASA",20          "name": "NASA",21          "url": "https://x.com/NASA",22          "avatar_url": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg",23          "verified": true24        },25        "title": null,26        "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, and your name can come along! Join the voyage and claim your boarding pass: https:/...",27        "published_at": "2026-10-29T20:15:05Z",28        "duration_seconds": null,29        "language": "en",30        "hashtags": null,31        "mentions": null,32        "stats": {33          "views": 280499,34          "likes": 1594,35          "comments": 107,36          "shares": 386,37          "saves": 394,38          "dislikes": null39        },40        "media": {41          "thumbnail_url": "https://pbs.twimg.com/media/HV0wDfrWEAEN_2v.jpg",42          "video_url": null,43          "audio_url": null,44          "image_urls": [45            "https://pbs.twimg.com/media/HV0wDfrWEAEN_2v.jpg"46          ],47          "width": 8000,48          "height": 450149        },50        "song": null,51        "location": null,52        "is_pinned": false,53        "is_sponsored": null,54        "extra": {55          "is_edited": false,56          "links": [57            {58              "display_url": "go.nasa.gov/dragonfly-names",59              "url": "https://go.nasa.gov/dragonfly-names"60            }61          ],62          "media": [63            {64              "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 Titan\" and \"Fly your name to another world!\"",65              "height": 4501,66              "type": "photo",67              "url": "https://pbs.twimg.com/media/HV0wDfrWEAEN_2v.jpg",68              "width": 800069            }70          ],71          "possibly_sensitive": false,72          "quote_count": 64,73          "retweet_count": 32274        }75      },76      {77        "object": "post",78        "platform": "twitter",79        "id": "2115753332958433574",80        "url": "https://x.com/NASA/status/2115753332958433574",81        "type": "tweet",82        "author": {83          "id": "11348282",84          "handle": "NASA",85          "name": "NASA",86          "url": "https://x.com/NASA",87          "avatar_url": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg",88          "verified": true89        },90        "title": null,91        "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 around 8am ET (1200 UTC) and run for about six and a half hours. https://x.com/i/broad...",92        "published_at": "2026-10-29T10:31:18Z",93        "duration_seconds": null,94        "language": "en",95        "hashtags": null,96        "mentions": [97          "csa_asc",98          "Space_Station"99        ],100        "stats": {101          "views": 1026589,102          "likes": 3039,103          "comments": 219,104          "shares": 626,105          "saves": 173,106          "dislikes": null107        },108        "media": {109          "thumbnail_url": null,110          "video_url": null,111          "audio_url": null,112          "image_urls": null,113          "width": null,114          "height": null115        },116        "song": null,117        "location": null,118        "is_pinned": false,119        "is_sponsored": null,120        "extra": {121          "card": {122            "url": "https://t.co/xoJPYWty9Z"123          },124          "is_edited": false,125          "links": [126            {127              "display_url": "x.com/i/broadcasts/1…",128              "url": "https://x.com/i/broadcasts/1rxmqpBDDpWxy"129            }130          ],131          "possibly_sensitive": false,132          "quote_count": 79,133          "retweet_count": 547134        }135      }136    ],137    "cursor": null,138    "has_more": false,139    "parent": {140      "object": "profile",141      "platform": "twitter",142      "id": "11348282",143      "handle": "NASA",144      "name": "NASA",145      "headline": null,146      "url": "https://x.com/NASA",147      "kind": "organization",148      "bio": "Making the seemingly impossible, possible. ✨",149      "avatar_url": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg",150      "banner_url": "https://pbs.twimg.com/profile_banners/11348282/1788992290",151      "verified": true,152      "is_private": false,153      "external_url": "http://www.nasa.gov/",154      "links": [155        {156          "title": "nasa.gov",157          "url": "http://www.nasa.gov/"158        }159      ],160      "location": "Pale Blue Dot",161      "category": null,162      "created_at": "2007-12-19T20:20:32Z",163      "stats": {164        "followers": 92300985,165        "following": 115,166        "posts": 74471,167        "likes": null,168        "views": null169      },170      "extra": {171        "affiliates_count": 85,172        "birthdate": {173          "day": 1,174          "month": 10,175          "year": 1958176        },177        "creator_subscriptions_count": 0,178        "highlighted_posts": 288,179        "is_blue_verified": true,180        "possibly_sensitive": false,181        "profile_image_shape": "Square",182        "subscribers_count": 0,183        "verification_reason": "This account is verified because it is a government or multilateral organization account.  Learn more",184        "verified_type": "Government"185      }186    }187  },188  "cursor": null,189  "has_more": false190}

Response#

A list of Post objects in data.items, with data.cursor and data.has_more.

See Data models for every field. The envelope around data is described in Responses.

Errors#

Failures are free: credits_charged is 0. Branch on error.code, never on the message.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
not_found404noThe platform says this profile, post or item does not exist.

Every request can also fail with the account and platform errors listed on the Errors page.

Also served at#

These paths answer the same request, so code written for other APIs keeps working: /v1/twitter/user-tweets. See Switching from ScrapeCreators.