Skip to content

Add JSON API for x402 listings#4

Open
LubuSeb wants to merge 1 commit into
shipyard-projects:mainfrom
LubuSeb:codex/shipyard-x402-json-api
Open

Add JSON API for x402 listings#4
LubuSeb wants to merge 1 commit into
shipyard-projects:mainfrom
LubuSeb:codex/shipyard-x402-json-api

Conversation

@LubuSeb
Copy link
Copy Markdown

@LubuSeb LubuSeb commented May 22, 2026

Shipyard bounty: bnt_Xhm2SMIm

Summary

  • Add a Node/TypeScript JSON API for the x402 directory.
  • Implement GET /api/listings with q, category, limit, and offset support.
  • Implement GET /api/listings/:id and GET /api/categories.
  • Seed the directory with static records from public x402.direct service metadata, marked as indexed records.
  • Add robust JSON errors for missing listings, malformed encoded IDs, unsupported methods, and unknown routes.
  • Add tests covering categories, search, filtering, pagination, detail lookup, 400/404/405 behavior.

Scope notes

  • The seed data is static and in-memory.
  • This PR does not add database persistence, live endpoint health checks, or payment execution.
  • Requires Node.js 20 or newer.

Verification

  • npm test
  • npm run build
  • npm audit --json reports 0 vulnerabilities
  • Live local API checks passed for /api/categories, /api/listings, filtered listings, search, detail lookup, malformed ID 400, and POST 405 with Allow: GET.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant