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 subscription status and credit balance: If creditInfo.balance is low, consider topping up 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:
FieldDescription
allowedWhether the extraction can proceed with the current credit balance
sourceData point used for the estimate (e.g. replyCount, followers)
estimatedResultsApproximate number of results
creditsRequiredCredits this extraction will consume
creditsAvailableCredits currently available in your balance
resolvedXUserIdResolved X user ID when targetUsername was provided. Omitted for non-user-based tools
If allowed is false, the extraction will return 402. Top up credits or run a smaller job.
Add resultsLimit to cap the number of results. Both the estimate and extraction endpoints accept this parameter. The estimate will use resultsLimit as the projected count, and the extraction will stop early once the limit is reached.

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": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "toolType": "reply_extractor",
  "status": "running"
}
The endpoint returns 202 Accepted with the job in running status. Poll GET /extractions/{id} until status is completed or failed. For large extractions (10,000+ results), this may take up to a few minutes.

AI summaries

Completed extractions and draws automatically receive AI-generated summaries in 3 languages (EN, TR, ES). These appear as the aiTitles field on job responses:
{
  "aiTitles": {
    "en": "150 replies to @elonmusk's tweet about Starship",
    "tr": "Starship hakkinda @elonmusk'un tweetine 150 yanit",
    "es": "150 respuestas al tweet de @elonmusk sobre Starship"
  }
}
AI titles are generated asynchronously after job completion and may not appear immediately.

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:
Only id, xUserId, and createdAt 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
jsonapplication/json; charset=utf-8APIs, programmatic processing
mdtext/markdown; charset=utf-8Documentation, GitHub issues
md-documenttext/markdown; charset=utf-8Long-form markdown documents
pdfapplication/pdfReports, sharing (max 10,000 rows)
txttext/plain; charset=utf-8Plain text, logs
xlsxapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheetExcel, formatted reports
Exports are capped at 100,000 rows (10,000 for PDF). For larger extractions, use the paginated API to retrieve all results.

Tool types reference

All 23 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
favoriterstargetTweetIdExtract users who liked 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
user_likestargetUsernameExtract tweets liked by a user
user_mediatargetUsernameExtract media posts from a user

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
tweet_search_extractorsearchQuerySearch and extract tweets by keyword or hashtag

Tweet search filters

tweet_search_extractor supports 16 optional filter parameters that are converted to X search operators internally. These filters only apply to tweet_search_extractor and are ignored by all other tool types.
ParameterTypeDescription
fromUserstringFilter by author username
toUserstringFilter tweets directed to a user
mentioningstringFilter tweets mentioning a user
languagestringLanguage code (e.g. en, tr, es)
sinceDatestringStart date YYYY-MM-DD
untilDatestringEnd date YYYY-MM-DD
mediaTypestringimages, videos, gifs, or media
minFavesnumberMinimum likes
minRetweetsnumberMinimum retweets
minRepliesnumberMinimum replies
verifiedOnlybooleanVerified authors only
repliesstringinclude, exclude, or only
retweetsstringinclude, exclude, or only
exactPhrasestringExact phrase match
excludeWordsstringComma-separated words to exclude
advancedQuerystringRaw X search operator syntax
Example: Search for popular English tweets with images from the last week
curl -X POST https://xquik.com/api/v1/extractions \
  -H "x-api-key: xq_YOUR_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "toolType": "tweet_search_extractor",
    "searchQuery": "artificial intelligence",
    "language": "en",
    "mediaType": "images",
    "minFaves": 100,
    "sinceDate": "2026-03-06",
    "untilDate": "2026-03-13",
    "retweets": "exclude"
  }' | jq
Combine filters with resultsLimit to run targeted, cost-efficient searches. For example, find the top 50 viral tweets about a topic from verified accounts in the last 24 hours.

MCP equivalent

The same workflow works through the MCP server using the xquik sandbox tool:
REST APIMCP Sandbox CodePurpose
GET /accountxquik.request('/api/v1/account')Check subscription and usage
POST /extractions/estimatexquik.request('/api/v1/extractions/estimate', { method: 'POST', body: { ... } })Preview cost
POST /extractionsxquik.request('/api/v1/extractions', { method: 'POST', body: { ... } })Start the job
GET /extractions/:idxquik.request('/api/v1/extractions/ID')Retrieve 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 via xquik.request().

Error handling

ErrorCauseSolution
402 no_subscriptionNo active subscriptionSubscribe from the dashboard
402 insufficient_creditsInsufficient creditsTop up credits or wait for next grant
400 invalid_tool_typeUnrecognized toolTypeCheck the tool types table
400 invalid_inputMissing required target fieldMatch target field to tool type
502 x_api_unavailableX data source temporarily downRetry with exponential backoff

Next steps

Create Extraction

Full API reference with request/response schemas.

Estimate Extraction

Cost estimation endpoint reference.

Export Extraction

CSV, XLSX, and Markdown export with column details.

Billing & Usage

Pricing, quotas, and usage scenarios.