{
  "openapi": "3.1.0",
  "info": {
    "title": "AddressIntel B2B API",
    "description": "Algorithmic Deal Sourcing for Luxury Spec Builders and AI Agents. Access proprietary real estate intelligence, teardown probabilities, and market heat metrics.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.addressintel.com",
      "description": "Production Server"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/v1/market-signals": {
      "get": {
        "summary": "List Market Signals",
        "description": "Retrieves top investment opportunities scored by our proprietary engine. Properties are scored on teardown potential, flippability, and more.",
        "operationId": "listMarketSignals",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "description": "Filter by market ('sf-peninsula' or 'nantucket'). Defaults to 'sf-peninsula'.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "city",
            "in": "query",
            "description": "Filter by city name (e.g., 'Atherton')",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "address",
            "in": "query",
            "description": "Search for a specific address",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response containing a list of scored properties.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PropertySignal"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/properties/{id}": {
      "get": {
        "summary": "Get Property Intelligence",
        "description": "Retrieves detailed intelligence for a single property, including aggregated comp data and proprietary scores. (Free Tier)",
        "operationId": "getPropertyIntelligence",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique identifier of the property",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response containing property details and intelligence.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PropertyDetail"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Property not found."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PropertySignal": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "price": {
            "type": "number"
          },
          "status": {
            "type": "string"
          },
          "teardownScore": {
            "type": "number",
            "description": "0-100 probability that the property is a teardown."
          },
          "flippabilityScore": {
            "type": "number",
            "description": "0-100 score indicating renovation potential."
          },
          "developerROI": {
            "type": "number",
            "description": "Estimated Return on Investment percentage for developers."
          },
          "metadata": {
            "type": "object",
            "properties": {
              "sqft": {
                "type": "number"
              },
              "lotSize": {
                "type": "number"
              },
              "daysOnMarket": {
                "type": "number"
              }
            }
          }
        }
      },
      "PropertyDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "price": {
            "type": "number"
          },
          "intelligence": {
            "type": "object",
            "properties": {
              "teardownScore": {
                "type": "number"
              },
              "flippabilityScore": {
                "type": "number"
              },
              "marketHeatIndex": {
                "type": "number"
              },
              "biddingWarPredictor": {
                "type": "number"
              }
            }
          },
          "comparables": {
            "type": "object",
            "properties": {
              "recentSalesCount": {
                "type": "integer"
              },
              "avgPricePerSqft": {
                "type": "number"
              }
            }
          }
        }
      }
    }
  }
}
