Public
Remixed
Hidden Clearances browser — deals feed + per-store stock lookup
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

🏷️ Hidden Clearances API

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.

What it does

  • 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 !deal command.
  • Stock lookup — which nearby stores have a SKU in stock for a ZIP (qty, price, aisle).

API

Full docs (with discord.js recipes): /docs or hit GET /api live for a self-describing index.

RouteDescription
GET /apiSelf-describing index of all endpoints.
GET /api/healthLiveness + token check.
GET /api/deals?limit=24&page=1&sort=newestPaginated clearance feed.
GET /api/deals/:idSingle deal by id or SKU.
GET /api/search?q=dewalt&limit=20Keyword search.
GET /api/random?sort=discountOne random recent deal.
GET /api/stock?retailer=home_depot&sku=336764660&zip=80019Per-store live stock.
GET /api/retailersSupported retailers.

All responses share an envelope: { success: true, ... } or { success: false, error: { code, message } }.

retailer accepts home_depot / lowes / walmart.

Auth

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

Structure

Rendering mermaid diagram...