Fiber Trace API

Parse OTDR traces from your own code. Send a .sor, .msor, or .trc file, get back structured JSON. The same engine behind the free browser tools, built for automation.

If you're processing traces in bulk or on a schedule, you don't need to drive a browser. This is the parser from the analyzer as a plain HTTP endpoint: one trace in, structured results out. Files are parsed in memory and never stored.

Want a key? The API is in early access while we bring on the first teams. Tell us what you're building and we'll set you up.

Request API access →

Authentication

Every request needs your API key in the Authorization header as a bearer token (or an X-API-Key header). Keep it server-side; treat it like a password.

# every request carries your key
Authorization: Bearer jts_live_…

Parse a trace

POST https://johnstonetechs.com/api/v1/parse

Send the file as base64 in a JSON body. Supported today: .sor, .msor (Bellcore/Telcordia SR-4731), and EXFO .trc. Max 4 MB per file.

Request body

FieldTypeNotes
file_base64stringRequired. The file's bytes, base64-encoded. A data: prefix is stripped if present.
filenamestringOptional. Helps format detection (e.g. "span12.sor").

Example

# base64 the file and POST it
B64=$(base64 -w0 span12.sor)
curl -s https://johnstonetechs.com/api/v1/parse \
  -H "Authorization: Bearer $JTS_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"filename\":\"span12.sor\",\"file_base64\":\"$B64\"}"

Response

Returns the same structure the analyzer produces: headline stats, the full events table, and instrument meta.

{
  "ok": true,
  "filename": "span12.sor",
  "result": {
    "format": "sor",
    "meta": { "otdr_vendor": "Viavi", "otdr_model": "ONA-800", "wavelength_nm": 1550, … },
    "stats": { "total_length_km": "100.935", "total_loss_db": "29.97", … },
    "events": [ { "dist_m": 100934, "loss_db": 0.31, "reflectance_db": -45.2, "type": "…" }, … ],
    "warnings": [ ]
  }
}

Errors

StatusMeaning
401Missing, invalid, or inactive API key.
400No file_base64, bad base64, or empty file.
413File over 4 MB.
422Not a recognized OTDR trace / couldn't parse.

Analyze a whole job

POST https://johnstonetechs.com/api/v1/analyze

Send every file for a job in one request — OTDR traces, OLTS/iOLM results, endface inspections, power-meter exports, or a .zip of all of them. The pipeline groups files into fibers, runs the same pass/fail logic as Fiber Analysis, and returns a verdict per fiber. This is the programmatic version of the whole-job review.

Request body

FieldTypeNotes
filesarrayRequired. Each item is { "filename": "…", "file_base64": "…" }. A single .zip is expanded one level. Max 4 MB per file, 32 MB per job, 300 files.
expectedstringOptional. A reference-fiber list (the text of a CSV/TXT). Fibers on the list with no measurement files come back as not_tested.
thresholdsobjectOptional pass/fail knobs: lossGate, attenGate, linkLossMaxDb, orlGate. Omit to use the defaults.

Response

A summary count plus one entry per fiber: its status, a plain-language summary line, and the measured numbers.

{
  "ok": true,
  "summary": { "fibers": 24, "passing": 22, "failing": 1, "not_tested": 1 },
  "fibers": [
    {
      "fiber": "APPLTA11",
      "status": "passing",
      "summary": "APPLTA11 , Traces reviewed: 102.963 km span, 25.95 dB total loss…",
      "source": "otdr",
      "measurements": { "length_km": 102.96, "wavelengths": [1550, 1625], "bidirectional": { … } }
    }, …
  ],
  "job_notes": [ … ], "unassigned": [ ], "read_errors": [ ]
}

status is one of passing, fail, no_continuity, or not_tested.

Good to know

  • Same engine as the site. The API runs the exact parser behind the browser analyzer, so results match what you'd see there.
  • Nothing is stored. Files are parsed in memory for the request and discarded.
  • The browser tools stay free. The API is the paid path for programmatic and bulk use; the tools remain free for interactive work.
  • Formats. /parse handles OTDR traces (.sor, .msor, .trc). /analyze adds OLTS/iOLM results, endface inspections, and power-meter (.opm) exports — the same mix the browser tool accepts.
  • New here? The developer how-to walks through a single call, and the acceptance-testing case study shows a whole-job integration.

Ready to build on it? Request a key and we'll get you a working example on your own traces.

Request API access →