TwitterAPIs Docs
API ReferenceWrite Actions

Like a Tweet API | Programmatic Twitter Favorite

Like a tweet as the authenticated account. Requires a logged-in session for the acting account. Billed at $0.0008 per call, the same as a standard read. Cost: $0.0008 per call.

Like Tweet adds a like (favorite) to a tweet on behalf of your own authenticated X account. It requires a registered X session, since the action belongs to a real account, and returns ok:true when recorded. Pass the tweet id or url as a query parameter. This is a write action billed at $0.0008 per call, the same as a standard read.

POST
/tweet/favorite

Authorization

bearerAuth
AuthorizationBearer <token>

Pass your API key as a bearer token on every request: Authorization: Bearer <API_KEY>.

In: header

Query Parameters

id?string

Numeric ID of the tweet to like. Provide either id or url.

url?string

Full status URL of the tweet to like. Provide either id or url.

proxy?string

Optional. Pass your own proxy (http(s)/socks URL) to egress the write through your clean IP for best success; if omitted, we use the session's proxy / our default.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/tweet/favorite?id=1759123456789012345&url=https%3A%2F%2Fx.com%2Fnaval%2Fstatus%2F1759123456789012345"
{  "ok": true}
{  "error": "bad_request",  "message": "Missing or malformed parameter. Fix the request before retrying."}
{  "error": "unauthorized",  "message": "The API key is missing, malformed, or revoked. Check the Authorization header."}
{  "error": "insufficient_credits",  "message": "Your balance is exhausted. Top up your credits to continue."}
{  "error": "forbidden",  "message": "The acting account is not authorized for this write action, or has no logged-in session."}
{  "error": "not_found",  "message": "The resource does not exist, for example a deleted tweet or a private account."}
{  "error": "rate_limited",  "message": "Too many requests. Back off and retry with exponential backoff."}
{  "error": "server_error",  "message": "Something failed on our side. Retry with backoff; if it persists, contact support."}

Pricing

UnitPrice
Per call$0.0008
Per 1,000 calls$0.80

Writes are billed at $0.0008 per call, the same as a standard read. A call that fails before reaching X, such as session_required, is not billed.

When to use

Use it to like posts programmatically as your account, for example auto-liking mentions of your brand.

  • Unlike Tweet: Remove a like (unfavorite) from a tweet.
  • Retweet: Retweet a tweet on behalf of an authenticated account.
  • Bookmark Tweet: Add a tweet to the authenticated account's bookmarks.

FAQ

Do I need a session to like a tweet?

Yes. Likes run as your own X account, so you must register an X session first. Without one the call returns session_required and is not billed.

How do I undo a like?

Call Unlike Tweet (tweet/unfavorite) with the same tweet id or url to remove the like.

How much does a like cost?

It is a write action at $0.0008 per call, the same as a standard read. Failed writes that never reach X are not billed.