Skip to main content
Run bulk data extractions from X in 4 steps: check your budget, estimate costs, run the job, and retrieve results. This guide covers the full workflow for both the REST API and MCP server.

Workflow Overview

Check Budget → Estimate Cost → Run Extraction → Get Results → Export (optional)
1

Check your budget

Verify your subscription is active and you have enough quota remaining.
2

Estimate cost

Preview the extraction cost before committing. Check whether it fits within your remaining budget.
3

Run the extraction

Submit the extraction job with the appropriate tool type and target.
4

Retrieve results

Paginate through extracted data via the API, or export as CSV/XLSX/Markdown.

Step 1: Check Your Budget

Before running an extraction, verify your subscription status and remaining quota.
curl -s https://xquik.com/api/v1/account \
  -H "x-api-key: xq_YOUR_KEY_HERE" | jq
The response includes your current billing period and usage percentage:
{
  "plan": "active",
  "monitorsAllowed": 1,
  "monitorsUsed": 1,
  "currentPeriod": {
    "start": "2026-02-01T00:00:00.000Z",
    "end": "2026-03-01T00:00:00.000Z",
    "usagePercent": 45
  }
}
If usagePercent is near 100, consider waiting for the next billing period or running a smaller extraction.

Step 2: Estimate Cost

Always estimate before running. The estimate endpoint previews the result count and projected usage without consuming any quota.
curl -X POST https://xquik.com/api/v1/extractions/estimate \
  -H "x-api-key: xq_YOUR_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "toolType": "reply_extractor",
    "targetTweetId": "1893704267862470862"
  }' | jq
Response:
{
  "allowed": true,
  "source": "replyCount",
  "estimatedResults": 150,
  "usagePercent": 45,
  "projectedPercent": 78
}
FieldDescription
allowedWhether the extraction fits within your monthly quota
sourceData point used for the estimate (e.g. replyCount, followers)
estimatedResultsApproximate number of results
usagePercentCurrent usage before this extraction
projectedPercentProjected usage after completion
If allowed is false, the extraction will return 402. Wait for the next billing period or run a smaller job.

Step 3: Run the Extraction

Submit the job with the same parameters you used for the estimate.
curl -X POST https://xquik.com/api/v1/extractions \
  -H "x-api-key: xq_YOUR_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "toolType": "reply_extractor",
    "targetTweetId": "1893704267862470862"
  }' | jq
Response:
{
  "id": "77777",
  "toolType": "reply_extractor",
  "status": "completed",
  "totalResults": 150
}
The job runs synchronously and returns when complete. For large extractions (10,000+ results), this may take up to a few minutes.

Step 4: Retrieve Results

Option A: Paginate via API

Fetch results in pages of up to 1,000 records. Use cursor-based pagination to iterate through all results.
# First page
curl -s "https://xquik.com/api/v1/extractions/77777?limit=1000" \
  -H "x-api-key: xq_YOUR_KEY_HERE" | jq

# Next page (use nextCursor from previous response)
curl -s "https://xquik.com/api/v1/extractions/77777?limit=1000&after=990100" \
  -H "x-api-key: xq_YOUR_KEY_HERE" | jq
Each result contains user profile data and (for tweet-based tools) tweet data:
{
  "id": "990001",
  "xUserId": "44196397",
  "xUsername": "elonmusk",
  "xDisplayName": "Elon Musk",
  "xFollowersCount": 210500000,
  "xVerified": true,
  "xProfileImageUrl": "https://pbs.twimg.com/profile_images/el0n.jpg",
  "tweetId": "1893710452812718080",
  "tweetText": "This is a great thread, thanks for sharing.",
  "tweetCreatedAt": "2026-02-24T10:05:00.000Z"
}
Only id and xUserId are guaranteed on every result. All other fields are omitted when unavailable (never null). Check for field presence before accessing.

Option B: Export as File

Download all results as CSV, XLSX, or Markdown. Exports include enrichment data (bios, locations, engagement metrics) not available in the API response.
curl -s "https://xquik.com/api/v1/extractions/77777/export?format=csv" \
  -H "x-api-key: xq_YOUR_KEY_HERE" \
  -o extraction-reply_extractor-77777.csv
FormatContent-TypeUse Case
csvtext/csv; charset=utf-8Spreadsheets, data pipelines
xlsxapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheetExcel, formatted reports
mdtext/markdown; charset=utf-8Documentation, GitHub issues
Exports are capped at 50,000 rows. For larger extractions, use the paginated API to retrieve all results.

Tool Types Reference

All 19 extraction tools grouped by target type. Each requires a specific target field.

Tweet-Based Tools

Tool TypeRequired FieldDescription
reply_extractortargetTweetIdExtract users who replied to a tweet
repost_extractortargetTweetIdExtract users who retweeted a tweet
quote_extractortargetTweetIdExtract users who quote-tweeted a tweet
thread_extractortargetTweetIdExtract all tweets in a thread
article_extractortargetTweetIdExtract article content from a tweet

User-Based Tools

Tool TypeRequired FieldDescription
follower_explorertargetUsernameExtract followers of an account
following_explorertargetUsernameExtract accounts followed by a user
verified_follower_explorertargetUsernameExtract verified followers of an account
mention_extractortargetUsernameExtract tweets mentioning an account
post_extractortargetUsernameExtract posts from an account

Community Tools

Tool TypeRequired FieldDescription
community_extractortargetCommunityIdExtract members of a community
community_moderator_explorertargetCommunityIdExtract moderators of a community
community_post_extractortargetCommunityIdExtract posts from a community
community_searchtargetCommunityId + searchQuerySearch posts within a community

List Tools

Tool TypeRequired FieldDescription
list_member_extractortargetListIdExtract members of a list
list_post_extractortargetListIdExtract posts from a list
list_follower_explorertargetListIdExtract followers of a list

Other Tools

Tool TypeRequired FieldDescription
people_searchsearchQuerySearch for users by keyword
space_explorertargetSpaceIdExtract participants of a Space

MCP Equivalent

The same workflow works through the MCP server using 3 tools:
REST APIMCP ToolPurpose
GET /accountget-accountCheck subscription and usage
POST /extractions/estimateestimate-extractionPreview cost
POST /extractionsrun-extractionStart the job
GET /extractions/:idget-extractionRetrieve results
Example prompts for AI agents:
File export (GET /extractions/:id/export) is only available via the REST API. The MCP server returns results as structured JSON through the get-extraction tool.

Error Handling

ErrorCauseSolution
402 no_subscriptionNo active subscriptionSubscribe from the dashboard
402 usage_limit_reachedMonthly quota exhaustedWait for next billing period
400 invalid_tool_typeUnrecognized toolTypeCheck the tool types table
400 invalid_inputMissing required target fieldMatch target field to tool type
502 x_api_unavailableX API temporarily downRetry with exponential backoff

Next Steps