API Documentation

Learn how to integrate with our patent-pending Deal Engine AI technology

Our API provides access to our proprietary deal analysis algorithm, protected under US Patent Pending 63/XXXXXX. Unauthorized use is strictly prohibited.

Authentication

All API requests require authentication using an API key. After subscribing, you'll receive a unique API key that must be included in the header of each request.

X-API-Key: YOUR_API_KEY

Analyze Endpoint

POST /analyze

This endpoint analyzes a real estate deal based on the provided email address.

Parameters:
  • email (required): The email containing the deal information
Example Request:
curl -X POST "https://dealengineai.com/analyze" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{"email":"deal@example.com"}'
Example Response:
{
  "verdict": "YES",
  "confidence": 0.92,
  "email": "deal@example.com",
  "analysis_id": "550e8400-e29b-41d4-a716-446655440000",
  "usage": {
    "calls_made": 1,
    "plan_type": "basic"
  }
}

Plans Endpoint

GET /plans

Returns the available subscription plans and their details.

Example Request:
curl "https://dealengineai.com/plans"
Example Response:
{
  "basic": {
    "name": "Basic Plan",
    "price": "$9.99/month",
    "calls": 500,
    "description": "Perfect for small businesses and individual investors"
  },
  "pro": {
    "name": "Pro Plan",
    "price": "$49.99/month",
    "calls": "unlimited",
    "description": "Unlimited access for professional investors and firms"
  }
}

Usage Endpoint

GET /api-usage/{api_key}

Returns the usage information for a specific API key.

Parameters:
  • api_key (required): Your API key in the URL path
Example Request:
curl "https://dealengineai.com/api-usage/YOUR_API_KEY" \
-H "X-API-Key: YOUR_API_KEY"
Example Response:
{
  "api_key": "YOUR_API_KEY",
  "usage_count": 42,
  "plan_limit": 500,
  "remaining_calls": 458
}

Error Handling

The API uses standard HTTP status codes and returns error details in JSON format.

Common Error Codes:
  • 400: Bad Request - Missing required parameters
  • 401: Unauthorized - Invalid API key
  • 402: Payment Required - Subscription inactive
  • 429: Too Many Requests - API call limit reached
  • 500: Internal Server Error - Server-side error
Example Error Response:
{
  "error": "API call limit reached. Please upgrade to Pro plan."
}

Code Examples

Python Example:
import requests
import json

api_key = "YOUR_API_KEY"
email = "deal@example.com"

headers = {
    "X-API-Key": api_key,
    "Content-Type": "application/json"
}

data = {
    "email": email
}

response = requests.post(
    "https://dealengineai.com/analyze",
    headers=headers,
    data=json.dumps(data)
)

if response.status_code == 200:
    analysis = response.json()
    print(f"Verdict: {analysis['verdict']}")
    print(f"Confidence: {analysis['confidence']}")
    print(f"Calls made: {analysis['usage']['calls_made']}")
else:
    print(f"Error: {response.json()['error']}")
JavaScript Example:
const apiKey = "YOUR_API_KEY";
const email = "deal@example.com";

fetch(`https://dealengineai.com/analyze`, {
  method: "POST",
  headers: {
    "X-API-Key": apiKey,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ email })
})
.then(response => response.json())
.then(data => {
  if (data.error) {
    console.error(`Error: ${data.error}`);
  } else {
    console.log(`Verdict: ${data.verdict}`);
    console.log(`Confidence: ${data.confidence}`);
    console.log(`Calls made: ${data.usage.calls_made}`);
  }
})
.catch(error => console.error("API request failed:", error));
Run a Free Lease Audit
→