> ## 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.

# X (Twitter) API TypeScript types for tweets & users

> Copy TypeScript types for tweets, tweet authors, search results, user profiles, follower checks, and trends. Use them to type each X (Twitter) read in code.

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

These types belong to the [X API TypeScript types](https://docs.xquik.com/guides/x-api-typescript-types.md) set. Copy them into your `xquik-types.ts` file.

## Types

```typescript 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"]}}
// ─── X API ──────────────────────────────────────────────

interface Tweet {
  id: string;
  text: string;
  type?: string;
  createdAt?: string;
  retweetCount?: number;
  replyCount?: number;
  likeCount?: number;
  quoteCount?: number;
  viewCount?: number;
  bookmarkCount?: number;
  media?: TweetMediaItem[];
  url?: string;
  lang?: string;
  isReply?: boolean;
  inReplyToId?: string;
  inReplyToUserId?: string;
  inReplyToUsername?: string;
  conversationId?: string;
  source?: string;
  displayTextRange?: number[];
  textHighlights?: Array<{ startIndex: number; endIndex: number }>;
  isNoteTweet?: boolean;
  isQuoteStatus?: boolean;
  isRetweet?: boolean;
  isLimitedReply?: boolean;
  entities?: Record<string, unknown>;
  author?: UserProfile;
  quoted_tweet?: Tweet;
  retweeted_tweet?: Tweet;
}

interface TweetAuthor {
  id: string;
  username: string;
  followers: number;
  verified: boolean;
  profilePicture?: string;
}

interface TweetSearchResult {
  id: string;
  text: string;
  createdAt: string;
  likeCount: number;
  retweetCount: number;
  replyCount: number;
  author: {
    id: string;
    username: string;
    name: string;
    verified: boolean;
  };
  media?: TweetMediaItem[];
}

interface UserProfile {
  id: string;
  username: string;
  name: string;
  description?: string;
  followers?: number;
  following?: number;
  verified?: boolean;
  profilePicture?: string;
  coverPicture?: string;
  location?: string;
  createdAt?: string;
  statusesCount?: number;
  mediaCount?: number;
  url?: string;
  favouritesCount?: number;
  hasCustomTimelines?: boolean;
  isTranslator?: boolean;
  withheldInCountries?: string[];
  possiblySensitive?: boolean;
  pinnedTweetIds?: string[];
  isAutomated?: boolean;
  automatedBy?: string;
  unavailable?: boolean;
  unavailableReason?: string;
  verifiedType?: string;
  profile_bio?: Record<string, unknown>;
}

interface FollowerCheck {
  sourceUsername: string;
  targetUsername: string;
  isFollowing: boolean;
  isFollowedBy: boolean;
}

// ─── Trends ─────────────────────────────────────────────

interface Trend {
  name: string;
  description?: string;
  rank?: number;
  query?: string;
}

interface TrendList {
  trends: Trend[];
  total: number;
  woeid: number;
}
```

## Next steps

* [X API TypeScript types](https://docs.xquik.com/guides/x-api-typescript-types.md)
* [Shared types](https://docs.xquik.com/guides/x-api-typescript-shared-types.md)


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