POST https://xquik.com/api/v1/x/tweets/{id}/like
10 credits per call · All plans from $0.00012/creditA write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See the X sign-in fee.
Idempotency-Key for the intended like.
Store the returned 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 represent every X identifier exactly. 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 withaccount.
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 like receipt
An HTTP response alone does not prove the write. Save the action first. Then update your like record. Keep the request and response identities together.Store these response fields.
- Store
idas the write action ID. - Store
request.hashfor exact request matching. - Store
accountfor the connected X account. - Store
targetIdorresult.idfor the liked Tweet ID. - Store
status,terminal, andstatusUrlfor polling. - Store
billing.chargedCreditsfor the settled charge. - Store
safeToRetrybefore considering another request.
Poll pending likes and verify completion
A200 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.
Treat an already-liked terminal result as success.
Use User Likes only when current read proof matters.
Store the read time separately from the action time.
X hides most likes from other accounts. A read may not confirm the like.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 HTTP409 means the key already belongs to another payload.
Keep the original action and inspect its request hash.
Create a new key only for a new user-approved intent.
The idempotency key stops duplicate submissions to Xquik.
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. FollowsafeToRetry when the outcome is unclear.- 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 forRetry-After. - For
500or503, followsafeToRetryandterminal.
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.
Approve each action separately.
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 withaccount.
Never send an X password.How should an X (Twitter) API like tweet retry work?
Store the action first. Poll whileterminal 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
Path parameters
Body
Response
Durable write recovery
- Store
id, the nestedhashinrequest,billing, andstatusUrl. - Poll after
Retry-AfterorpollAfterMswhenterminalisfalse. - Retry only when
safeToRetryistrue. - Use a new key when
nextAction.requiresNewIdempotencyKeyistrue.
200 terminal or 202 active
- 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 forRetry-After. FollownextAction.
Response examples
200 example
202 example
- 400
{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true } - 401
{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." } - 402
{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." } - 403
{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." } - 404
{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." } - 409
{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true } - 422
{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." } - 429
{ "error": "x_rate_limited", "message": "X rate limited this account. Try again in about 15 minutes. Send fewer requests from this account." } - 500
{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." } - 503
{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }