I built a PokeGrade card-sniping terminal in a weekend. Here's the exact prompt to build your own.

@pokegrade
अंग्रेज़ी2 दिन पहले · 20 जुल॰ 2026
362K
254
9
8
725

TL;DR

This article provides a detailed multi-phase prompt for building an automated Pokemon card trading terminal that uses the PokeGrade API and Claude Code to find market arbitrage opportunities.

Flipping Pokemon slabs is easy. The problem though: deals on Mercari, eBay, and Vinted can get taken in minutes or simply be hard to find, and no human can watch three marketplaces around the clock and check every listing.

So I had Claude Code build me a watcher. Two days later, this is what runs 24/7 on the Mac mini in my office:

The tool.

Every 5 minutes it scans fresh listings across Mercari, eBay, and Vinted. Each new listing's photo goes through the PokeGrade API, which identifies the exact card and pulls its live market value — raw AND graded comps. The PokeGrade API is what powers our website behind the scenes. We offer free access to it for developers. PokeGrade.ai/developers

If a slab is listed 25%+ under market, Mercari listings get auto-hearted and everything else pings my phone. Two strategies run side by side: underpriced slabs, and the weirder one — slabs priced below what the ungraded card sells for (crack-the-slab arbitrage; rare, but it exists).

pokegrade.ai - inline image

The terminal.

A live dashboard — dark trading-desk aesthetic, scrolling ticker, status LEDs — showing every evaluation, potential-profit tallies with fee math baked in, sold-price charts for products I'm monitoring (sampled every 60 seconds from eBay solds), and a ledger: paste any listing URL from five marketplaces and a scraper logs the buy or sale and tracks my running P/L. Theoretically, I could hook my script up to my accounts and have it scrape them every hour; simply haven't done this yet. Yen and euros convert automatically. One button moves a sniped find straight into the ledger. Works from my phone.

The part nobody tells you. The features took an afternoon. The other day and a half was the knife-fight with reality: marketplace bot-detection that rejects automated browsers, pages that render different code depending on whether you're logged in, Japanese cards hiding behind English titles, macOS silently killing background jobs that live in the wrong folder. Every one of those cost hours to diagnose and one line to fix.

That's why I'm sharing the prompt instead of the code. The prompt carries all of it — every verified selector, every trap, every guard — so your build skips the knife-fight.

The rules that make it safe. It never buys anything. It never sends offers. Extreme "deals" (5x+ ratios) get flagged as suspect instead of celebrated, because they're almost always shady listings or the AI comping the wrong card. A human looks at every deal before money moves. Build it the same way — the automation finds, you decide.

Costs: PokeGrade API for card identification (free tier: 100 evaluations/month to try it; paid tiers if you scan seriously), free eBay developer account, and a computer that stays on. That's it.

The prompt.

Copy everything below into Claude Code, fill in the three placeholders, and build it phase by phase (each phase is independently useful).

I want a personal card-flipping toolkit on my computer, built as a set of launchd-managed background services (or windows equivalent) plus a local web dashboard. Stack: Node.js + Playwright, no frameworks, no database — CSV/JSON files in one project folder. Everything must survive reboots. I'll be sending you 5 phases. After each phase is complete, please let me know that you're ready for the next phase. Some API keys and Phase 1 is first.

My inputs (fill in):

