X post details API

One public post with its counts, media and, for a quote post, the quoted post (extra.quoted_post).

GETapi.socialscrape.io/v1/twitter/tweet
Cost
1 credit
Cached repeats
0 creditssend max_age_days, results kept 30 days
Failed requests
0 credits
Status
Betashape may still gain fields

If X will not serve the post page, the answer comes from X's public post widget instead and views, retweet and bookmark counts are missing (extra.source_shape is syndication).

You send one of url or id.

Request

Send your key in the x-api-key header.

curl
curl -G "https://api.socialscrape.io/v1/twitter/tweet" \
  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \
  --data-urlencode 'url=https://x.com/jack/status/20'
Python
import os
import requests

params = {
    "url": "https://x.com/jack/status/20",
}
res = requests.get(
    "https://api.socialscrape.io/v1/twitter/tweet",
    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"])
TypeScript
const url = new URL("https://api.socialscrape.io/v1/twitter/tweet");
url.search = new URLSearchParams({
  url: "https://x.com/jack/status/20",
}).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);
}
n8n
{
  "nodes": [
    {
      "name": "SocialScrape X post details",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        0,
        0
      ],
      "parameters": {
        "method": "GET",
        "url": "https://api.socialscrape.io/v1/twitter/tweet",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "url",
              "value": "https://x.com/jack/status/20"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
            }
          ]
        }
      }
    }
  ],
  "connections": {}
}

Parameters

NameTypeRequiredDescription
urlurlone ofPost URL (x.com/<user>/status/<id>).
idstringone ofPost id. Also accepted as tweet_id.

Every request also accepts trim, raw and max_age_days.

Response

Sample from a recorded response, shortened. Values are public data, not yours.

Status 200Sample
{
  "ok": true,
  "credits_charged": 1,
  "credits_remaining": 4999,
  "cached": false,
  "cached_at": null,
  "request_id": "req_49f7a65c692d50cd451680d6",
  "data": {
    "object": "post",
    "platform": "twitter",
    "id": "20",
    "url": "https://x.com/jack/status/20",
    "type": "tweet",
    "author": {
      "id": "12",
      "handle": "jack",
      "name": "jack",
      "url": "https://x.com/jack",
      "avatar_url": "https://pbs.twimg.com/profile_images/1661201415899951105/azNjKOSH_400x400.jpg",
      "verified": true
    },
    "title": null,
    "text": "just setting up my twttr",
    "published_at": "2006-03-21T20:50:14Z",
    "duration_seconds": null,
    "language": "en",
    "hashtags": null,
    "mentions": null,
    "stats": {
      "views": null,
      "likes": 308827,
      "comments": 18121,
      "shares": 131907,
      "saves": 21986,
      "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": null,
    "is_sponsored": null,
    "extra": {
      "is_edited": false,
      "quote_count": 7361,
      "retweet_count": 124546
    }
  },
  "cursor": null,
  "has_more": null
}

Fields

One Post in data.

A field the platform does not give is null, never made up. Extra platform details are in extra.

FieldTypeAlwaysNotes
object"post"
platformPlatformyes
idstringyes
urlstring 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"
authorAuthor or null
titlestring or null
textstring or null
published_atstring (ISO 8601 date-time) or null
duration_secondsnumber or null
languagestring or null
hashtagsstring[] or null
mentionsstring[] or null
statsStats
Show the other 6 fields
FieldTypeAlwaysNotes
mediaMedia
songSongRef or null
locationPlace or null
is_pinnedboolean or null
is_sponsoredboolean or null
extraobject or null

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), unsupported_url (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.

Is there an SDK call for it?

The preview Python client has client.twitter.tweet(...) and the TypeScript client client.twitter.tweet(). 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.

Build on social data early.

Developers and agent builders get the first keys.

Get early access