API
JSON and image routes the site and marketplaces read. Works with no configuration; switches to on-chain data when configured.
Routes
| Route | Returns |
|---|---|
| GET /api/snowmen | { items, next, total, source } with pair, gene, size, owner, sort, cursor filters |
| GET /api/snowmen/[id] | one Snowman with attributes and a 90-day history |
| GET /api/stats | supply, alive, burned, tvl, lifetimeFees, per-collection |
| GET /api/metadata/[collection]/[id] | ERC-721 metadata JSON |
| GET /api/image/[collection]/[id].png | the Snowman rendered server-side at 512px |
| GET or POST /api/index | cron refresh into Postgres, bearer CRON_SECRET |
Every response carries source: "mock" | "db". The image route runs the same renderer as the browser, so what a marketplace shows is exactly what the site shows.
example
curl https://snowpons.xyz/api/stats curl -o 438.png https://snowpons.xyz/api/image/JENSEN/438.png
Environment
| Variable | Effect |
|---|---|
| DATABASE_URL | set: Postgres via Drizzle; unset: deterministic mock |
| CRON_SECRET | required for /api/index; unset means closed |
| SNOWPONS_ADDRESSES | JSON overlay on addresses.json to register collections |
| PRICES_USD | USD price per symbol used for valuations |
| NEXT_PUBLIC_CHAIN_ID / RPC_URL / EXPLORER_URL | default to 4663, the Robinhood RPC and Blockscout |
| NEXT_PUBLIC_WC_PROJECT_ID | enables WalletConnect; unset means injected wallets only |