> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xquik.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Twitter user likes API & liked tweet export

> Read your X account's liked tweets with authors, text, media & metrics. Connect an X account first. X shows likes only to their owner. Other profiles get 424.

> For the complete documentation index, see [llms.txt](https://docs.xquik.com/llms.txt).

`GET https://xquik.com/api/v1/x/users/{id}/likes`

## When to read liked tweets

Use this route for the liked tweets of your connected X account. Pass that account's user ID or username as `id`. Callers without a connected X account get `424 account_required`. Use [Connect X account](https://docs.xquik.com/api-reference/x-accounts/connect.md) to add one. Guest keys get `403 forbidden`.




X has shown likes only to their owner since 2024. When another profile reports likes and X hides them, the route returns `424 likes_unavailable`. It does not return an empty `200`. When your connected X accounts are busy, the route returns `503`. Retry after the `Retry-After` delay.




The output is tweet rows with engagement and pagination. Use media or timeline routes when you need posts the user wrote.

> [!NOTE]
>
> Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`.

**1 credit per result returned** · [All plans](https://xquik.com) from \$0.00012/credit

```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}}
curl https://xquik.com/api/v1/x/users/44196397/likes \
  -H "x-api-key: xq_your_api_key_here" | jq

# Page 2
curl -G https://xquik.com/api/v1/x/users/44196397/likes \
  --data-urlencode "cursor=abc123" \
  -H "x-api-key: xq_your_api_key_here" | jq
```

```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}}
const userId = "44196397";
let pageCursor = "";

for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) {
  const params = pageCursor === "" ? "" : `?${new URLSearchParams({ cursor: pageCursor })}`;
  const response = await fetch(`https://xquik.com/api/v1/x/users/${userId}/likes${params}`, {
    headers: { "x-api-key": "xq_your_api_key_here" },
  });
  const page = await response.json();
  if (!response.ok) throw new Error(JSON.stringify(page));

  const likedRows = page.tweets.map((tweet) => ({
    liked_by_user_id: userId,
    liked_tweet_id: tweet.id,
    text: tweet.text,
    tweet_url: tweet.url ?? null,
    created_at: tweet.createdAt ?? null,
    author_id: tweet.author?.id ?? null,
    author_username: tweet.author?.username ?? null,
    author_name: tweet.author?.name ?? null,
    author_followers: tweet.author?.followers ?? null,
    author_verified: tweet.author?.verified ?? null,
    author_profile_picture: tweet.author?.profilePicture ?? null,
    like_count: tweet.likeCount ?? null,
    reply_count: tweet.replyCount ?? null,
    retweet_count: tweet.retweetCount ?? null,
    quote_count: tweet.quoteCount ?? null,
    view_count: tweet.viewCount ?? null,
    media_urls: (tweet.media ?? []).map((item) => item.mediaUrl).filter(Boolean),
    page_index: pageIndex,
    page_cursor: pageCursor,
    next_cursor: page.next_cursor,
    has_next_page: page.has_next_page,
  }));

  for (const row of likedRows) process.stdout.write(`${JSON.stringify(row)}\n`);

  if (!page.has_next_page || page.next_cursor === "") break;
  pageCursor = page.next_cursor;
}
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}}
import json
import requests

user_id = "44196397"
page_cursor = ""

for page_index in range(3):
    params = {"cursor": page_cursor} if page_cursor else {}
    response = requests.get(
        f"https://xquik.com/api/v1/x/users/{user_id}/likes",
        params=params,
        headers={"x-api-key": "xq_your_api_key_here"},
    )
    page = response.json()
    if not response.ok:
        raise RuntimeError(page)

    for tweet in page["tweets"]:
        liked_row = {
            "liked_by_user_id": user_id,
            "liked_tweet_id": tweet["id"],
            "text": tweet["text"],
            "tweet_url": tweet.get("url"),
            "created_at": tweet.get("createdAt"),
            "author_id": (tweet.get("author") or {}).get("id"),
            "author_username": (tweet.get("author") or {}).get("username"),
            "author_name": (tweet.get("author") or {}).get("name"),
            "author_followers": (tweet.get("author") or {}).get("followers"),
            "author_verified": (tweet.get("author") or {}).get("verified"),
            "author_profile_picture": (tweet.get("author") or {}).get("profilePicture"),
            "like_count": tweet.get("likeCount"),
            "reply_count": tweet.get("replyCount"),
            "retweet_count": tweet.get("retweetCount"),
            "quote_count": tweet.get("quoteCount"),
            "view_count": tweet.get("viewCount"),
            "media_urls": [
                item["mediaUrl"]
                for item in tweet.get("media", [])
                if item.get("mediaUrl")
            ],
            "page_index": page_index,
            "page_cursor": page_cursor,
            "next_cursor": page["next_cursor"],
            "has_next_page": page["has_next_page"],
        }
        print(json.dumps(liked_row, separators=(",", ":")))

    if not page["has_next_page"] or not page["next_cursor"]:
        break
    page_cursor = page["next_cursor"]
