Documentation

Rapid Squares (beta)

Rapid Squares, in beta by request: each building outlined on an aerial photo with an estimated pitch, as squares at every pitch with waste: a one-page PDF, an XML, and the photo to overlay it on.

API reference

Base URL: https://api.roofquery.com. Authenticate with Authorization: Bearer <your key> — except the four file routes, which take no key.

Copies this whole page as Markdown, so you can paste it into an assistant and have it write the integration. Nothing secret goes on the clipboard — your keys aren't included.

Rapid Squares Beta, by request

The roof in squares, without the full report: each building's outline traced on an aerial photo and one estimated pitch per building, delivered as a one-page PDF, an XML and the photo it was traced on. For quoting and ordering material when you don't need facets, edges or diagrams. Ordered, tracked and delivered like any roof report: the same endpoints, statuses, webhooks and sandbox.

Beta, by request. Rapid Squares is turned on per account. Email [email protected] to try it. Until then an order for it is refused with 403 PRODUCT_NOT_ENABLED. While in beta it is free, and the report and its data may change; changes are announced in the changelog.
OrderPOST /api/v1/reports/orders with "reportType": "rapid_squares". Every other field as a roof report.
PriceFree during the beta. Ordering needs no credit on the balance.
DeliveryEstimated within an hour, then a completed webhook as for any report.
FilesA one-page PDF (the property photo with each building outlined in its colour, and a table of squares at every pitch from 1/12 to 12/12 with 10, 12 and 15% waste, our estimated pitch marked), the XML, and the photo the outlines were traced on, to draw them over yourself. No ESX and no diagrams: there are no roof faces to draw (those routes answer 404 not_available).
PitchOne estimated pitch per building. The table gives every other pitch too, so you can use your own.
curl -X POST "https://api.roofquery.com/api/v1/reports/orders" \
  -H "Authorization: Bearer rq_live_sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "country": "US",
    "street": "6515 Turnbridge Pl",
    "city": "Prospect",
    "state": "KY",
    "postalCode": "40059",
    "latitude": 38.3526391,
    "longitude": -85.6208045,
    "scope": "all_structures",
    "reportType": "rapid_squares"
  }'

A delivered order's totals and structures[] carry squares instead of facets and edges. totalSquares is at the estimated pitch; squaresByPitch is each building's footprint at every pitch, so you can use another.

"totals": {
  "structureCount": 1,
  "totalAreaSqFt": 5460.7,
  "totalSquares": 54.61,
  "footprintSqFt": 3861.3,
  "perimeterFt": 288.03,
  "wastePct": 10,
  "totalSquaresWithWaste": 60.07
},
"structures": [
  {
    "index": 1,
    "name": "Structure 1",
    "estimatedPitch": "12/12",
    "totalAreaSqFt": 5460.7,
    "totalSquares": 54.61,
    "footprintSqFt": 3861.3,
    "perimeterFt": 288.03,
    "squaresByPitch": { "1/12": 38.75, "4/12": 40.7, "6/12": 43.17, "8/12": 46.41, "12/12": 54.61, ... }
  }
],
"files": [
  { "name": "report.pdf", "url": "https://api.roofquery.com/api/v1/reports/orders/rq_ord_8f3a21c9/pdf" },
  { "name": "report.xml", "url": "https://api.roofquery.com/api/v1/reports/orders/rq_ord_8f3a21c9/xml" },
  { "name": "photo.jpg", "url": "https://api.roofquery.com/api/v1/reports/orders/rq_ord_8f3a21c9/photo" }
]

The XML is RoofQuery's own export, marked product="rapid_squares": the totals, then each building's pitch, its outlines and any holes (a courtyard). Points are in feet (x east, y north), and px, py are the same corner on the photo it was traced on, in pixels from its top left.

<ROOFQUERY_EXPORT version="1" product="rapid_squares" units="feet" pitchunits="in/12">
  <LOCATION address="6515 Turnbridge Pl, Prospect, KY 40059, USA" lat="38.3526391" long="-85.6208045"/>
  <IMAGE source="azure" zoom="19" width="640" height="640" ftperpx="0.3841" rotation="0"/>
  <TOTALS plansqft="3861.3" areasqft="5460.7" squares="54.61" wastepct="10" squareswithwaste="60.07" perimeterft="288.03"/>
  <STRUCTURES>
    <STRUCTURE id="1" name="Structure 1" pitch="12" plansqft="3861.3" areasqft="5460.7" squares="54.61" perimeterft="288.03">
      <OUTLINE>
        <POINT x="-29.2614" y="-41.6303" px="243.82" py="428.38"/>
        ...
      </OUTLINE>
    </STRUCTURE>
  </STRUCTURES>
</ROOFQUERY_EXPORT>
GET /api/v1/reports/orders/:id/photo

The photo the outlines were traced on, a JPEG exactly as traced (no outlines, no branding). Each <POINT>'s px, py in the XML is that corner's pixel on it, from its top left, so the outlines go over it with no scaling or turning: <IMAGE width height> are its size and ftperpx its scale. No key, like the PDF and XML. 409 not_ready until the order completes; 404 not_available on any other kind of report.

curl "https://api.roofquery.com/api/v1/reports/orders/rq_ord_8f3a21c9/photo" -o photo.jpg
// the outlines over the photo, in a browser
const xml = new DOMParser().parseFromString(await (await fetch(xmlUrl)).text(), 'application/xml');
const img = await new Promise((ok) => { const i = new Image(); i.onload = () => ok(i); i.src = photoUrl; });
const c = document.createElement('canvas'), g = c.getContext('2d');
c.width = img.naturalWidth; c.height = img.naturalHeight; g.drawImage(img, 0, 0);
for (const shape of xml.querySelectorAll('OUTLINE, HOLE')) {
  g.beginPath();
  shape.querySelectorAll('POINT').forEach((p, i) => g[i ? 'lineTo' : 'moveTo'](+p.getAttribute('px'), +p.getAttribute('py')));
  g.closePath(); g.lineWidth = 3; g.strokeStyle = '#1668b8'; g.stroke();
}

Sandbox: a Rapid Squares order on a sandbox key delivers a recorded report (PDF, XML and photo) on the usual sandbox timeline, with its webhooks, free.