X profile API

Public account details as X shows them to logged-out visitors: bio, links, avatar, banner, followers, following, post count and verification.

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

X no longer shows logged-out visitors the account's likes or listed counts, so stats.likes is empty. Suspended accounts answer removed, unknown ones not_found.

You send handle.

Request

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

curl
curl -G "https://api.socialscrape.io/v1/twitter/profile" \
  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \
  --data-urlencode 'handle=@jack'
Python
import os
import requests

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

Parameters

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

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_aa10816824f8fd23e2b1f991",
  "data": {
    "object": "profile",
    "platform": "twitter",
    "id": "12",
    "handle": "jack",
    "name": "jack",
    "headline": null,
    "url": "https://x.com/jack",
    "kind": "unknown",
    "bio": "no state is the best state",
    "avatar_url": "https://pbs.twimg.com/profile_images/1661201415899951105/azNjKOSH_400x400.jpg",
    "banner_url": "https://pbs.twimg.com/profile_banners/12/1742427520",
    "verified": true,
    "is_private": false,
    "external_url": "http://primal.net/jack",
    "links": [
      {
        "title": "primal.net/jack",
        "url": "http://primal.net/jack"
      }
    ],
    "location": null,
    "category": null,
    "created_at": "2006-03-21T20:50:14Z",
    "stats": {
      "followers": 12515435,
      "following": 4,
      "posts": 31117,
      "likes": null,
      "views": null
    },
    "extra": {
      "creator_subscriptions_count": 0,
      "highlighted_posts": 5,
      "is_blue_verified": true,
      "possibly_sensitive": false,
      "profile_image_shape": "Circle",
      "subscribers_count": 0
    }
  },
  "cursor": null,
  "has_more": null
}

Fields

One Profile in data.

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

FieldTypeAlwaysNotes
object"profile"
platformPlatformyes
idstring or null
handlestring or null
namestring or null
headlinestring or nulla short tagline apart from the bio (LinkedIn's headline)
urlstring or null
kind"person" or "creator" or "channel" or "page" or "company" or "artist" or "organization" or "shop" or "unknown"
biostring or null
avatar_urlstring or null
banner_urlstring or null
verifiedboolean or null
is_privateboolean or null
external_urlstring or null
Show the other 6 fields
FieldTypeAlwaysNotes
linksLink[] or null
locationstring or null
categorystring or null
created_atstring (ISO 8601 date-time) or null
statsProfileStats
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), 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.profile(...) and the TypeScript client client.twitter.profile(). 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