Loading documentation

Access required

Your account doesn't have access to the documentation. Contact your administrator.

Sign out
Skip to main content

NAICS Get

Status: stable Category: lookup Added: 2026-04-27 Last reviewed: 2026-10-14

Summary​

Returns the full BLS injury and illness benchmark row for one NAICS code. Use this when the user has already selected a code (typically via /api/lookup/naics/search) and you need every rate field — total recordable, DART, days-away, transfer/restriction, and other-recordable — to display alongside an employer's reported numbers.

The dataset is the BLS Survey of Occupational Injuries and Illnesses, reseeded annually. Lookups always return the latest published year for the requested (code, ownership) pair. The record carries the same code and label a search hit carries.

Endpoint​

FieldValue
MethodGET
Path/api/lookup/naics/get
Full URLhttps://engine.tripod-health.com/api/lookup/naics/get
AuthenticationAPI key (required)
Request bodynone
Response bodyapplication/json
IdempotentYes
Rate-limitedYes

Authentication​

Send a valid API key in the apikey header. See authentication.md.

Request​

Headers​

HeaderRequiredDescription
apikeyYesConsumer API key.

Path parameters​

None.

Query parameters​

ParameterTypeRequiredDefaultDescription
codestringYes—NAICS code, 2–6 digits. Treat as opaque text rather than parsing as a number — 01 is not the same as 1.
ownershipstringNoprivateOne of private, state_government, local_government. Picks the BLS ownership cohort.

Body​

None.

Response​

Success — 200 OK​

The response to GET /api/lookup/naics/get?code=2362:

{
"code": "2362",
"label": "Nonresidential building construction",
"ownership": "private",
"year": 2024,
"total_recordable_rate": 1.9,
"dart_rate": 1.2,
"days_away_rate": 0.8,
"transfer_restriction_rate": 0.4,
"other_recordable_rate": 0.7,
"request_id": "0c22046e-6988-49bb-bad3-e70723b9dbfb",
"timestamp": "2026-10-14T00:16:56.883Z"
}

Rate fields are nullable. BLS suppresses cells when the survey sample is too small to publish a stable estimate. Per conventions.md § Null vs. missing, suppressed values are returned as explicit null, never omitted.

Response fields​

FieldTypeAlways presentDescription
codestringYesEchoes the requested NAICS code.
labelstringYesIndustry name as published by BLS.
ownershipstringYesEchoes the requested ownership.
yearintegerYesBLS release year for the returned row (today: 2024). Useful for detecting that an annual reseed has landed since your last lookup.
total_recordable_ratenumber | nullYesAll recordable cases per 100 FTE.
dart_ratenumber | nullYesDays Away, Restricted, or Transferred (DART) cases per 100 FTE. BLS publishes it as the sum of days_away_rate and transfer_restriction_rate; rounding can make the published figures differ by 0.1.
days_away_ratenumber | nullYesCases involving days away from work, per 100 FTE.
transfer_restriction_ratenumber | nullYesCases involving job transfer or restriction (no days away), per 100 FTE.
other_recordable_ratenumber | nullYesCases requiring medical treatment beyond first aid but no DART, per 100 FTE.
request_idstringYesCorrelation ID. Quote in support tickets.
timestampstring (ISO 8601 UTC)YesServer time when the response was emitted.

Status codes​

CodeMeaningWhen
200OKRow found.
400ValidationErrorcode missing or not 2–6 digits, or ownership not in the allowed set. field names the offending parameter.
401UnauthenticatedMissing or invalid API key.
404NotFoundNo row matches (code, ownership). The pair may simply not be published in the requested ownership cohort.
429RateLimitedPer-consumer rate limit exceeded.
500InternalErrorUnexpected failure. Quote request_id in the ticket.

Examples​

curl​

curl -sS "https://engine.tripod-health.com/api/lookup/naics/get?code=2362" \
-H "apikey: $ENGINE_API_KEY"

Returns the 200 body shown in Success above.

Python (requests)​

