A UI + JSON API that proxies hiddenclearances.com. Browse the clearance deal feed and check live per-store stock for any SKU — and consume it from a Discord bot via a clean, documented REST API.
- Deals feed — paginated grid of clearance leads (sort by newest/discount/price).
- Search — keyword search across the feed.
- Random deal — one-shot endpoint, perfect for a
!dealcommand. - Stock lookup — which nearby stores have a SKU in stock for a ZIP (qty, price, aisle).
Full docs (with discord.js recipes): /docs or hit GET /api live for a
self-describing index.
| Route | Description |
|---|---|
GET /api | Self-describing index of all endpoints. |
GET /api/health | Liveness + token check. |
GET /api/deals?limit=24&page=1&sort=newest | Paginated clearance feed. |
GET /api/deals/:id | Single deal by id or SKU. |
GET /api/search?q=dewalt&limit=20 | Keyword search. |
GET /api/random?sort=discount | One random recent deal. |
GET /api/stock?retailer=home_depot&sku=336764660&zip=80019 | Per-store live stock. |
GET /api/retailers | Supported retailers. |
All responses share an envelope: { success: true, ... } or
{ success: false, error: { code, message } }.
retailer accepts home_depot / lowes / walmart.
Upstream (HC_TOKEN) — required. The upstream API needs a Supabase JWT Bearer token
that expires (~1hr). When /api/health returns token_expired, refresh it.
👉 Set/refresh HC_TOKEN here: https://www.val.town/x/xn5n7y11/hidden-clearances-api/environment-variables?key=HC_TOKEN
Your API key (API_KEY) — optional. Leave unset to keep the API open. Set it to require
callers to pass ?key=, x-api-key, or Authorization: Bearer.
👉 Set API_KEY here: https://www.val.town/x/xn5n7y11/hidden-clearances-api/environment-variables?key=API_KEY
Rendering mermaid diagram...