{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Property Value Estimator",
  "nodes": [
    {
      "id": "539560e4-a419-4898-98eb-a9b9a8af9b52",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        -336
      ],
      "parameters": {
        "width": 480,
        "height": 736,
        "content": "## Property Value Estimator\n\n### How it works\n\n1. The workflow is initiated when the user clicks 'Execute workflow'.\n2. The address fields are set to be used in the requests.\n3. The workflow sends HTTP requests to Zillow, Redfin, and Realtor for property value estimates.\n4. The individual responses are merged into a single object with their values.\n5. The merged values are processed to compute the average estimated value.\n\n### Setup steps\n\n- [ ] Configure Zillow HTTP request settings with required API key.\n- [ ] Configure Redfin HTTP request settings with required API key.\n- [ ] Configure Realtor HTTP request settings with required API key.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "0cc3d103-6192-4dd7-b815-d1f9d2cd6898",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -768,
        -96
      ],
      "parameters": {
        "color": 7,
        "width": 448,
        "height": 304,
        "content": "## Trigger and field setup\n\nThis group handles the manual trigger of the workflow and setting the required address fields."
      },
      "typeVersion": 1
    },
    {
      "id": "36e43757-9753-4e46-b05c-035638bfcbe7",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        -336
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 736,
        "content": "## Fetch property values\n\nThis cluster includes HTTP requests to fetch property values from different sources: Zillow, Redfin, and Realtor."
      },
      "typeVersion": 1
    },
    {
      "id": "a5ecab31-29bc-4582-b5cf-d0c1d2ef68ec",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -112
      ],
      "parameters": {
        "color": 7,
        "width": 544,
        "height": 336,
        "content": "## Merge responses\n\nThis group merges the responses from Zillow, Redfin, and Realtor into a single object for further processing."
      },
      "typeVersion": 1
    },
    {
      "id": "7194825f-b17e-4730-a97d-321057b166bf",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        976,
        -96
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 304,
        "content": "## Calculate averages\n\nThis group processes the merged data to calculate the average property value estimate."
      },
      "typeVersion": 1
    },
    {
      "id": "ac66ea3e-bef1-4760-9dde-fa507935ff98",
      "name": "When Execute Workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -720,
        32
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "29c57d44-d943-44b3-a188-8c62e0a5eba4",
      "name": "Fetch Zillow Zestimate",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        112,
        -176
      ],
      "parameters": {
        "url": "https://zillow-com1.p.rapidapi.com/zestimate",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "address",
              "value": "="
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "zillow-com1.p.rapidapi.com"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "39b8793f-9e8f-4c5e-8552-0dd3bd440517",
      "name": "Fetch Redfin Property Data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        16,
        32
      ],
      "parameters": {
        "url": "https://redfin-com-data.p.rapidapi.com/property/search-rent",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "location",
              "value": "="
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "redfin-com-data.p.rapidapi.com"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "1ae5cc94-0c17-4955-ba02-bb1ef6c6b238",
      "name": "Fetch Realtor Property Data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        16,
        240
      ],
      "parameters": {
        "url": "https://realtor-search.p.rapidapi.com/properties/auto-complete",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "input",
              "value": "="
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "realtor-search.p.rapidapi.com"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "be930577-8660-4483-9dec-d51f4ab0f3e9",
      "name": "Set Property Address",
      "type": "n8n-nodes-base.set",
      "position": [
        -464,
        32
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "19723623-4f12-4d0d-b7bd-fbe80347f85e",
              "name": "address",
              "type": "string",
              "value": "644 Wells St SW UNIT 6, Atlanta, GA 30310"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "9dc938f0-fd3a-4045-982e-230805e9ad9e",
      "name": "Fetch Redfin Estimate",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        448,
        32
      ],
      "parameters": {
        "url": "https://redfin-com-data.p.rapidapi.com/properties/estimate",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "propertyId",
              "value": "="
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "redfin-com-data.p.rapidapi.com"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "78139ed8-6270-40a8-8eed-707758ed2e52",
      "name": "Merge Property Estimates",
      "type": "n8n-nodes-base.merge",
      "position": [
        800,
        16
      ],
      "parameters": {
        "mode": "combine",
        "options": {
          "includeUnpaired": true
        },
        "combineBy": "combineByPosition",
        "numberInputs": 3
      },
      "typeVersion": 3.2
    },
    {
      "id": "b1f5442b-7780-496b-8817-5cde2ebd126b",
      "name": "Set Estimated Values",
      "type": "n8n-nodes-base.set",
      "position": [
        1024,
        32
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "46e00f76-502c-403f-939b-7a975bf2a80d",
              "name": "zestimate",
              "type": "number",
              "value": "="
            },
            {
              "id": "ab5a3fd6-a7af-4cd2-a786-8a9b826bdbff",
              "name": "redfinEstimate",
              "type": "number",
              "value": "="
            },
            {
              "id": "2140f76f-ec41-401c-ae10-8aaae02387ef",
              "name": "realtorEstimate",
              "type": "number",
              "value": "="
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "e23237b9-91ae-4560-9be4-faf92255ad15",
      "name": "Calculate Average Estimate",
      "type": "n8n-nodes-base.code",
      "position": [
        1232,
        32
      ],
      "parameters": {
        "jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\n  const { zestimate, redfinEstimate, realtorEstimate } = item.json;\n  item.json.averageEstimate = (zestimate + redfinEstimate + realtorEstimate) / 3;\n}\n\nreturn $input.all();"
      },
      "typeVersion": 2
    },
    {
      "id": "671c8610-e283-4cd1-8750-6cac73ad39af",
      "name": "Fetch Detailed Realtor Info",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        224,
        240
      ],
      "parameters": {
        "url": "https://realtor-search.p.rapidapi.com/properties/detail",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "propertyId",
              "value": "="
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "realtor-search.p.rapidapi.com"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    }
  ],
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "connections": {
    "Set Estimated Values": {
      "main": [
        [
          {
            "node": "Calculate Average Estimate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Property Address": {
      "main": [
        [
          {
            "node": "Fetch Zillow Zestimate",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Redfin Property Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Realtor Property Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Redfin Estimate": {
      "main": [
        [
          {
            "node": "Merge Property Estimates",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "When Execute Workflow": {
      "main": [
        [
          {
            "node": "Set Property Address",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Zillow Zestimate": {
      "main": [
        [
          {
            "node": "Merge Property Estimates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Property Estimates": {
      "main": [
        [
          {
            "node": "Set Estimated Values",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Average Estimate": {
      "main": [
        []
      ]
    },
    "Fetch Redfin Property Data": {
      "main": [
        [
          {
            "node": "Fetch Redfin Estimate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Detailed Realtor Info": {
      "main": [
        [
          {
            "node": "Merge Property Estimates",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Fetch Realtor Property Data": {
      "main": [
        [
          {
            "node": "Fetch Detailed Realtor Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "triggerCount": 0
}