Skip to content

Add public JSON API for listings#2

Open
FOREVEREALIZE wants to merge 1 commit into
Zillatron27:mainfrom
FOREVEREALIZE:feature/public-listings-json-api
Open

Add public JSON API for listings#2
FOREVEREALIZE wants to merge 1 commit into
Zillatron27:mainfrom
FOREVEREALIZE:feature/public-listings-json-api

Conversation

@FOREVEREALIZE

Copy link
Copy Markdown

Add GET /listings/api/listings.json, a public, unauthenticated endpoint that returns active listings optionally filtered by material and location, mirroring the public browse page.

What changed:

  • Extract the browse page's filter logic into a shared apply_public_listing_filters() helper (active-only, comma-separated material tickers, substring location match) and reuse it in both the browse page and the API so they stay in sync.
  • Serialize listings with the same computed price string (format_price + CX prices), live stock status, and public seller info shown on browse.
  • Add PublicSeller / PublicListing / PublicListingsResponse schemas.

Notes:

  • The API endpoint also counts towards increment_stat(LISTINGS_VIEWED). This can be removed if not desired.

Add GET /listings/api/listings.json, a public, unauthenticated endpoint
that returns active listings optionally filtered by material and location,
mirroring the public browse page.

- Extract the browse page's filter logic into a shared
  apply_public_listing_filters() helper (active-only, comma-separated
  material tickers, substring location match) and reuse it in both the
  browse page and the API so they stay in sync.
- Serialize listings with the same computed price string (format_price +
  CX prices), live stock status, and public seller info shown on browse.
- Add PublicSeller / PublicListing / PublicListingsResponse schemas.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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