KLIQ|Developers

Infrastructure Survey (InfraScan)

This recipe walks through inspecting a steel beam bridge using the InfraScan vertical: from catalog lookup to an NBI-compliant rating report that flags structural deficiency across deck, superstructure, and substructure.

What you will build

A bridge inspection workflow that locates the bridge in the catalog, creates an inspection with the NBI bridge rating schema, uploads element-level photos, and delivers NBI 0–9 ratings per component — with automatic structural deficiency detection and a compliance report.

1. Set up the client

import { KliqClient } from '@kliq-ai/sdk';

const kliq = new KliqClient({ apiKey: process.env.KLIQ_API_KEY! });
const tenant = kliq.forTenant('t_abc123');

2. Browse the catalog for steel beam bridges

// Browse structure types in the InfraScan catalog
const types = await kliq.catalog.types.list({ verticalSlug: 'infra-scan' });

console.log(types.map(t => t.slug));
// ["steel-beam-bridges", "concrete-bridges", "suspension-bridges",
//  "culverts-tunnels", "retaining-walls"]

// Look up the specific bridge by catalog slug
const bridge = await kliq.catalog.items.get('us-hwy-34-bridge-ia');

console.log(bridge.name);
// "US Highway 34 Bridge — Iowa River Crossing"

console.log(bridge.attributes);
// { structureNumber: 'IA-034-0142', type: 'Steel Beam', spans: 3,
//   totalLength: 87.5, roadwayWidth: 9.1, yearBuilt: 1971,
//   adtTraffic: 4800, state: 'IA' }

console.log(bridge.type.gradingSchemaSlug);
// "nbi-bridge-rating"

3. Create the inspection

const inspection = await tenant.inspections.create({
  catalogItemSlug: bridge.slug,
  gradingSchemaSlug: bridge.type.gradingSchemaSlug,
  notes: 'Biennial NBI inspection. Previous rating 2024: deck 6, superstructure 6, substructure 5.',
  metadata: {
    inspector: 'pe.daniel.okafor',
    district: 'Iowa DOT District 6',
    inspectionRef: 'IDOT-2026-INS-0588',
  },
});

console.log(inspection.id); // "insp_inf001"

4. Upload element photos

NBI requires photos for each of the three primary components. Additional close-ups of deterioration areas support accurate AI rating.

const elementPhotos = [
  // Deck
  { file: deckOverallImage,   angle: 'deck-overall',   element: 'deck',            notes: 'Full deck surface from south abutment' },
  { file: deckWearImage,      angle: 'deck-wear',      element: 'deck',            notes: 'Delamination and spalling — span 2 center' },
  // Superstructure
  { file: superOverallImage,  angle: 'super-overall',  element: 'superstructure',  notes: 'Main girders from river bank' },
  { file: superCorrosionImage, angle: 'super-corrosion', element: 'superstructure', notes: 'Section loss — north girder, pier 1 bearing' },
  // Substructure
  { file: subPierImage,       angle: 'sub-pier',       element: 'substructure',    notes: 'Center pier, waterline and cap' },
  { file: subAbutmentImage,   angle: 'sub-abutment',   element: 'substructure',    notes: 'South abutment, footing exposure' },
];

const observations = await Promise.all(
  elementPhotos.map(async ({ file, angle, element, notes }) => {
    const { uploadUrl, imageUrl } = await tenant.observations.getUploadUrl({
      filename: `ia034-bridge-${angle}.jpg`,
      contentType: 'image/jpeg',
    });

    await fetch(uploadUrl, {
      method: 'PUT',
      body: file,
      headers: { 'Content-Type': 'image/jpeg' },
    });

    return tenant.observations.create({
      locationId: 'loc_us34_ia_river',
      imageUrl,
      metadata: { inspectionId: inspection.id, angle, element, notes },
    });
  })
);

console.log(`Uploaded ${observations.length} element photos`);

5. Trigger AI grading

await tenant.inspections.grade(inspection.id);

The platform loads NBI coding guidelines for steel-beam-bridges and runs element-level rating across all uploaded photos.

6. Poll for results

let result = await tenant.inspections.get(inspection.id);

while (result.status === 'grading') {
  await new Promise(r => setTimeout(r, 3000));
  result = await tenant.inspections.get(inspection.id);
}

console.log('AI ratings:', result.aiGrades);
// {
//   deck:            5,  // Fair — section loss and minor cracking, no potholes
//   superstructure:  4,  // Poor — measurable section loss at north bearing
//   substructure:    6,  // Satisfactory — minor cracking, no undermining
//   overall:         4,  // Lowest element rating governs
//   structurallyDeficient: true  // superstructure ≤ 4
// }

NBI Bridge Rating Scale

RatingLabelDescription
9ExcellentNew condition
8Very GoodNo problems noted
7GoodSome minor problems
6SatisfactoryStructural elements showing minor deterioration
5FairAll primary structural elements functioning; minor section loss
4PoorAdvanced section loss; cracking or scour
3SeriousLoss of section; deterioration requires close monitoring
2CriticalAdvanced deterioration; bridge may be closed
1Imminent FailureClosed; beyond corrective action
0FailedOut of service

A bridge is structurally deficient when any primary component (deck, superstructure, or substructure) receives a rating of 4 or below.

7. Human review and override

// Licensed PE confirms ratings after on-site inspection
const finalized = await tenant.inspections.submitHumanGrades(inspection.id, {
  grades: {
    deck:            5,  // confirmed
    superstructure:  4,  // confirmed — section loss exceeds 20% at bearing plate
    substructure:    6,  // confirmed
    overall:         4,
    structurallyDeficient: true,
  },
  notes: 'Superstructure bearing plate section loss confirmed at 22%. Load posting recommended. Schedule rehabilitation within 24 months.',
});

console.log('Structurally deficient:', finalized.finalGrades.structurallyDeficient); // true
console.log('Status:', finalized.status); // "completed"

8. Read the compliance report

const report = await tenant.inspections.get(inspection.id);

console.log(`Bridge: ${report.catalogItem.name}`);
console.log(`Schema: ${report.gradingSchema.name}`);
console.log(`Deck: NBI ${report.finalGrades.deck}`);
console.log(`Superstructure: NBI ${report.finalGrades.superstructure}`);
console.log(`Substructure: NBI ${report.finalGrades.substructure}`);
console.log(`Structurally deficient: ${report.finalGrades.structurallyDeficient}`);
console.log(`Human reviewed: ${report.humanReviewed}`);
console.log(`Completed: ${report.completedAt}`);

// Bridge: US Highway 34 Bridge — Iowa River Crossing
// Schema: NBI Bridge Rating Scale
// Deck: NBI 5
// Superstructure: NBI 4
// Substructure: NBI 6
// Structurally deficient: true
// Human reviewed: true
// Completed: 2026-04-28T19:00:00Z

Next steps