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: naics Added: 2026-04-27 Last reviewed: 2026-04-27

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/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 (naics_code, ownership) pair.

Endpoint

FieldValue
MethodGET
Path/api/naics/get
Full URLhttps://engine.tripod-health.com/api/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.
X-Request-IDNoOptional correlation ID, up to 128 characters. Echoed in the response body's request_id and the X-Request-ID response header.

Path parameters

None.

Query parameters

ParameterTypeRequiredDefaultDescription
codestringYesNAICS 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

{
"naics_code": "236220",
"industry_name": "Commercial Building Construction",
"ownership": "private",
"year": 2024,
"total_recordable_rate": 2.6,
"dart_rate": 1.4,
"days_away_rate": 0.7,
"transfer_restriction_rate": 0.7,
"other_recordable_rate": 1.2,
"request_id": "8f2c3b1d-5e4a-4a9c-9b1e-2a7f1d3e4c5b",
"timestamp": "2026-04-27T17:32:10.812Z"
}

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
naics_codestringYesEchoes the requested code.
industry_namestringYesIndustry 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. Equal to days_away_rate + transfer_restriction_rate.
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. Equal to total_recordable_rate − dart_rate.
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.
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/naics/get?code=236220" \
-H "apikey: $ENGINE_API_KEY"

Python (requests)

# Uses the call() helper from quickstart.md.
row = call("GET", "/api/naics/get?code=236220")
print(f"{row['industry_name']}: 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/naics/get?code=236220");
console.log(`${row.industry_name}: TRR=${row.total_recordable_rate} (year ${row.year})`);

TypeScript

interface NaicsBenchmark {
naics_code: string;
industry_name: 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/naics/get?code=236220");

Error scenarios

Unknown code

Send:

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

Receive (404):

{
"timestamp": "2026-04-27T17:32:10.812Z",
"error": "NotFound",
"message": "No NAICS benchmark for code '999999' with ownership 'private'",
"request_id": "docs-naics-get-unknown"
}

Malformed code

Send:

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

Receive (400):

{
"timestamp": "2026-04-27T17:32:10.812Z",
"error": "ValidationError",
"message": "Query parameter 'code' must be a 2-6 digit NAICS code",
"request_id": "docs-naics-get-bad-code",
"field": "code"
}

Intended use

  • Filling out a benchmark display alongside an employer's reported numbers, after the user has chosen a code in your UI.
  • 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 /api/naics/get to do fuzzy matching. Use /api/naics/search — name-substring or numeric-prefix matching, ranked, with a limit.
  • Do not call /api/naics/get and then run your own employer-vs- benchmark math client-side. Use /api/naics/calculate — it pulls the benchmark server-side and produces the comparison block in one round trip.
  • Do not parse naics_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. Present in every response body and in 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.
  3. Most rate fields are null. Expected on narrow 6-digit codes where BLS suppressed the cells. Drop down to a 4- or 5-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.