Automated CodeCraft API account farm — register via Google OAuth, apply the 100%-off yearly coupon, and harvest the generated cc_... API keys.
⚠️ Educational / research use only. Replace the placeholders below with your own accounts and credentials. Do not use accounts you don't own.
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Google OAuth │───▶│ Apply coupon │───▶│ Checkout $0 │
│ (headless CH) │ │ (DEVWEEK-like) │ │ (order success)│
└─────────────────┘ └──────────────────┘ └────────┬────────┘
│
▼
┌─────────────────────────┐
│ Create API Key │
│ → cc_xxxxxxxxxxxx │
│ → saved to keys file │
└─────────────────────────┘
- Browser step — Playwright Chromium logs into Google using a saved
storage_state(password auto-filled if the session expired), then completes the OAuth consent back to the platform. - HTTP step — all checkout calls are done via
fetch()inside the page session (critical: a separatecurlsession breaks CSRF + flash-session, which is why the key never appears). - Key extraction — the newly created key (
cc_+ 50 chars) is scraped from the dashboard DOM.
pip install playwright curl_cffi
playwright install chromiumEach Google account needs a Playwright storage_state JSON in ./states/, named after the account:
states/
YourAccountName.json # storage_state from a logged-in Google session
AnotherAccount.json
Tip: log into Google once in any Playwright script and save with
await context.storage_state(path="states/YourAccountName.json").
Open cdcrafthh.py and replace:
| Placeholder | What it is |
|---|---|
YOUR_EMAIL_DOMAIN |
email domain of your accounts (<name>YOUR_EMAIL_DOMAIN) |
YOUR_ACCOUNT_PASSWORD |
shared Google account password |
YOUR_COUPON_CODE |
the 100%-off coupon code |
YOUR_PLAN_ID |
numeric plan ID from the checkout endpoint |
YOUR_COUPON_AMOUNT |
amount value sent with the coupon request |
YOUR_BILLING_CYCLE |
monthly / yearly |
YOUR_BASE_URL |
target platform base URL |
# single account
python3 cdcrafthh.py <StateNameWithoutJson> <email>
# batch (all state files, resume-safe — skips already-harvested emails)
python3 cdcrafthh_batch.py 0 300Output: codecraft_keys.txt → email|cc_xxxxxxxx (one per line).
| Symptom | Fix |
|---|---|
OAUTH_FAIL |
storage_state expired → re-login & re-save, or let the script fill the password |
checkout OK but no cc_ key |
you're doing checkout in a separate curl session — all calls must be fetch() inside the page |
| duplicate key-name error | key name is derived from the email; clear codecraft_keys.txt before rerun |
| proxy needed | add proxy={"server":"socks5://..."} to browser.launch() |
cdcrafthh.py— single-account workercdcrafthh_batch.py— batch runner (resume-safe)
Made with 💚 — fork it, tweak the placeholders, and go harvest responsibly.