# Real Estate Investment API
> Real-estate investment maths as an API, computed locally and deterministically — the property-analysis layer a loan calculator leaves out. The cap-rate endpoint gives the net operating income and capitalization rate of a rental from its price, gross rent, vacancy allowance and operating expenses (NOI = gross rent × (1 − vacancy) − expenses; cap rate = NOI / price), plus the gross rent multiplier — the unlevered view a buyer compares deals on. The cash-flow endpoint adds financing: from a down payment (amount or percent), interest rate and term it amortizes the mortgage, then returns the monthly payment, annual debt service, the property cash flow, the cash-on-cash return (annual cash flow ÷ cash invested), the debt-service-coverage ratio (DSCR = NOI ÷ debt service, the figure lenders underwrite to) and the loan-to-value. The metrics endpoint runs the quick screening ratios investors filter on — the 1 % rule (monthly rent ≥ 1 % of price), gross rental yield, gross rent multiplier and price per square foot. Money in, ratios out, in one consistent currency. Everything is computed locally and deterministically, so it is instant and private. Ideal for proptech, real-estate-investment, rental-analysis and landlord app developers, deal-screening and underwriting tools, and personal-finance dashboards. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 compute endpoints. This is property-investment analysis; for pure loan amortization use a loan API and for DCF/NPV use an investment-appraisal API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/realestate-api/..."
```

## Pricing
- **Free** (Free) — 3,950 calls/Mo, 2 req/s
- **Starter** ($7/Mo) — 41,500 calls/Mo, 6 req/s
- **Pro** ($18/Mo) — 205,000 calls/Mo, 15 req/s
- **Mega** ($54/Mo) — 1,150,000 calls/Mo, 40 req/s

## Endpoints

### RealEstate

#### `GET /v1/cap-rate` — Cap rate and NOI

**Parameters:**
- `price` (query, required, string) — Property price/value Example: `500000`
- `annual_gross_rent` (query, required, string) — Annual gross rent Example: `48000`
- `vacancy_rate` (query, optional, string) — Vacancy % (default 0) Example: `5`
- `operating_expenses` (query, optional, string) — Annual operating expenses Example: `12000`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/realestate-api/v1/cap-rate?price=500000&annual_gross_rent=48000&vacancy_rate=5&operating_expenses=12000"
```

**Response:**
```json
{
    "data": {
        "noi": 33600,
        "note": "Cap rate = NOI / price, where NOI = gross rent × (1 − vacancy) − operating expenses (before any mortgage). GRM = price / annual gross rent.",
        "inputs": {
            "price": 500000,
            "vacancy_rate": 5,
            "annual_gross_rent": 48000,
            "operating_expenses": 12000
        },
        "cap_rate_percent": 6.72,
        "gross_rent_multiplier": 10.417,
        "effective_gross_income": 45600
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:10.007Z",
        "request_id": "9b87bbf7-9e6f-482f-bcc3-93aefbbea9d1"
    },
    "status": "ok",
    "message": "Cap rate and NOI",
    "success": true
}
```

#### `GET /v1/cash-flow` — Cash-on-cash and DSCR

**Parameters:**
- `price` (query, required, string) — Property price Example: `500000`
- `annual_gross_rent` (query, required, string) — Annual gross rent Example: `48000`
- `down_payment_percent` (query, optional, string) — Down payment % (or down_payment) Example: `20`
- `down_payment` (query, optional, string) — Down payment amount
- `interest_rate` (query, required, string) — Annual interest rate % Example: `7`
- `loan_term_years` (query, required, string) — Loan term in years Example: `30`
- `vacancy_rate` (query, optional, string) — Vacancy % Example: `5`
- `operating_expenses` (query, optional, string) — Annual operating expenses Example: `12000`
- `closing_costs` (query, optional, string) — Closing costs

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/realestate-api/v1/cash-flow?price=500000&annual_gross_rent=48000&down_payment_percent=20&interest_rate=7&loan_term_years=30&vacancy_rate=5&operating_expenses=12000"
```

**Response:**
```json
{
    "data": {
        "noi": 33600,
        "dscr": 1.0522,
        "note": "Levered view: cash-on-cash = (NOI − annual debt service) / cash invested. DSCR = NOI / annual debt service (lenders usually want ≥ 1.2). LTV = loan / price.",
        "inputs": {
            "price": 500000,
            "down_payment": 100000,
            "vacancy_rate": 5,
            "closing_costs": 0,
            "interest_rate": 7,
            "loan_term_years": 30,
            "annual_gross_rent": 48000,
            "operating_expenses": 12000
        },
        "loan_amount": 400000,
        "ltv_percent": 80,
        "monthly_payment": 2661.21,
        "annual_cash_flow": 1665.48,
        "monthly_cash_flow": 138.79,
        "annual_debt_service": 31934.52,
        "cash_on_cash_percent": 1.6655
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:10.105Z",
        "request_id": "c8fd14a4-97a9-4957-aa73-d092b11b840e"
    },
    "status": "ok",
    "message": "Cash-on-cash and DSCR",
    "success": true
}
```

#### `GET /v1/metrics` — Screening ratios

**Parameters:**
- `price` (query, required, string) — Property price Example: `200000`
- `monthly_rent` (query, required, string) — Monthly rent Example: `2000`
- `square_feet` (query, optional, string) — Living area (sqft) Example: `1500`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/realestate-api/v1/metrics?price=200000&monthly_rent=2000&square_feet=1500"
```

**Response:**
```json
{
    "data": {
        "note": "Screening ratios: the 1% rule wants monthly rent ≥ 1% of price; gross yield = annual rent / price; GRM = price / annual rent; price per square foot for comparison.",
        "inputs": {
            "price": 200000,
            "square_feet": 1500,
            "monthly_rent": 2000
        },
        "price_per_sqft": 133.33,
        "gross_yield_percent": 12,
        "gross_rent_multiplier": 8.333,
        "meets_one_percent_rule": true,
        "one_percent_rule_percent": 1
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:10.213Z",
        "request_id": "fdeb2d41-66f2-45f0-bdfe-47465e805fd9"
    },
    "status": "ok",
    "message": "Screening ratios",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/realestate-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "notes": "Money in, ratios out — use one consistent currency. NOI is before debt; cash-on-cash and DSCR add financing. For pure loan amortization use a loan API; for DCF/NPV use an investment-appraisal API.",
        "service": "realestate-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/metrics": "Quick screening ratios — 1% rule, gross yield, GRM, price per sqft.",
            "GET /v1/cap-rate": "NOI, capitalization rate and GRM (unlevered).",
            "GET /v1/cash-flow": "Financed analysis: mortgage payment, cash-on-cash return, DSCR, LTV."
        },
        "description": "Real-estate investment maths: cap rate, NOI, cash-on-cash return, DSCR, GRM and screening ratios."
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:10.316Z",
        "request_id": "ac415721-d5ba-48e3-978b-61c3fe191116"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/realestate-api
OpenAPI spec: https://www.oanor.com/api/realestate-api/openapi.json
