📡 API Reference¶
The API is powered by FastAPI and fully documented via OpenAPI/Swagger.
🔒 Authentication¶
- All endpoints require an 
X-Tokenheader. - Value must match 
API_TOKENenvironment variable. 

🏡 Properties¶
GET /properties/¶
- Returns list of all properties.
 

GET /properties/{id}/floor-plans¶
- Returns floor plans for a given property.
 - 404 if not found.
 
¶
📊 Analytics¶
GET /analytics/top/{x}/most-affordable¶
- Returns top 
xcheapest floor plans. 

GET /analytics/top/{x}/most-expensive¶
- Returns top 
xmost expensive floor plans.
 
GET /analytics/this-weeks-listings¶
- Listings added in last 7 days.
 

GET /analytics/search¶
- Search by filters:
 citymin_bedroomsmax_base_rentyear_built

🔮 Predictions¶
GET /predict/rent¶
- Input: bedrooms, bathrooms, sqft, state, year_built
 - Output: predicted rent price.
 

Example: ```bash curl -X GET "http://localhost:8000/predict/rent?bedrooms=2&bathrooms=1&sqft=800&state=CA&year_built=2010" \ -H "X-Token: your_api_token"