Skip to content

Events

Author

View as MarkdownPlain text source(opens in new tab)

Every event carries one or more Author objects. The same shape is used for the actor on every event and for any secondary user mentioned by the event.

Every event carries one or more Author objects. The same shape is used for the actor on every event and for any secondary user mentioned (the parent of a reply, the quoted user, the followed user, and so on).

Fields

FieldTypeNotes
idstringX numeric user ID. Stable even if the user renames their handle
usernamestringX handle, always lowercased
displayNamestringDisplay name; can include emoji and spaces
profileUrlstringhttps://x.com/{username}
biostringProfile bio. t.co links are expanded
locationstringSelf-reported location, or empty
websiteUrlstringProfile website. t.co is expanded; empty if none
avatarUrlstring400×400 avatar URL, normalized
bannerUrlstringBanner image URL, or empty
verifiedbooleantrue when the user has any verification badge
verifiedType"blue" | "business" | "government" | nullType of badge
friendsCountnumberAccounts this user follows
followersCountnumberFollowers
statusesCountnumberLifetime post count
protectedbooleantrue when the account is private

Example

{
  "id": "44196397",
  "username": "elonmusk",
  "displayName": "Elon Musk",
  "profileUrl": "https://x.com/elonmusk",
  "bio": "http://Terafab.ai",
  "location": "",
  "websiteUrl": "",
  "avatarUrl": "https://pbs.twimg.com/profile_images/2053244804520427520/m8mdWZCG_400x400.jpg",
  "bannerUrl": "https://pbs.twimg.com/profile_banners/44196397/1774145451",
  "verified": true,
  "verifiedType": "blue",
  "friendsCount": 1352,
  "followersCount": 240138235,
  "statusesCount": 103741,
  "protected": false
}

Verification

verifiedType reflects the badge shown on X:

  • "blue": Premium subscriber
  • "business": Verified Organization
  • "government": Verified Government / Official
  • null: no badge

verified is a convenience boolean equal to verifiedType !== null.

Privacy

When protected is true, the account is private and posts aren’t visible to non-followers. Tracking continues, but new posts may not arrive until the account flips public again. The complementary privacy_changed event fires when this state transitions.

Where Author appears

EventAuthor fields
postauthor
replyauthor, replyToAuthor
quoteauthor, quotedAuthor
repostauthor (the original poster), repostedBy (the tracked user)
deletedsame as the original event
new_followauthor (the follower), followedAuthor
profile_updateauthor
privacy_changedauthor

In repost events, author is the original poster, not the tracked user who reposted. The tracked user is in repostedBy. This keeps the post-content fields (text, media, createdAtMs) aligned with their actual creator.

Partial Author objects

In rare cases, a secondary Author on reply, quote, or new_follow may arrive with only the username filled in. id will be an empty string and the count fields will be 0. Treat an empty id as a signal that the profile data is incomplete for that event; the next event for that user will carry the full shape.