```

## User likes handoff

`GET /x/users/{id}/likes` returns liked tweet rows from one account. Use it when
a CRM, warehouse, recommendation job, or agent needs those rows. The examples
above write JSON Lines rows with the liked-by user. Rows also hold the liked
tweet ID, text, tweet URL, author ID, and username. They also hold the display
name, follower count, verified state, and profile image URL. They also hold
engagement counts, media URLs, and cursor fields. A worker can then resume from
the last saved `next_cursor`.

## Build a liked-tweet library

Use this route to collect tweets liked by one profile. Keep the source user ID
with every tweet. A tweet can appear in several users' liked feeds.




Store fields that support review.

* Tweet ID, text, author, and creation time.
* Like, reply, repost, quote, and view counts.
* Photo, video, or animated GIF URLs.
* Source profile ID, cursor, and collection time.

A like does not prove agreement,
ownership, or endorsement. Store the original author separately.




For repeated collection, compare tweet IDs between snapshots. New IDs are
newly observed likes. A missing ID proves little, because paging
depth and like visibility can change.




Use user media when the workflow needs tweets containing media from the
profile itself. Use user tweets for the profile timeline. Each feed returns
different tweets.

## Compare liked-feed snapshots

Label every run as complete or partial. Compare only complete runs collected
to the same paging depth.




Keep first-seen and last-seen timestamps in your own store. The endpoint
returns the current page, not a historical like event log.




When a liked tweet disappears, record it as no longer observed. Do not claim the
user removed the like unless another verified source confirms it. Tweet deletion
or availability changes can produce the same observation.




For review queues, link each row to the source tweet. Keep the liking profile
separate from the tweet author.




Store reviewer labels outside the tweet response. Use fixed values such as
relevant, irrelevant, or needs review.




Do not overwrite the original tweet text with notes. Keep both values in
separate fields.

| Liked-tweet library column | Response source | Library rule |
| - | - | - |
| `liked_by_x_user_id` | Resolved source profile ID | Keep the liking profile separate from the tweet author. |
| `tweet_id` | `tweets[].id` | Use as the stable liked-tweet upsert key. |
| `tweet_url` | `tweets[].url` | Open the original tweet during review. |
| `text` | `tweets[].text` | Keep the original tweet body without reviewer edits. |
| `author_id` | `tweets[].author.id` | Keep the original author as a stable identity. |
| `author_username` | `tweets[].author.username` | Display the author handle observed during collection. |
| `created_at` | `tweets[].createdAt` | This is the tweet's creation time, not the like time. |
| `like_count` | `tweets[].likeCount` | Store the visible tweet count observed during collection. |
| `media_urls` | `tweets[].media[].mediaUrl` | Keep image, video, or animated GIF URLs. |
| `snapshot_id` | Integration value | Group liked-tweet pages from the same collection run. |
| `snapshot_complete` | Integration value | Compare disappearance only across complete snapshots. |
| `collected_at` | Integration timestamp | Record first-seen and last-seen times for audits. |

| Snapshot comparison | Tweet ID condition | Safe interpretation |
| - | - | - |
| Newly observed | Present only in the latest complete snapshot | The tweet was newly observed in the liked feed. |
| Still observed | Present in both complete snapshots | The tweet remained visible at both collection times. |
| No longer observed | Present only in the earlier complete snapshot | Availability changed. Do not claim the user removed the like. |
| Unknown | Either snapshot is partial or uses different paging depth | Do not classify. Keep both collection records. |

## Path parameters

| Path parameter | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](https://docs.xquik.com/api-reference/overview.md#path-ids). |

## Query parameters

| Query parameter | Type | Required | Description |
| - | - | - | - |
| `cursor` | `string` | No | Pagination cursor. Pass the `next_cursor` value from the previous response to fetch the next page. |
| `pageSize` | `integer` | No | Tweets per page. Accepts `1-100`. Defaults to `20`. |

### Tweet result filters

These optional filters apply to `tweets[]` returned by this route. They keep the
same liked-tweets target. Xquik filters rows after it fetches each page. Selective
filters can return fewer rows than an unfiltered page.

See [tweet filters](https://docs.xquik.com/api-reference/x/tweet-filters.md) for every filter. Common ones are `fromUser`, `language`, `sinceDate`, `mediaType`, `minLikes`, and `hashtags`.

| Query parameter | Type | Required | Description |
| - | - | - | - |
| `sinceId` | `string` | No | Return Tweets whose IDs exceed this ID. |
| `maxId` | `string` | No | Return Tweets at or below this ID. |
| `nativeRetweets` | `boolean` | No | When `true`, only return native reposts. |

| Query parameter | Type | Required | Description |
| - | - | - | - |
| `withinTime` | `string` | No | Match Tweets from this recent window, such as `90m` or `7d`. Use a whole number & `s`, `m`, `h` or `d`. |

### Choose fields

| Query parameter | Type | Required | Description |
| - | - | - | - |
| `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. |
| `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. |

## Headers

| Header | Type | Required | Description |
| - | - | - | - |
| `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. |

