Skip to main content

Winner Picker API: XCROP API Documentation

Winner Picker API

Run the Winner Picker from your own code. One request starts a draw; the server collects everyone who reposted, quoted or replied, runs the analyses your rules need, commits the entry list before the drand round, picks the winners with the follow checks and publishes the result page with its verifiable proof. Every rule of the web tool is available, at the same prices and with the same error codes

Endpoints

POST /api/v2/winner-picker/estimateWhat collecting a post would cost, your balance, and whether you can reuse a collection from the last 24 hours. Free
POST /api/v2/winner-picker/drawsStart a draw. Answers 202 with the draw; the server does the rest
GET /api/v2/winner-picker/draws/:idStatus, progress, credits charged, the commit and, once done, the winners
GET /api/v2/winner-picker/drawsYour API draws, newest first (limit 1 to 100, page with before)
POST /api/v2/winner-picker/draws/:id/cancelStop a draw before its commit. A running collection or analysis is charged for what it already read
POST /api/v2/winner-picker/draws/:id/retryRun a failed draw again from the step it failed on. Nothing already paid is read again
POST /api/v2/winner-picker/draws/:id/publishPublish a draw started with publish: false
POST /api/v2/winner-picker/draws/:id/rerollReplace one winner with the next pick of the committed sequence, then republish
GET /api/v2/winner-picker/draws/:id/exportWinners with their texts and wallets, or the committed eligible list, as CSV or XLSX

Start a draw

BASH
curl -X POST https://xcrop.io/api/v2/winner-picker/draws \
  -H "Authorization: Bearer xc_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://x.com/user/status/1893045621038174208",
    "winners": 3,
    "rules": {
      "requiredActions": { "retweet": true, "reply": true },
      "minFollowers": 50,
      "minTags": 2,
      "mustFollowAuthor": true,
      "countryRule": { "exclude": ["India"] }
    }
  }'

winners is 1 to 1,000 (default 1). publish (default true) publishes the result page when the draw ends. fresh: true pays for a new collection even when you collected the same post in the last 24 hours; by default that collection is reused for free, on the web and through the API alike

Send ref (your own id for the draw, up to 100 letters, digits or _ . : -) to make the call safe to repeat: the same ref again answers 200 with the draw it already started, never a second draw, so a retry after a timeout cannot double a giveaway (the same ref with any other post, winner count or rules is a 409 REF_MISMATCH). GET /api/v2/winner-picker/draws?ref=... finds it

Follow the draw

Poll GET /api/v2/winner-picker/draws/:id every few seconds. status is queued, running, done, failed or canceled. step says where it is: collect, media, reach, country, interaction, bot_check, draw, waiting_round, finish, publish, done (steps your rules do not need are skipped). progress carries done and total while a collection or an analysis runs

JSON
{
  "data": {
    "id": "wr_dwa0sinLhV7WWe",
    "status": "done",
    "step": "done",
    "entrants": 156,
    "eligible": 121,
    "credits_charged": 21000,
    "draw": { "id": "njY8plVplt", "commit_hash": "fbcedaaf…", "drand_round": 34317247, "round_time": "2026-11-27T04:51:45.000Z" },
    "result": {
      "public_url": "https://xcrop.io/winner-picker/r/njY8plVplt",
      "verified": true,
      "winners": [{ "rank": 1, "id": "1725…", "username": "…", "followers": 137, "actions": { "retweet": true, "quote": false, "reply": false }, "reply_text": null, "wallets": [] }],
      "reserves": [ … ],
      "follow_summary": { "targets": ["jadejma"], "checked": 3, "following": 3, "notFollowing": 0, "unknown": 0 },
      "excluded_by": { "excluded_country": 23, "low_reach": 6, "low_followers": 3 }
    },
    "error": null
  }
}

Rules

rules uses the same field names as the draw commitment printed in every public proof, so a rule reads the same in your code, on the result page and in the proof file. An unknown field is refused with 400, so a typo can never switch a rule off silently

requiredActions{ "retweet": true, "quote": false, "reply": true }: every ticked action is required. None ticked = any action
verifiedOnlyAny X badge (blue, gold or grey)
minFollowers · minTweets · minAccountAgeDaysWhole numbers, 0 = off. Account age is counted at the time the post was published
excludeDefaultAvatar · requireBiotrue / false
excludeAuthorDefault true: the post author never wins
minTags · requiredKeywords · requiredProfileText · minTextLengthContent rules on the reply or quote (the text your required actions ask for). Profile text matches the display name or bio
requireWalletnone, evm, sol, ton, sui, tron or btc
requireMedia · excludeDuplicateImagesA photo attached to the entry; the second drops the same picture posted by several accounts (the first poster stays)
excludeSharedWallets · excludeCopiedTextGroup rules: a wallet or a text posted by 2 or more accounts stays with the first poster
excludeUsernamesHandles removed before the draw
mustFollowAuthor · mustFollowWinners must follow the author and other accounts, up to 5 in all. Checked for the picks: a pick who does not follow is skipped for the next one
reachRule{ "window": 20, "maxMedian": 10, "minPosts": 5, "fewPosts": "keep" }: drop accounts whose median views over their last window posts (10 to 200) is at most maxMedian. Runs the median views analysis
countryRule{ "allow": ["Vietnam"] } or { "exclude": ["India"] }, plus "dropProxy": true for accounts X flags as connecting through a proxy or VPN (allow or exclude, not both). Runs the country analysis
interactionRule{ "days": 3, "fromPost": false, "unknown": "keep", "bot": "drop" }: keep entrants who replied to, quoted or reposted the author's other posts in the last 1, 3, 5 or 7 days (fromPost: the days before the post). bot: drop, keep or check (read Bot/Spam accounts in full first, paid). Runs the interaction analysis
reachBoost · interactionBoost{ "window": 20, "top": 10, "pct": 100 } and { "days": 3, "top": 50, "pct": 50 }: the top 10, 50, 100 or all by median views or by interactions hold 50% or 100% more tickets. Nobody is excluded

Credits

The API calls themselves are free. A draw is charged what the web tool charges: 10 credits per collected entrant (only the entrants actually returned), and the analyses per entrant the other rules keep: median views 120 for 20 posts, 270 for 50, 480 for 100; country 10; interaction from 30, more for accounts that post a lot. Entrants already analyzed are never charged twice. The identity scan, the draw, the follow checks, publishing and re-rolls are free

The start needs the balance a collection could cost at most (start_credits from the estimate, 402 INSUFFICIENT_CREDITS otherwise). A balance that runs short later fails the draw with the same code; top up and call /retry. At most 5 draws run at once per account

Cancel, retry, re-roll

Cancel works until the entry list is committed. After that the commit is on record and the draw always finishes, because the public page shows every commit of a post. A re-roll takes { "rank": 2, "reason": "did not reply in 48h" }, picks the next unused entrant of the committed sequence (no new randomness), checks the follow rule for them and republishes, so the public page shows the change with its reason

ℹ
A draw you start through the API is a normal draw of your account: it is listed in Your draws and can be opened, exported or re-rolled there too

Errors

Errors are { "error": "...", "code": "..." }. A failed draw carries the same in data.error. The codes are those of the web tool, for example NO_ELIGIBLE (nobody passes the rules), NO_ENTRANTS, INSUFFICIENT_CREDITS, FREE_DAILY_DRAWS, BAD_BOOST (a luck boost that covers every eligible entrant). Short outages are retried by the server before a draw fails