API Reference

REST endpoints served by the Next.js app at /api/*. All responses are JSON. Validation errors return { error } with HTTP 4xx.

Trades

GET /api/trades

Cursor-paginated trade list. Filters: status, sort (newest, oldest, ending_soon, value_desc, value_asc, reputation), assetKind, collection, token, verifiedOnly, maker, q. Returns { items, nextCursor }.

GET /api/trades/:address

Single trade with counter offers. Returns { trade, counterOffers }.

Wallets

GET /api/wallets/:address

Reputation + open trades by maker.

GET /api/wallets/:address/trades

All trades (maker/taker) + counter offers targeted at wallet.

Portfolio

GET /api/portfolio/:address

Helius DAS-backed portfolio: SOL, tokens, NFTs with USD values.

Other endpoints

  • GET /api/search?q= — unified search
  • GET /api/activity — event feed with pagination
  • GET /api/stats — protocol TVL, volume, counts
  • GET /api/prices?mints= — Jupiter token prices
  • GET /api/assets/:id — asset metadata by mint
  • GET /api/tokens/search?q= — token search
  • GET/POST/DELETE /api/favorites — saved trades
  • GET/POST /api/notifications — per-wallet inbox

Types

All TypeScript types (TradeSummary, TradeAsset, WalletReputation, etc.) are exported from @bazaarfi/shared and validated with Zod schemas in @bazaarfi/shared/schemas.

Full endpoint documentation with request/response examples: docs/api-reference.md