> ## 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 draw & extraction types

> Copy TypeScript types for Xquik giveaway draws, extraction jobs, extraction results, and cost estimates. Use them to type each bulk job call in your project.

> 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"]}}
// ─── Draws ──────────────────────────────────────────────

interface Draw {
  id: string;
  tweetId: string;
  tweetUrl: string;
  tweetText: string;
  tweetAuthorUsername: string;
  tweetLikeCount: number;
  tweetRetweetCount: number;
  tweetReplyCount: number;
  tweetQuoteCount: number;
  status: "pending" | "running" | "completed" | "failed";
  totalEntries: number;
  validEntries: number;
  createdAt: string;
  drawnAt?: string;
}

interface DrawListItem {
  id: string;
  tweetUrl: string;
  status: "pending" | "running" | "completed" | "failed";
  totalEntries: number;
  validEntries: number;
  createdAt: string;
  drawnAt?: string;
}

interface DrawWinner {
  position: number;
  authorUsername: string;
  tweetId: string;
  isBackup: boolean;
}

interface DrawList {
  draws: DrawListItem[];
  hasMore: boolean;
  nextCursor?: string;
}

// ─── Extractions ────────────────────────────────────────

interface ExtractionJob {
  id: string;
  toolType: ExtractionToolType;
  status: "pending" | "running" | "completed" | "failed";
  totalResults: number;
  targetTweetId?: string;
  targetUsername?: string;
  targetUserId?: string;
  targetCommunityId?: string;
  searchQuery?: string;
  errorMessage?: string;
  createdAt: string;
  completedAt?: string;
}

interface ExtractionResult {
  id: string;
  xUserId: string;
  xUsername?: string;
  xDisplayName?: string;
  xFollowersCount?: number;
  xVerified?: boolean;
  xProfileImageUrl?: string;
  tweetId?: string;
  tweetText?: string;
  tweetCreatedAt?: string;
  createdAt: string;
  enrichmentData?: Record<string, unknown>;
}

interface ExtractionList {
  extractions: ExtractionJob[];
  hasMore: boolean;
  nextCursor?: string;
}

interface ExtractionEstimate {
  allowed: boolean;
  source:
    | "collection"
    | "followers"
    | "following"
    | "paginationCap"
    | "quoteCount"
    | "replyCount"
    | "resultsLimit"
    | "retweetCount"
    | "unknown";
  estimatedResults: number;
  creditsRequired: string;
  creditsAvailable: string;
  resolvedXUserId?: string;
}
```

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