## Response

### 200 OK

| Field | Type | Description |
| - | - | - |
| `tweets` | `object[]` | Array of liked tweets. |
| `tweets[].id` | `string` | Tweet ID. |
| `tweets[].text` | `string` | Tweet text content. |
| `tweets[].type` | `string` | Tweet type. Omitted if unavailable. |
| `tweets[].createdAt` | `string` | ISO 8601 creation timestamp. Omitted if unavailable. |
| `tweets[].isNoteTweet` | `boolean` | Whether this is a Note Tweet (long-form post). Omitted if unavailable. |
| `tweets[].isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. |
| `tweets[].likeCount` | `number` | Like count. Omitted if unavailable. |
| `tweets[].retweetCount` | `number` | Retweet count. Omitted if unavailable. |
| `tweets[].replyCount` | `number` | Reply count. Omitted if unavailable. |
| `tweets[].quoteCount` | `number` | Quote tweet count. Omitted if unavailable. |
| `tweets[].viewCount` | `number` | View count. Omitted if unavailable. |
| `tweets[].bookmarkCount` | `number` | Bookmark count. Omitted if unavailable. |
| `tweets[].url` | `string` | Permalink URL on X. Omitted if unavailable. |
| `tweets[].lang` | `string` | Tweet language code. Omitted if unavailable. |
| `tweets[].isReply` | `boolean` | Whether the tweet is a reply. Omitted if unavailable. |
| `tweets[].inReplyToId` | `string` | Tweet ID being replied to. Omitted if not a reply. |
| `tweets[].inReplyToUserId` | `string` | User ID being replied to. Omitted if not a reply. |
| `tweets[].inReplyToUsername` | `string` | Username being replied to. Omitted if not a reply. |
| `tweets[].conversationId` | `string` | Conversation thread ID. Omitted if unavailable. |
| `tweets[].source` | `string` | Client used to post the tweet. X sends it for some posts only. |
| `tweets[].displayTextRange` | `number[]` | Start and end offsets for rendered tweet text. Omitted if unavailable. |
| `tweets[].isLimitedReply` | `boolean` | Whether replies are limited. Omitted if unavailable. |
| `tweets[].isQuoteStatus` | `boolean` | Whether this tweet quotes another tweet. Omitted if unavailable. |
| `tweets[].isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. |
| `tweets[].entities` | `object` | Parsed entities. Omitted if unavailable. |
| `tweets[].contentDisclosure` | `object` | Disclosure metadata for paid partnership and AI-generated media labels. Includes `advertising.isPaidPromotion` and `aiGenerated.hasAiGeneratedMedia` when X returns them. Omitted if unavailable. |
| `tweets[].author` | `object` | Tweet author profile. Omitted if unavailable. |
| `tweets[].author.id` | `string` | Author user ID. |
| `tweets[].author.username` | `string` | Author handle without `@`. |
| `tweets[].author.name` | `string` | Author display name. |
| `tweets[].author.followers` | `number` | Follower count. Omitted if unavailable. |
| `tweets[].author.verified` | `boolean` | Whether the author is verified. Omitted if unavailable. |
| `tweets[].author.profilePicture` | `string` | Author profile image URL. Omitted if unavailable. |
| `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. |
| `tweets[].media` | `object[]` | Media attachments. Omitted if unavailable. |
| `tweets[].media[].mediaUrl` | `string` | Direct media URL. |
| `tweets[].media[].videoVariants` | `object[]` | Available video renditions with bitrate, content type, and URL. Omitted for images. |
| `tweets[].media[].type` | `string` | Media type. |
| `tweets[].media[].url` | `string` | Shortened URL from the tweet text. |
| `tweets[].quoted_tweet` | `object` | Embedded quoted tweet. Omitted if not a quote tweet. |
| `tweets[].retweeted_tweet` | `object` | Original retweeted tweet. Omitted if not a retweet. |
| `has_next_page` | `boolean` | Whether more results are available. |
| `next_cursor` | `string` | Opaque cursor for the next page. Empty string when no more results. |

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}}
{
  "tweets": [
    {
      "id": "1893456789012345678",
      "text": "A tweet that was liked",
      "createdAt": "2026-02-24T10:00:00.000Z",
      "likeCount": 300,
      "retweetCount": 80,
      "url": "https://x.com/user/status/1893456789012345678",
      "author": {
        "id": "44196397",
        "username": "username",
        "name": "Xquik",
        "followers": 1200,
        "verified": true,
        "profilePicture": "https://pbs.twimg.com/profile_images/example.jpg"
      },
      "media": [{ "type": "photo", "mediaUrl": "https://pbs.twimg.com/media/example.jpg" }]
    }
  ],
  "has_next_page": true,
  "next_cursor": "DAADDAABCgABF..."
}
```