PokeGrade API key: PGAI_KEY_HERE (from

pokegrade.ai/developers — the /value endpoint identifies a card from one photo and returns raw + graded market prices; docs at

pokegrade.ai/developers/docs

eBay production keyset: EBAY_CLIENT_ID / EBAY_CLIENT_SECRET (free at

developer.ebay.com ; apply for the account-deletion exemption to activate)

My deal thresholds: heart/alert at market value at least 1.25x asking price; offer-worklist band 1.15-1.25x (about 26% net margin after an accepted 80% offer and ~12% selling fees)

PHASE 1 — Mercari sniper (auto-heart)

A service that scans Mercari searches every ~10 min, prices each new listing's FIRST PHOTO through PokeGrade /value, and hearts listings that clear the deal threshold. Two strategies from a config array, one browser process:

raw-crack: search "pokemon psa 8", compare the RAW (ungraded) value — finds slabs worth cracking (raw > slab price; rare but real). graded-under: searches psa 8/9/10, compare the slab's own-grade comp.

**Critical implementation facts (all verified, will save you hours): **

Mercari's bot check (PerimeterX) hard-rejects Playwright's bundled Chromium — the press-and-hold challenge loops forever. Launch the REAL installed Chrome: channel:'chrome', headful, persistent profile dir, --disable-blink-features=AutomationControlled, ignoreDefaultArgs:['--enable-automation']. Never automate the login: detect logged-out (visiting /mypage/ redirects CLIENT-SIDE after ~15s to /login/?login_callback=... — poll the URL, not the DOM) and wait up to 30 min for the human to log in once; session persists in the profile.

Logged-in vs logged-out pages use DIFFERENT test ids. Logged-in search: tiles a[data-testid="ProductThumbWrapper"], price ProductThumbItemPrice (logged-out: ItemPrice — accept both), tile heart ItemLike (inside the tile anchor — heart from the search page, no need to open listings), item-page heart LikeComp. ProductThumbItemDiscountedPrice is the struck-through ORIGINAL price — never use it; discounted tiles concatenate both prices in one text node ("$99.75$105"), so parse only the FIRST money token.

First listing photo needs no page visit:

https://u-mercari-images.mercdn.net/photos/ITEMID_1.jpg (plain fetch).

"New" = item id not previously evaluated (state file), newest-first sort, skip SOLD tiles. Each PokeGrade call = 1 credit — cache results per item id forever and share the cache across strategies. Track hearted ids separately from seen ids (a crash between grade and heart must never cause a double-click, which would UN-heart). Transient failures (API 5xx, missing price) stay un-seen and retry next cycle.

launchd gotcha: agents CANNOT read ~/Desktop (TCC) — the job dies silently with exit 78. Keep the project in the home folder, not Desktop. RunAtLoad + KeepAlive; absolute node path in the plist.

**PHASE 2 — eBay + Vinted feeds (notify-only) **

Same strategies/thresholds, but neither has a watch-list API, so deals fire a macOS notification (osascript display notification) + CSV row instead of a heart/favorite.

eBay: use the official Browse API (client-credentials OAuth, item_summary/search, sort=newlyListed, filter buyingOptions FIXED_PRICE + itemLocationCountry US — note priceCurrency is only valid alongside a price range). Upgrade image URLs s-l225 to s-l1600 for OCR. About 5k API calls/day at 3 searches per 10 min is fine; PokeGrade burn is the real budget (about 5k credits/day at eBay volume — cap evaluations per search, e.g. 15).

Vinted: scrape the catalog (no API, but no bot wall either). Tiles: a[data-testid="product-item-id-ID--overlay-link"] whose title attribute packs "name, brand: X, condition: Y,

$price "; images at [data-testid="...--image"] img (bump the /f###/ URL segment to /f800/). Vinted pages CRASH headless Chromium about 1-in-3 loads AND can hang without throwing — wrap every scrape in a 90s watchdog Promise.race and relaunch the browser on failure. Log a heartbeat line every cycle so a silent log means "stuck", not "quiet".

Quality guards (all learned from real false positives):

Pre-credit: skip titles that are lots/bundles or mention japanese/chinese/korean/german/french/etc.

Post-identification: reject if PokeGrade's identified set is a foreign market (JP/CS/CN/KR tokens) — sellers hide language from titles.

Celebrations trap: PokeGrade can misidentify Celebrations "Classic Collection" reprints as the vintage originals (a $30 reprint comps at $30k). If the title says celebrations/classic collection but the identified set doesn't, discard the comp. Same reprint risk: Base Set 2, XY Evolutions.

Anything with ratio of 5x or more is flagged "suspect — needs review" and excluded from headline earnings (extreme ratios are nearly always comp mismatches, not jackpots).

PHASE 3 — Dashboard (localhost web app)

Single no-dependency Node HTTP server (bind 0.0.0.0 so phones on the LAN can open it) serving one HTML file that polls a /data endpoint every 30s. Dark-first "trading terminal" aesthetic: monospace numerals, status LEDs per service (log-file mtime = health), scrolling ticker of recent evaluations, count-up animations. Three tabs:

1. Sniper — stat band (potential profit after fees excluding suspects, deals, offers, needs-review, evaluated), per-hour scan activity chart, cumulative earnings chart, verdict breakdown, strategy scoreboard, and a sortable finds table with listing thumbnails, star/favorite toggles (filterable), and a "bought" button that copies a find straight into the ledger.

2. Market watch — sold-price trackers (Phase 4).

3. Ledger — Phase 5.

Serve external images through a same-origin /thumb proxy (whitelist the marketplace CDNs) — cross-origin/hotlinked images get blocked in some clients. Suspect finds: warning badge + excluded from totals.

PHASE 4 — Sold-price market trackers

eBay sold data is NOT in the public API. Scrape the sold search (LH_Sold=1, LH_Complete=1, sort newest) with headless Chromium (channel:'chromium'), browser-UA spoof, and a homepage warm-up visit first (deep-linking cold gets bot-blocked). Cards: [data-listingid] elements; real solds have a "SOLD date" line (sponsored ads don't). Every minute, for each configured query: take the 10 most recent sold prices, append avg/median/min/max to a CSV. Dashboard graphs avg line + min-max band per tracker with +/- time-window zoom buttons. A one-shot backfill script walks up to 10 result pages grouping by the printed sold date to reconstruct about a week of daily history (idempotent). Back off 10 minutes after 3 consecutive empty extractions.

PHASE 5 — Ledger (buy/sell P/L)

Ledger tab with a BUY input and a SELL input: paste any listing URL from

mercari.com ,

jp.mercari.com ,

japan.us.mercari.com (cross-border storefront),

ebay.com (including

ebay.io app-share shortlinks), or

vinted.com . A deterministic fetcher script (no AI) extracts title/price/currency/image:

Primary:

schema.org Product JSON-LD (exact on jp.mercari, ebay, vinted).

japan.us .mercari has NO JSON-LD — price is [data-testid="main-price"] (symbol and number on separate lines), already USD.

ebay.io shortlinks only resolve in a real browser and often land on an error shell — grab the item id from the resolved URL and call the Browse API get_item_by_legacy_id instead.

Reject bot-challenge pages ("Just a moment...", "Error Page") as errors — never store them as entries.

Convert non-USD via

frankfurter.app (ECB, free, cache 12h). Store entries in ledger.json; running tally = sold minus bought, plus an after-12%-fees figure; rows show thumbnail, market chip, native + USD price, and a confirm-guarded delete. Recorded price = listed price (ignore offers) — that's a deliberate simplification.

ACCEPTANCE CHECKS PER PHASE

Run one real cycle and show me the log; verify a real listing end-to-end through PokeGrade before wiring the loop; after any UI change, screenshot the dashboard in both light and dark mode; never leave test entries in my ledger or test hearts on my account.

Fair warnings before you run it: scrapers sit in a gray zone with marketplace ToS — keep the cadence gentle and expect the occasional captcha. AI card-identification is wrong often enough that auto-buying would be lighting money on fire. And your fee reality may differ from my 12% — retune the thresholds.

If you build one, show me what it finds.

एक क्लिक में सहेजें

YouMind में वायरल लेखों की AI गहन पढ़ाई

स्रोत सहेजें, केंद्रित सवाल पूछें, तर्क का सारांश बनाएँ और एक वायरल लेख को एक ही AI वर्कस्पेस में दोबारा इस्तेमाल करने लायक नोट्स में बदलें।

YouMind देखें
क्रिएटर्स के लिए

अपने Markdown को एक साफ़-सुथरे 𝕏 आर्टिकल में बदलें

जब आप अपना लंबा कंटेंट पब्लिश करते हैं, तो इमेज, टेबल और कोड ब्लॉक को 𝕏 के लिए फ़ॉर्मेट करना मुश्किल होता है। YouMind पूरे Markdown ड्राफ़्ट को एक साफ़-सुथरे, पोस्ट के लिए तैयार 𝕏 आर्टिकल में बदल देता है।

Markdown से 𝕏 आज़माएँ

समझने के लिए और पैटर्न

हाल के वायरल लेख

और वायरल लेख देखें