Likes, Reposts And Follows
Like, repost (and undo a repost) and follow from an X account, and read who liked its posts and who follows it.
Early access. Tell us what you're building and we'll set you up. Contact us
Repeats change nothing: liking, reposting, undoing a repost or following again
answers already: true. None of these are paced.
Like A Post#
POST /posts/reaction (accounts.write) with
{ account_id, post_id, comment_id?, reaction_type?, navigation?, author_handle? }.
X has only like (the default). To like a reply, pass its id as comment_id
(or as post_id).
{ "object": "ReactionAdded", "provider": "X", "post_id": "1850000000000000001", "reaction_type": "like", "already": false }422 errors/like_not_kept means X undid the like; 502 errors/like_unconfirmed
means open the post before liking again.
Repost A Post#
POST /posts/repost (accounts.write, optional Idempotency-Key) with
{ account_id, post_id, navigation?, author_handle? }: a plain repost.
{ "object": "PostReposted", "provider": "X", "post_id": "1850000000000000001", "already": false }502 errors/repost_unconfirmed or 504: check the post; reposting again
changes nothing.
Undo A Repost#
The same route with undo: true takes the account's repost back: the browser
presses the post's green Repost button, then X's Undo repost, and answers
once the post shows its plain Repost button again. post_id is the reposted
post's own id (the one the account reposted, not a repost id).
{ "account_id": "janedemo", "post_id": "1850000000000000001", "undo": true }{ "object": "PostUnreposted", "provider": "X", "post_id": "1850000000000000001", "already": false }A post the account hasn't reposted answers already: true with nothing
pressed. undo is true or false; any other value answers 400 (it's never
read as a repost). Keys and receipts work as for a repost; an undo's
fingerprint differs from the repost's, so one key never covers both.
422 errors/repost_unavailable: X didn't offer Undo repost, nothing changed.
502 errors/repost_unconfirmed or 504: check the post; undoing again changes
nothing. On a LinkedIn post, undo answers 501 errors/feature_not_implemented.
Follow An Account#
POST /users/follow (accounts.write, optional Idempotency-Key) with
{ account_id, identifier }, identifier being the X handle, with or without
@:
{ "object": "UserFollowed", "provider": "X", "identifier": "marclou", "already": false }429 errors/follow_limited means X says the account can't follow more people
right now. There is no unfollow route.
Who Liked A Post#
GET /posts/{post_id}/reactions?account_id=&limit= (accounts.read, limit
1–200, default 100): X shows a post's likers to its author only, so this works
on the account's own posts.
{ "object": "ReactionList", "provider": "X", "post_id": "1850000000000000001", "total_items": 1, "cursor": null,
"items": [{ "object": "Reaction", "value": "LIKE",
"author": { "id": "1700000000000000000", "public_identifier": "samdoe", "name": "Sam Doe", "profile_url": "https://x.com/samdoe" } }] }The Account's Followers#
GET /users/followers?account_id=&limit= (accounts.read, limit 1–1000,
default 100): its newest followers first.
{ "object": "UserFollowerList", "provider": "X", "cursor": null,
"items": [{ "object": "UserFollower", "id": "1700000000000000000", "public_identifier": "samdoe", "name": "Sam Doe", "profile_url": "https://x.com/samdoe" }] }Both reads use X's own data first and the page when that fails, and never click, like or follow.
Was this page helpful?