# User highlights

`GET https://api.twittrapi.com/user/{userId}/highlights`

Tweets the user has added to the Highlights tab of their profile, newest first.

HTML page: https://www.twittrapi.com/docs/reference/user-userid-highlights

## Parameters

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `userId` | path | string | yes |  | Numeric user ID (digits only, up to 30). To pass a handle instead, use -1 here and set username. |
| `username` | query | string | no |  | Handle, with or without @. When set, it is used instead of userId: the API looks up the ID first, which makes the call a little slower. Still one billed call. |
| `count` | query | integer | no | 20 | Number of tweets to ask X for, 1 to 100. Other values fall back to 20. X treats it as a hint. |
| `cursor` | query | string | no |  | Bottom cursor from the previous page. Leave it out for the first page. See Pagination. |

This endpoint also accepts `format=simple` (or the header `X-Response-Format: simple`) for compact, flat JSON with a fixed schema. Same price.

Paginated: pass the bottom cursor of one page as `cursor` to get the next. Each page is one billed call.

## Response

Raw JSON of X's UserHighlightsTweets query. Entries are in data.user.result.timeline.timeline.instructions. Empty for accounts without highlights.

With `format=simple`: Collection of Tweet objects: {data: [Tweet], nextCursor, previousCursor, hasNextPage}.

## Errors

| Status | When |
| --- | --- |
| 422 | userId is not numeric, or the username lookup failed. |
| 400 | userId is -1 and username is missing, or the username contains characters X blocks. |
| 404 | The user could not be found. |

Shared errors (401 missing key, 402 no balance, 429 rate limit, 5xx) are listed on https://www.twittrapi.com/docs/helpful-infos/error-handling. Calls that fail with 400, 407, 408, 409 or a 5xx error are refunded.

## Example request

curl:

```bash
curl 'https://api.twittrapi.com/user/12/highlights?count=20' \
  --header 'X-API-KEY: YOUR_API_KEY'
```

Python:

```python
import httpx

# No SDK method for this endpoint yet, so this is a plain HTTP call.
resp = httpx.get(
    "https://api.twittrapi.com/user/12/highlights",
    headers={"X-API-KEY": "YOUR_API_KEY"},
    params={
        "count": "20",
    },
    timeout=60,
)
data = resp.json()
```

Node.js:

```js
import { TwittrAPI } from "twittrapi";

const client = new TwittrAPI({ apiKey: process.env.TWITTRAPI_API_KEY });
// No wrapper method for this endpoint yet; client.get() sends the same authenticated GET.
const data = await client.get({
  path: "/user/12/highlights",
  query: {
    count: "20",
  },
});
```

RapidAPI:

```bash
curl 'https://twitter-aio.p.rapidapi.com/user/12/highlights?count=20' \
  --header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY' \
  --header 'x-rapidapi-host: twitter-aio.p.rapidapi.com'
```

## Example response

Shortened: arrays keep their first items and long strings are cut.

Raw (default):

```json
{
  "data": {
    "user": {
      "result": {
        "__typename": "User",
        "timeline": {
          "timeline": {
            "instructions": [
              {
                "type": "TimelineClearCache"
              },
              {
                "entries": [
                  {
                    "content": {
                      "__typename": "TimelineTimelineItem",
                      "clientEventInfo": {
                        "component": "highlights",
                        "element": "tweet"
                      },
                      "entryType": "TimelineTimelineItem",
                      "itemContent": {
                        "__typename": "TimelineTweet",
                        "itemType": "TimelineTweet",
                        "tweetDisplayType": "Tweet",
                        "tweet_results": {
                          "result": {
                            "__typename": "Tweet",
                            "card": {
                              "…": "…"
                            },
                            "cashtag_attachments": [
                              "…"
                            ],
                            "core": {
                              "…": "…"
                            },
                            "edit_control": {
                              "…": "…"
                            },
                            "grok_analysis_button": false,
                            "grok_annotations": {
                              "…": "…"
                            },
                            "grok_translated_post_with_availability": {
                              "…": "…"
                            },
                            "is_translatable": false,
                            "legacy": {
                              "…": "…"
                            },
                            "rest_id": "2127061613651915028",
                            "unmention_data": {
                              "…": "…"
                            },
                            "views": {
                              "…": "…"
                            }
                          }
                        }
                      }
                    },
                    "entryId": "tweet-2127061613651915028",
                    "sortIndex": "2127344552669872128"
                  },
                  "… 3 more"
                ],
                "type": "TimelineAddEntries"
              }
            ],
            "metadata": {
              "scribeConfig": {
                "page": "highlights"
              }
            }
          }
        }
      }
    }
  }
}
```

Simple (`format=simple`):

```json
{
  "data": [
    {
      "id": "2127061613651915028",
      "url": "https://x.com/NASA/status/2127061613651915028",
      "text": "LIVE: We're sending science, supplies, holiday cookies, and much more to the @Space_Station. @NorthropGrumman's Cygnus XL cargo spacecraft is scheduled to lift off at 10:47am ET (1547 UTC). https://x.…",
      "createdAt": "2026-11-29T15:26:22Z",
      "lang": "en",
      "author": {
        "id": "11348282",
        "username": "NASA",
        "name": "NASA",
        "description": "Making the seemingly impossible, possible. ✨",
        "location": "Pale Blue Dot",
        "url": "http://www.nasa.gov/",
        "createdAt": "2007-12-19T20:20:32Z",
        "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB.jpg",
        "bannerUrl": "https://pbs.twimg.com/profile_banners/11348282/1788992290",
        "verified": true,
        "verifiedType": "Government",
        "protected": false,
        "counts": {
          "followers": 92039920,
          "following": 115,
          "tweets": 74595,
          "likes": 17128,
          "media": 28269,
          "listed": 0
        },
        "pinnedTweetIds": [],
        "isAutomated": false
      },
      "counts": {
        "likes": 1884,
        "retweets": 295,
        "replies": 155,
        "quotes": 30,
        "bookmarks": 87,
        "views": 657203
      },
      "media": [],
      "urls": [
        "https://x.com/i/broadcasts/2ReRnqpjqpWXrW"
      ],
      "hashtags": [],
      "mentions": [
        {
          "id": "1451773004",
          "username": "Space_Station"
        },
        "… 1 more"
      ],
      "replyTo": null,
      "quoted": null,
      "retweetOf": null,
      "conversationId": "2127061613651915028",
      "isPinned": false,
      "source": null,
      "article": null
    },
    "… 1 more"
  ],
  "nextCursor": "DAAHCgABHYXYmXi__-wLAAIAAAATMTg3NjQ5NDY1NjMyMzA2MzM0NAgAAwAAAAIAAA",
  "previousCursor": "DAAHCgABHYXYmXjAJxELAAIAAAATMTg4MzIwNjg3NDU2MzM4NDMyMwgAAwAAAAEAAA",
  "hasNextPage": true
}
```