### 400 Invalid user ID

`{ "error": "invalid_user_id", "message": "Send a user ID, @username or profile URL, such as x.com/nasa." }`




The user ID is empty or invalid.

### 401 Unauthenticated

Missing or invalid API key.

### 402 Payment required

Account keys get account options.
No checkout starts automatically. Confirm any payment action.

### 502 X API unavailable

The read service returned an error. Retry after a short delay.

### 429 Rate limit exceeded

You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying.

### 424 Dependency failed

When X hides a profile's reported likes from other accounts, the route returns `424 likes_unavailable`. Retrying does not help. It returns `424 x_api_unavailable` when the read service is unavailable.




Without a connected X account, the route returns `424 account_required`. Connect one, then retry.




`{ "error": "account_required", "message": "This read needs your own connected X account. Connect or restore it at dashboard.xquik.com/account, then retry." }`

> [!NOTE]
>
> **Related.** [Get user timeline](https://docs.xquik.com/api-reference/x/user-tweets.md) · [User media](https://docs.xquik.com/api-reference/x/user-media.md) · [User mentions timeline](https://docs.xquik.com/api-reference/x/user-mentions.md)

> [accordion] Related tweet, reply & media APIs
>
> * Tweets
>   * [Get tweet](https://docs.xquik.com/api-reference/x/get-tweet.md)
>   * [Tweet insights](https://docs.xquik.com/api-reference/x/tweet-engagement-insights.md)
>   * [Batch tweets](https://docs.xquik.com/api-reference/x/batch-tweets.md)
>   * [Tweet thread](https://docs.xquik.com/api-reference/x/tweet-thread.md)
>   * [Hidden replies](https://docs.xquik.com/api-reference/x/tweet-hidden-replies.md)
>   * [Translate tweet](https://docs.xquik.com/api-reference/x/tweet-translation.md)
>   * [Embed tweet](https://docs.xquik.com/api-reference/x/tweet-embed.md)
>   * [Resolve links](https://docs.xquik.com/api-reference/x/resolve-links.md)
>   * [Tweet subtitles](https://docs.xquik.com/api-reference/x/tweet-subtitles.md)
>   * [X Article](https://docs.xquik.com/api-reference/x/get-article.md)
> * Analysis
>   * [Sentiment analysis](https://docs.xquik.com/api-reference/x/sentiment-analysis.md)
>   * [Brand mentions](https://docs.xquik.com/api-reference/x/brand-monitoring.md)
>   * [News classification](https://docs.xquik.com/api-reference/x/news-classification.md)
>   * [Market signals](https://docs.xquik.com/api-reference/x/market-signals.md)
>   * [Viral score](https://docs.xquik.com/api-reference/x/viral-score.md)
>   * [Classify posts](https://docs.xquik.com/api-reference/x/classify-tweets.md)
> * Engagement
>   * [Tweet replies](https://docs.xquik.com/api-reference/x/tweet-replies.md)
>   * [Quote tweets](https://docs.xquik.com/api-reference/x/tweet-quotes.md)
>   * [Likers](https://docs.xquik.com/api-reference/x/favoriters.md)
>   * [Reposters](https://docs.xquik.com/api-reference/x/retweeters.md)
>   * [Reposter IDs](https://docs.xquik.com/api-reference/x/retweeter-ids.md)
>   * [Check repost](https://docs.xquik.com/api-reference/x/tweet-repost-check.md)
> * Profiles
>   * [User tweets](https://docs.xquik.com/api-reference/x/user-tweets.md)
>   * [Batch user tweets](https://docs.xquik.com/api-reference/x/batch-user-tweets.md)
>   * [User replies](https://docs.xquik.com/api-reference/x/user-replies.md)
>   * [User likes](https://docs.xquik.com/api-reference/x/user-likes.md)
>   * [User media](https://docs.xquik.com/api-reference/x/user-media.md)
>   * [User highlights](https://docs.xquik.com/api-reference/x/user-highlights.md)
>   * [User articles](https://docs.xquik.com/api-reference/x/user-articles.md)
> * Feeds
>   * [List tweets](https://docs.xquik.com/api-reference/x/list-tweets.md)
>   * [Trends](https://docs.xquik.com/api-reference/x/trends.md)
>   * [Trends history](https://docs.xquik.com/api-reference/x/trends-history.md)
>   * [Top tweets](https://docs.xquik.com/api-reference/x/top-tweets.md)
>   * [Trend locations](https://docs.xquik.com/api-reference/x/trend-locations.md)
>   * [Search Spaces](https://docs.xquik.com/api-reference/x/search-spaces.md)
>   * [Get Space](https://docs.xquik.com/api-reference/x/get-space.md)
>   * [Space replay](https://docs.xquik.com/api-reference/x/space-replay.md)
>   * [Get broadcast](https://docs.xquik.com/api-reference/x/get-broadcast.md)
>   * [User live status](https://docs.xquik.com/api-reference/x/user-live-status.md)
>   * [User shadowban](https://docs.xquik.com/api-reference/x/user-shadowban.md)
>   * [Notes contributor](https://docs.xquik.com/api-reference/x/community-notes-contributor.md)
>   * [Contributor notes](https://docs.xquik.com/api-reference/x/community-notes-contributor-notes.md)
>   * [Deleted notes](https://docs.xquik.com/api-reference/x/community-notes-contributor-deleted-notes.md)
>   * [Hashflags](https://docs.xquik.com/api-reference/x/hashflags.md)
>   * [Search places](https://docs.xquik.com/api-reference/x/search-places.md)
>   * [Download media](https://docs.xquik.com/api-reference/x/download-media.md)

> [accordion] Related timeline, bookmark & notification APIs
>
> * Account feeds
>   * [Home timeline](https://docs.xquik.com/api-reference/x/timeline.md) · [Notifications](https://docs.xquik.com/api-reference/x/notifications.md) · [Mentions](https://docs.xquik.com/api-reference/x/user-mentions.md)
> * Saved and private
>   * [Bookmarks](https://docs.xquik.com/api-reference/x/bookmarks.md) · [Bookmark folders](https://docs.xquik.com/api-reference/x/bookmark-folders.md) · [DM history](https://docs.xquik.com/api-reference/x/dm-history.md)

## Response examples

* **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }`
* **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": "user_not_found", "message": "X user not found. Check the username." }`
* **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }`
* **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }`
* **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }`
* **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.