// Open Source
Valuation Engine API
Our core valuation methodology, published as an npm package. Install it, inspect the code, use it in your projects.
Installation
Install via npm or yarn. Zero dependencies. TypeScript support included.
terminal
# npm
npm install lhbusa-valuation-engine
# yarn
yarn add lhbusa-valuation-engine
Quick Start
Basic usage with the calculateOffer function. Pass property details, get an instant valuation.
example.ts
import { calculateOffer } from 'lhbusa-valuation-engine';
const result = calculateOffer({
arv: 310000,
condition: 'fair',
sqft: 1850,
beds: 3,
baths: 2,
market: 'stable'
});
console.log(result);
// {
// offer: 247500,
// confidence: 0.94,
// breakdown: { arv: 310000, repairs: 24800, net: 285200 }
// }
API Reference calculateOffer()
The main function for calculating property offers. All parameters are validated at runtime.
| Parameter | Type | Description |
|---|---|---|
arv required | number | After Repair Value in dollars |
condition required | 'excellent' | 'good' | 'fair' | 'poor' | Current property condition |
sqft | number | Square footage (improves accuracy) |
beds | number | Number of bedrooms |
baths | number | Number of bathrooms |
market | 'hot' | 'stable' | 'cold' | Current market conditions |
Response Object
The function returns a structured object with the calculated offer and supporting data.
types.ts
interface OfferResult {
offer: number; // Maximum offer price
confidence: number; // 0-1 confidence score
breakdown: {
arv: number; // Input ARV
repairs: number; // Estimated repairs
net: number; // Net after repairs
};
recommendation: 'strong_buy' | 'buy' | 'hold' | 'pass';
}