A FastAPI-based service that transforms and consolidates property data from Deal Machine into a standardized format, specifically designed to prevent duplicate opportunities in GoHighLevel (GHL) automations.
This API was created to solve a specific issue in the Deal Machine to GHL automation workflow:
-
Duplicate Opportunities Issue: The Make.com automation was creating duplicate opportunities in GHL because:
- Deal Machine provides "bundled" data with multiple contacts/owners per property
- Different phone numbers and owner names for the same property were creating separate contacts
- The standard Make.com module for GHL couldn't effectively search for existing opportunities
-
Data Consolidation Solution: This API transforms the Deal Machine data to:
- Create a single, consolidated record per property address
- Store all associated names and phone numbers in a structured format
- Enable the automation to create one contact and one opportunity per property
- Transform Deal Machine property data into a standardized format
- Consolidate multiple contacts/owners into a single record
- Extract and organize phone numbers sequentially
- Identify and store the first contact name
- Process property flags and other metadata
- CORS enabled for cross-origin requests
- Docker support for easy deployment
- Create a virtual environment and install dependencies:
make setupOr if you already have a virtual environment:
make install- Run the API server:
make runThe API will be available at http://localhost:8000
- Start the application with Docker Compose:
make run-docker- Stop the Docker containers:
make stop-dockerOnce the server is running, you can access the interactive API documentation at:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
Transforms Deal Machine property data into a consolidated format suitable for GHL automation.
The request body should be a JSON array containing Deal Machine property data:
[
{
"results": {
"properties": [
{
"property_id": "123",
"property_address_full": "123 Main St",
"owner_name": "John Doe",
"total_bedrooms": 3,
"total_baths": 2.5,
"building_square_feet": 2000,
"EstimatedValue": 500000,
"equity_percent": 75.5,
"sale_date": "2023-01-01",
"sale_price": 450000,
"property_flags": [{"label": "Flag1"}, {"label": "Flag2"}],
"phone_numbers": [
{
"contact": {
"full_name": "John Smith",
"phone_1": "123-456-7890",
"phone_2": "987-654-3210",
"phone_3": "555-123-4567"
}
}
]
}
]
}
}
]The API returns a list of consolidated property data:
[
{
"property_id": "123",
"address": "123 Main St",
"owner_name": "John Doe",
"first_contact_name": "John Smith",
"bedrooms": 3,
"baths": 2.5,
"sqft": 2000,
"estimated_value": 500000,
"equity_percent": 75.5,
"last_sale_date": "2023-01-01",
"last_sale_price": 450000,
"flags": ["Flag1", "Flag2"],
"phone_0": "123-456-7890",
"phone_1": "555-123-4567",
"phone_2": "987-654-3210"
}
]This API is designed to be integrated into your Make.com automation workflow:
- Receive Deal Machine data
- Send it to this API for transformation
- Use the transformed data to:
- Create a single contact in GHL
- Store all phone numbers and names as custom fields
- Create one opportunity per property
This approach prevents duplicate opportunities by ensuring each property address has exactly one contact and one opportunity in GHL.
The API returns appropriate HTTP status codes and error messages:
- 400 Bad Request: Invalid input data structure
- 500 Internal Server Error: Unexpected errors during processing
make testmake setup- Create virtual environment and install dependenciesmake install- Install dependencies in existing virtual environmentmake run- Run the API server locallymake test- Run the test suitemake run-docker- Start the application with Docker Composemake stop-docker- Stop Docker containers
MIT License