Skip to Content

Profile

An account with its follower and post counts.

GET
/v1/x/profile

Authorization

apiKey
headerAuthorizationBearer <token>

An API key from the dashboard: Authorization: Bearer sapi_….

Query Parameters

handle?string

The account's handle (NASA), with or without @.

url?string

The profile's link (https://x.com/NASA), instead of handle.

maxAge?integer

How old a cached answer may be, in seconds; 0 always fetches. Default and most: the endpoint's cache lifetime.

Formatint64
Range0 <= value

Response Body

The answer.

application/json
  1. response

One item, as every single-item endpoint answers: { "data": … }.

data*

An X account.

Example Request
import { SocialAPI } from "@socialapihq/sdk";const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });const { data } = await client.x.profile({ handle: "NASA" });
Example Response
{  "data": {    "id": "11348282",    "username": "NASA",    "displayName": "NASA",    "bio": "Making the seemingly impossible, possible. ✨",    "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg",    "url": "https://x.com/NASA",    "verified": true,    "private": false,    "followers": 92078384,    "following": 115,    "likes": null,    "posts": 74589,    "externalUrl": "http://www.nasa.gov/",    "createdAt": "2007-12-19T20:20:32.000Z",    "ext": {      "bannerUrl": "https://pbs.twimg.com/profile_banners/11348282/1788992290",      "location": "Pale Blue Dot",      "blueVerified": true,      "verifiedType": "Government",      "verifiedSince": "2009-08-07T19:53:50.941Z",      "mediaPosts": 28267,      "highlights": 296,      "likesGiven": 17125,      "pinnedPosts": []    }  }}