# Uses the call() helper from quickstart.md.
row = call("GET", "/api/lookup/naics/get?code=2362")
print(f"{row['label']}: TRR={row['total_recordable_rate']} (year {row['year']})")

Node.js (native fetch)​

// Uses the call() helper from quickstart.md.
const row = await call("GET", "/api/lookup/naics/get?code=2362");
console.log(`${row.label}: TRR=${row.total_recordable_rate} (year ${row.year})`);

TypeScript​

interface NaicsBenchmark {
code: string;
label: string;
ownership: "private" | "state_government" | "local_government";
year: number;
total_recordable_rate: number | null;
dart_rate: number | null;
days_away_rate: number | null;
transfer_restriction_rate: number | null;
other_recordable_rate: number | null;
request_id: string;
timestamp: string;
}

const row = await call<NaicsBenchmark>("GET", "/api/lookup/naics/get?code=2362");

Error scenarios​

Unknown code​

Send:

curl -sS "https://engine.tripod-health.com/api/lookup/naics/get?code=999999" \
-H "apikey: $ENGINE_API_KEY" \
-w "\nHTTP %{http_code}\n"

Receive (404):

{
"timestamp": "2026-10-14T00:16:16.699Z",
"error": "NotFound",
"message": "No NAICS benchmark for code '999999' with ownership 'private'",
"request_id": "b593c431-085f-4a36-9813-169ab664ee6f"
}

Malformed code​

Send:

curl -sS "https://engine.tripod-health.com/api/lookup/naics/get?code=2362ABC" \
-H "apikey: $ENGINE_API_KEY" \
-w "\nHTTP %{http_code}\n"

Receive (400):

{
"timestamp": "2026-10-14T00:16:16.934Z",
"error": "ValidationError",
"message": "Query parameter 'code' must be a 2-6 digit NAICS code",
"field": "code",
"request_id": "9f9ffb91-1fe7-4b09-920e-f965d7cbce9f"
}

Intended use​

  • Filling out a benchmark display alongside an employer's reported numbers, after the user has chosen a code in your UI.
  • Resolving a stored code to its label. A code saved from a search hit comes back with the same code and label pair.
  • Validating that a stored NAICS code is still published. A 404 signals the (code, ownership) pair was either never published or has rolled out of the latest BLS release.
  • Detecting that a new BLS release has landed. Compare the returned year to the one your client last saw — when it bumps, the whole table has been reseeded.

Mistaken use​

  • Do not call get to do fuzzy matching. Use /api/lookup/naics/search — name-substring or numeric-prefix matching, ranked, with a limit.
  • Do not call get and then run your own employer-vs-benchmark math client-side. Use /api/lookup/naics/calculate — it pulls the benchmark server-side and produces the comparison block in one round trip.
  • Do not parse code as an integer. NAICS codes are strings. Numeric parsing collapses leading-zero distinctions and drops the trailing-digit semantics. Treat the field as opaque text.

Debugging​

  1. Capture request_id from the response body (or, if the response has no body from the engine, the X-Request-ID response header).
  2. 404 NotFound for a code you're sure exists. Re-check ?ownership= — most non-private codes are unpublished. The same code under ?ownership=private may exist while ?ownership=local_government does not. BLS also does not publish every 6-digit code; search the code's prefix to see which levels exist.
  3. Most rate fields are null. Expected on narrow 5- and 6-digit codes where BLS suppressed the cells. Drop down to a 3- or 4-digit parent code if you need a populated row.
  4. year differs from what you expected. A new BLS release has landed since the previous reseed. Refresh any cached values.

Rate limits​

See rate-limits.md for the current per-consumer limits.

Change history​

DateChange
2026-04-27Initial publication.
2026-10-14Moved from /api/naics/get to /api/lookup/naics/get. Fields naics_code and industry_name renamed to code and label. Examples recaptured against code 2362.
2026-10-14The X-Request-ID response header is the gateway's trace ID for the request and does not match request_id; quote request_id to support.