Skip to main content
POST
Twitter like API: like a tweet by ID with status
10 credits per call · All plans from $0.00012/credit
Use this Twitter Like API to like 1 tweet by ID. This Twitter API like Tweet request uses 1 connected X account. Save user approval before sending the request. Create a unique Idempotency-Key for the intended like. Store the durable write action and poll statusUrl when needed. Confirm the returned target matches the requested Tweet ID. X documents its separate Like Post endpoint. X says not to auto-like or bulk-like Tweets in its Developer Guidelines. Keep every like user-initiated.

Like one tweet by ID

Put the exact Tweet ID in the request path. Put the connected account username or ID in the body. That account performs the like. Copy Tweet IDs as strings. JavaScript numbers cannot safely represent every X identifier. Keep the selected Tweet ID beside the approving user. This endpoint accepts 1 Tweet ID per request. It does not fetch Tweets, create reposts, or publish replies. Use Get Tweet before showing an approval screen.

Keep every like user-initiated

Require a clear user choice before each like. Show the tweet text, author, and Tweet ID during approval. Store who approved the like and when. Do not build auto-like, bulk-like, or purchased-like workflows. Do not select scraped tweets and like them without user approval. Only send the like that your user picked. A review queue can prepare candidates without performing actions. Your user must choose the exact tweet before this endpoint runs. Keep the approval reference in the action ledger.

Authenticate the connected X account

Send an Xquik API key or OAuth 2.1 bearer token. Then identify the connected X account with account. The request never accepts an X password or session cookie. Keep Xquik credentials in server-side code. Do not expose them in mobile apps or browser bundles. Reconnect that X account when you receive account_needs_reauth. The official X endpoint uses a user access token. Its authentication differs from the Xquik contract. Read X’s Like Post guide for that endpoint.

Save a durable like receipt

Never treat a transport response as sufficient proof. Save the action first. Then update your like record. Keep the request and response identities together. Persist these response fields:
  • Store id as the durable write action ID.
  • Store request.hash for exact request matching.
  • Store account for the connected X account.
  • Store targetId or result.id for the liked Tweet ID.
  • Store status, terminal, and statusUrl for polling.
  • Store billing.chargedCredits for the settled charge.
  • Store safeToRetry before considering another request.

Poll pending likes and verify completion

A 200 response contains a terminal action. A 202 response means the like remains active. Poll statusUrl until terminal becomes true. Do not submit another like while the first action remains active. After success, confirm the result matches the requested Tweet ID. Preserve an already-liked terminal result as successful convergence. Use User Likes only when current read proof matters. Store the read time separately from the action time. Read visibility can limit independent verification.

Prevent duplicate tweet likes

Create 1 idempotency key for the intended account and Tweet ID. Reuse that key only after an interrupted response. Never reuse it for a different account or tweet. An HTTP 409 means the key already protects another payload. Keep the original action and inspect its request hash. Create a new key only for a new user-approved intent. Idempotency prevents duplicate submissions inside the Xquik workflow. Still check approval, terminal status, and the acting account.

Handle Twitter like API errors

Never infer failure from a client timeout. Poll a returned action before sending another request. Follow safeToRetry for ambiguous write outcomes.
  • For 400, correct the Tweet ID or account value.
  • For 401, replace invalid Xquik authentication.
  • For 402, add credits before another like.
  • For 403, reconnect the selected X account.
  • For 409, keep the original action and payload.
  • For 422, review the X rejection before retrying.
  • For 429, wait for Retry-After.
  • For 500 or 503, follow safeToRetry and terminal.
X publishes separate limits for its Like Post endpoint. Those limits do not replace Xquik’s response headers. Never increase throughput by creating a bulk-like queue.

Choose like, unlike, or read likes

Use this route only to add a like from one connected account. Use Unlike Tweet to reverse that account’s like. Use read endpoints when no engagement action is needed. Liking does not create a repost, reply, bookmark, or follow. Choose each action explicitly during approval.

Twitter like API questions

Can an API like a tweet by ID?

Yes. Send the Tweet ID in this route’s path. Send the connected acting account in the JSON body. Keep the like user-initiated.

Does this endpoint bulk-like tweets?

No. It accepts 1 Tweet ID per request. X prohibits bulk-like and auto-like behavior. Do not loop through candidates without individual user approval.

How does Twitter like API authentication work?

Authenticate to Xquik with an API key or OAuth 2.1 bearer token. Select a previously connected X account with account. Never send an X password.

How should a Twitter API like tweet retry work?

Store the durable action first. Poll while terminal is false. Retry only when safeToRetry is true.

Can the same API like, repost, and reply?

Xquik documents separate routes for each action. Use Retweet for a repost. Use Create Tweet for a reply.

Which libraries can like a tweet?

Any HTTP client can call this REST endpoint. The examples cover cURL, Node.js, Python, and Go. Keep credentials in server-side code.

Headers

string
Send your Xquik API key in this header. Alternatively, send an OAuth 2.1 bearer token.
string
Send Bearer <token> instead of x-api-key when using OAuth 2.1.
string
required
Unique key for this intended write. Reuse it only for an exact network replay.
string
required
Must be application/json.

Path parameters

string
required
The ID of the tweet to like.

Body

string
required
X username or account ID identifying which connected X account will like the tweet. The @ prefix is automatically stripped if included.

Response

Durable write recovery

Send one unique Idempotency-Key per intended write. Reuse it only for the same account, target, payload, and media.
  1. Store id, the nested hash in request, billing, and statusUrl.
  2. Poll after Retry-After or pollAfterMs when terminal is false.
  3. Trust safeToRetry and nextAction before any new write.

200 Terminal or 202 active

Store terminal results. Poll active actions without creating another write.
  • After HTTP 200, store the result and settled billing.
  • After HTTP 202, poll the same action. Never submit another write.
  • After HTTP 400, fix the named field. Use a new idempotency key.
  • After HTTP 401, fix authentication. Do not retry unchanged.
  • After HTTP 402, fund the account before another write.
  • After HTTP 403, reconnect the account.
  • After HTTP 409, keep the original action. Use a new key for new input.
  • After HTTP 422, fix the rejected request before retrying.
  • After HTTP 429, wait for Retry-After. Preserve the same key.
  • After HTTP 500, retry only when safeToRetry is true.
  • After HTTP 503, poll while terminal is false.
See Get Write Action Status for every lifecycle field, terminal state, billing field, and retry rule.