API reference

Five JSON endpoints. This hosted preview runs a JavaScript demo of those endpoints, because Netlify does not run the Python app. A self-hosted server at the same paths uses OpenAI when OPENAI_API_KEY is set, and Swagger lives at /docs there.

Demo output is sample copy for a buyer walkthrough. Review it before sending anything to a client. CMA figures are statistics from the comps you submit, not an appraisal.

GET/api/health

Returns ai_mode of demo or openai.

POST/api/listing-writer

MLS description. Body: property_details, tone (luxury, family, investment, casual, professional), length (short, medium, long).

{
  "property_details": {"address":"123 Maple Street","beds":4,"baths":3,"sqft":2400,"price":650000},
  "tone": "luxury",
  "length": "medium"
}

POST/api/cma

Comparable-sale summary, value range, and a PDF. Response field cma_pdf_url is a download path on the Python server and a PDF data URL on the hosted preview.

{
  "address": "456 Oak Avenue",
  "comps": [{"address":"100 Maple St","price":635000,"sqft":2350,"beds":4,"baths":3,"sold_date":"2025-05-15"}]
}

POST/api/social

Posts for instagram, facebook, twitter, linkedin, or all.

POST/api/email

Sequence for buyer, seller, investor, past_client, or cold_lead. num_emails is 1–7.

POST/api/outreach

Preview a sequence for a contact list. Templates: new_listing, price_drop, open_house, follow_up, custom.

Run it yourself

pip install -r backend/requirements.txt
python backend/server.py
# http://localhost:8000
# http://localhost:8000/docs

Source and the longer reference: docs/API_REFERENCE.md.