DealEngineAI API Documentation
Access our powerful deal analysis engine through a simple RESTful API.
Authentication
All API requests require authentication using an API key. To include your API key in requests, add the following header:
Authorization: Bearer YOUR_API_KEY
If you don't have an API key, you can obtain one by subscribing to one of our plans. Existing subscribers can find their API keys in the Dashboard.
Rate Limits
API usage is limited based on your subscription tier:
Plan | API Calls Per Day |
---|---|
Basic | 50 |
Pro | 500 |
Team | 1,500 |
Commercial | 5,000 |
When your rate limit is exceeded, the API will return a 429 Too Many Requests response.
API Endpoints
The base URL for all API requests is:
https://dealengineai.com/api
The following endpoints are available:
Endpoint | Method | Description |
---|---|---|
/api/analyze |
POST | Analyze a real estate deal from text |
/api/verify |
GET | Verify your API key and check usage limits |
/api/criteria |
GET | Get default investment criteria |
/api/health |
GET | Check API health (does not require authentication) |
Analyze Endpoint
The /api/analyze
endpoint accepts a POST request with deal text and optional investment criteria.
Request Format
POST /api/analyze Authorization: Bearer YOUR_API_KEY Content-Type: application/json { "text": "Property: 123 Main Street, Anytown, FL\nPrice: $2,500,000\nNOI: $180,000\nSquare Feet: 10,000\nCap Rate: 7.2%\nNew Roof (2022)", "investment_criteria": { "min_cash_on_cash": 8.0, "min_cap_rate": 5.0, "max_price_to_rent": 150, "max_repair_percentage": 10.0 } }
Response Format
{ "status": "success", "result": { "metrics": { "property_address": "123 Main Street, Anytown, FL", "purchase_price": 2500000, "noi": 180000, "cap_rate": 7.2, "square_feet": 10000, "price_per_sf": 250, "cash_on_cash": 8.64 }, "warnings": [ "Property may need maintenance based on recent roof replacement" ], "verdict": { "recommendation": "YES", "confidence": 85, "reasoning": "Cap rate of 7.2% exceeds minimum requirement of 5.0%. Cash-on-cash return of 8.64% exceeds minimum requirement of 8.0%." }, "missing_data": [] } }
Verify Endpoint
The /api/verify
endpoint allows you to verify your API key and check your usage limits.
Request Format
GET /api/verify Authorization: Bearer YOUR_API_KEY
Response Format
{ "status": "success", "message": "API key is valid", "api_key_info": { "created": "2025-03-15T14:30:00.000Z", "last_used": "2025-04-11T18:45:22.000Z", "plan": "pro", "usage_today": 42, "usage_limit": 500, "usage_remaining": 458 } }
Criteria Endpoint
The /api/criteria
endpoint returns the default investment criteria used by the analyzer.
Request Format
GET /api/criteria Authorization: Bearer YOUR_API_KEY
Response Format
{ "status": "success", "default_criteria": { "min_cash_on_cash": 8.0, "min_cap_rate": 5.0, "max_price_to_rent": 150, "max_repair_percentage": 10.0 } }
Code Examples
Python Example
import requests import json API_KEY = "your_api_key_here" API_URL = "https://dealengineai.com/api" headers = { "Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json" } # Analyze a deal def analyze_deal(deal_text): response = requests.post( f"{API_URL}/analyze", headers=headers, json={"text": deal_text} ) if response.status_code == 200: return response.json() else: print(f"Error: {response.status_code}") print(response.text) return None # Check API key validity and usage def check_api_key(): response = requests.get( f"{API_URL}/verify", headers=headers ) if response.status_code == 200: return response.json() else: print(f"Error: {response.status_code}") print(response.text) return None # Example usage deal_text = """ Property: 123 Main Street, Anytown, FL Price: $2,500,000 NOI: $180,000 Square Feet: 10,000 Cap Rate: 7.2% New Roof (2022) """ result = analyze_deal(deal_text) print(json.dumps(result, indent=2)) api_info = check_api_key() print(json.dumps(api_info, indent=2))
JavaScript Example
// DealEngineAI API Example const API_KEY = 'your_api_key_here'; const API_URL = 'https://dealengineai.com/api'; // Headers for all requests const headers = { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' }; // Analyze a deal async function analyzeDeal(dealText) { try { const response = await fetch(`${API_URL}/analyze`, { method: 'POST', headers: headers, body: JSON.stringify({ text: dealText }) }); const data = await response.json(); if (!response.ok) { throw new Error(`Error ${response.status}: ${data.error || 'Unknown error'}`); } return data; } catch (error) { console.error('API request failed:', error); throw error; } } // Check API key validity and usage async function checkApiKey() { try { const response = await fetch(`${API_URL}/verify`, { method: 'GET', headers: headers }); const data = await response.json(); if (!response.ok) { throw new Error(`Error ${response.status}: ${data.error || 'Unknown error'}`); } return data; } catch (error) { console.error('API request failed:', error); throw error; } } // Example usage const dealText = ` Property: 123 Main Street, Anytown, FL Price: $2,500,000 NOI: $180,000 Square Feet: 10,000 Cap Rate: 7.2% New Roof (2022) `; // Use the functions analyzeDeal(dealText) .then(result => { console.log('Analysis result:', result); }) .catch(error => { console.error('Analysis failed:', error); }); checkApiKey() .then(apiInfo => { console.log('API key info:', apiInfo); }) .catch(error => { console.error('API key check failed:', error); });