{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/theroofinglist-com/json-schema/theroofinglist-com-public-contractor-schema.json",
  "title": "PublicContractor",
  "description": "A listed, open contractor. Only these fields leave the API.",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/theroofinglist-com-openapi.json#/components/schemas/PublicContractor",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991,
      "description": "The contractor id. Use it with getContractor."
    },
    "name": {
      "type": "string",
      "description": "The business name."
    },
    "trades": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "roofing",
          "siding",
          "gutters"
        ]
      },
      "description": "The trades the business works in."
    },
    "city": {
      "type": "string",
      "description": "The main location's city, for example \"Austin\"."
    },
    "state": {
      "type": "string",
      "description": "The main location's USPS state code, for example \"TX\"."
    },
    "phone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The phone number in E.164 form, or null."
    },
    "profileUrl": {
      "type": "string",
      "description": "The profile page on theroofinglist.com."
    },
    "claimed": {
      "type": "boolean",
      "description": "True when the business has claimed its profile."
    },
    "website": {
      "description": "Only present for claimed profiles.",
      "type": "string"
    },
    "rating": {
      "description": "From reviews published on The Roofing List only. Absent when there are none.",
      "type": "object",
      "properties": {
        "value": {
          "type": "number",
          "description": "Average of published reviews on The Roofing List, 1 to 5."
        },
        "count": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991,
          "description": "How many published reviews."
        }
      },
      "required": [
        "value",
        "count"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "name",
    "trades",
    "city",
    "state",
    "phone",
    "profileUrl",
    "claimed"
  ],
  "additionalProperties": false
}