Profile
An account with its follower and post counts.
GET
apiKeyheader
AuthorizationBearer <token>An API key from the dashboard: Authorization: Bearer sapi_….
handle?stringThe account's handle (NASA), with or without @.
url?stringThe profile's link (https://x.com/NASA), instead of handle.
maxAge?integerHow old a cached answer may be, in seconds; 0 always fetches. Default and most: the endpoint's cache lifetime.
Format
int64Range
0 <= valueThe answer.
application/json- response
One item, as every single-item endpoint answers: { "data": … }.
data*An X account.
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": [] } }}