Loading documentation

Access required

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

Sign out
Skip to main content

Regulations Search

Status: stable Category: lookup Added: 2026-07-01 Last reviewed: 2026-10-14

Summary​

Ranked search over the full Code of Federal Regulations — every title, at section grain — plus an OSHA recordkeeping guidance corpus (FAQs, rulemaking preamble excerpts, and letters of interpretation tied to 29 CFR 1904). Pass a natural-language phrase, a partial word, or a section-number fragment like 1904.7 and get back the best-matching items with highlighted snippets. Results carry a stable numeric id you feed to /api/lookup/regulations/get for the complete text, plus the code and label pair every lookup resource returns, so one picker component works against every lookup search.

Endpoint​

FieldValue
MethodGET
Path/api/lookup/regulations/search
Full URLhttps://engine.tripod-health.com/api/lookup/regulations/search
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
qstringYes—Search text. Minimum two characters. Natural language, partial words, and section-number fragments all work; a query that looks like a section number (e.g. 1904.7) biases the ranking toward section-number prefix matches.
typestringNoregulationOne of regulation, guidance. Picks the corpus: CFR regulation text, or OSHA recordkeeping guidance.
titleintNo—Restricts the search to one CFR title, 1–50. Regulation search only.
partstringNo—Restricts the search to one CFR part (e.g. 1904). Regulation search only.
sectionstringNo—Guidance search only. Filters to guidance items tagged to that section (e.g. 1904.5).
limitintNo10Maximum results to return. Range 1–50.

Body​

None.

Response​

Success — 200 OK​

{
"results": [
{
"type": "regulation",
"code": "50.20-3",
"label": "Criteria—Differences between medical treatment and first aid.",
"id": 106103,
"cfr_title": 30,
"part": "50",
"section": "50.20-3",
"heading": "Criteria—Differences between medical treatment and first aid.",
"content_type": "regulation",
"snippet": "multiple soakings, whirlpool **treatment**, **treatment** of infection, or other professional **treatments** and any **treatment** involving more than...amenable to **first** **aid** **treatment**.\n(ii) Medical **treatment** includes a series of **treatments** including soaks, whirlpool, skin grafts",
"score": 0.99
},
{
"type": "regulation",
"code": "1904.7",
"label": "General recording criteria.",
"id": 102444,
"cfr_title": 29,
"part": "1904",
"section": "1904.7",
"heading": "General recording criteria.",
"content_type": "regulation",
"snippet": "work or transfer to another job, medical **treatment** beyond **first** **aid**, or loss of consciousness. You must also...work, restricted work or job transfer, medical **treatment** beyond **first** **aid**, or loss of consciousness.\n(b) Implementation",
"score": 0.99
},
{
"type": "regulation",
"code": "Appendix V to Part 1918",
"label": "Appendix V to Part 1918—Basic Elements of a First Aid Training Program (Non-mandatory)",
"id": 103057,
"cfr_title": 29,
"part": "1918",
"section": "Appendix V to Part 1918",
"heading": "Appendix V to Part 1918—Basic Elements of a First Aid Training Program (Non-mandatory)",
"content_type": "appendix",
"snippet": "allergic reactions.\nc. the appropriate assessment and **first** **aid** **treatment** of a victim who has fainted.\n2. Bleeding...prophylaxis.\n3. Poisoning\nInstruction in the principles and **first** **aid** intervention of:\na. alkali, acid and systemic poisons",
"score": 0.99
}
],
"request_id": "95f78b51-bf75-4d47-b026-f9fd8ddf21db",
"timestamp": "2026-10-14T00:16:19.768Z"
}

results is always present. An empty array is a normal response (nothing matched the query under the requested filters), not an error. Snippet text wraps matched terms in ** markers — strip or render them as highlights.

Response fields​

FieldTypeAlways presentDescription
resultsarrayYesZero or more match objects, best match first.
request_idstringYesCorrelation ID. Quote in support tickets.
timestampstring (ISO 8601 UTC)YesServer time when the response was emitted.

Regulation results (type=regulation)​

FieldTypeAlways presentDescription
results[].typestringYesAlways regulation in this mode.
results[].codestringYesThe lookup-family code: the same value as section.
results[].labelstringYesThe lookup-family label: the same value as heading.
results[].idintegerYesStable numeric ID. Pass to /api/lookup/regulations/get ?id= for the full text.
results[].cfr_titleintegerYesCFR title number, 1–50.
results[].partstringYesCFR part (e.g. "1904"). Treat as opaque text — some parts carry a letter suffix.
results[].sectionstringYesSection number (e.g. "1904.7"), or the full appendix designation for appendix items (e.g. "Appendix V to Part 1918").
results[].headingstringYesOfficial section heading.
results[].content_typestringYesregulation for section text, appendix for appendix material.
results[].snippetstringYesExcerpt around the match. Matched terms are wrapped in ** markers; may contain \n line breaks. Not the full text.
results[].scorenumberYesRelevance score, higher is better. Use it to compare results within one response, not as an absolute threshold.

Guidance results (type=guidance)​

FieldTypeAlways presentDescription
results[].typestringYesAlways guidance in this mode.
results[].codestringYesThe lookup-family code: the same value as identifier.
results[].labelstringYesThe lookup-family label: the same value as subject.
results[].idintegerYesStable numeric ID. Pass to /api/lookup/regulations/get ?id=&type=guidance for the full text.
results[].source_typestringYesOne of faq, interpretation (letter of interpretation), preamble (rulemaking preamble excerpt).
results[].sectionsarray of stringYesThe 29 CFR 1904 sections the item interprets (e.g. ["1904.5", "1904"]).
results[].identifierstringYesNatural identifier within its source_type — the OSHA FAQ number, letter date slug, or preamble slug.
results[].subjectstringYesThe item's subject line or question text.
results[].snippetstringYesExcerpt around the match, with ** markers on matched terms.
results[].scorenumberYesRelevance score, higher is better.

Status codes​

CodeMeaningWhen
200OKSearch ran. results may be empty.
400ValidationErrorq missing or shorter than two characters, type not in the allowed set, title outside 1–50, part malformed, or limit out of range.
401UnauthenticatedMissing or invalid API key.
429RateLimitedPer-consumer rate limit exceeded.
500InternalErrorUnexpected failure. Quote request_id in the ticket.

Examples​

curl -sS "https://engine.tripod-health.com/api/lookup/regulations/search?q=first%20aid%20treatment&limit=3" \
-H "apikey: $ENGINE_API_KEY"

Returns the 200 body shown in Success above.

curl -sS "https://engine.tripod-health.com/api/lookup/regulations/search?q=parking%20lot&type=guidance&limit=2" \
-H "apikey: $ENGINE_API_KEY"

Receive (200):

{
"results": [
{
"type": "guidance",
"code": "5-1",
"label": "If a maintenance employee is cleaning the parking lot or an access road and is injured as a result, is the case work-related?",
"id": 69,
"source_type": "faq",
"sections": [
"1904.5",
"1904"
],
"identifier": "5-1",
"subject": "If a maintenance employee is cleaning the parking lot or an access road and is injured as a result, is the case work-related?",
"snippet": "Question: If a maintenance employee is cleaning the **parking** **lot** or an access road and is injured",
"score": 1
},
{
"type": "guidance",
"code": "5-10",
"label": "How does OSHA define a \"company parking lot\" for purposes of Recordkeeping?",
"id": 70,
"source_type": "faq",
"sections": [
"1904.5",
"1904"
],
"identifier": "5-10",
"subject": "How does OSHA define a \"company parking lot\" for purposes of Recordkeeping?",
"snippet": "Question: How does OSHA define a \"company **parking** **lot**\" for purposes of Recordkeeping?\n\nAnswer: Company **parking** **lots**...where the employer can limit access (such as **parking** **lots** limited to the employer's employees and visitors",
"score": 1
}
],
"request_id": "f80e4eee-3357-4357-af4a-bd9624281196",
"timestamp": "2026-10-14T00:16:20.651Z"
}

curl — section-number fragment​

curl -sS "https://engine.tripod-health.com/api/lookup/regulations/search?q=1904.7" \
-H "apikey: $ENGINE_API_KEY"

Python (requests)​

# Uses the call() helper from quickstart.md.
result = call("GET", "/api/lookup/regulations/search?q=first%20aid%20treatment&title=29&limit=5")
for row in result["results"]:
print(f"{row['id']:7} {row['code']:24} {row['label']}")

Node.js (native fetch)​

// Uses the call() helper from quickstart.md.
const result = await call("GET", "/api/lookup/regulations/search?q=first%20aid%20treatment&title=29&limit=5");
for (const row of result.results) {
console.log(`${String(row.id).padEnd(7)} ${row.code.padEnd(24)} ${row.label}`);
}

TypeScript​

interface RegulationSearchResult {
type: "regulation";
code: string;
label: string;
id: number;
cfr_title: number;
part: string;
section: string;
heading: string;
content_type: "regulation" | "appendix";
snippet: string;
score: number;
}

interface GuidanceSearchResult {
type: "guidance";
code: string;
label: string;
id: number;
source_type: "faq" | "interpretation" | "preamble";
sections: string[];
identifier: string;
subject: string;
snippet: string;
score: number;
}

interface RegulationsSearchResponse {
results: RegulationSearchResult[] | GuidanceSearchResult[];
request_id: string;
timestamp: string;
}

const result = await call<RegulationsSearchResponse>(
"GET",
"/api/lookup/regulations/search?q=first%20aid%20treatment",
);

Error scenarios​

q too short​

Send:

curl -sS "https://engine.tripod-health.com/api/lookup/regulations/search?q=a" \
-H "apikey: $ENGINE_API_KEY" \
-w "\nHTTP %{http_code}\n"

Receive (400):

{
"timestamp": "2026-10-14T00:16:20.904Z",
"error": "ValidationError",
"message": "Query parameter 'q' must be at least 2 characters",
"field": "q",
"request_id": "712de95c-ce18-47f4-9478-2ecac5ba3bdb"
}

Invalid title​

Send:

curl -sS "https://engine.tripod-health.com/api/lookup/regulations/search?q=recordkeeping&title=99" \
-H "apikey: $ENGINE_API_KEY" \
-w "\nHTTP %{http_code}\n"

Receive (400):

{
"timestamp": "2026-10-14T00:16:21.146Z",
"error": "ValidationError",
"message": "Query parameter 'title' must be a CFR title number between 1 and 50",
"field": "title",
"request_id": "94f82d6f-d229-44df-b772-531c36b2a45a"
}

Intended use​

  • Finding the governing regulation text for a compliance question. Search a phrase like first aid treatment or machine guarding, scan the snippets, then fetch the winning id via /api/lookup/regulations/get.
  • Locating official OSHA recordkeeping guidance. Set type=guidance to search FAQs, preamble excerpts, and letters of interpretation; add section=1904.5 to see only guidance tagged to one section.
  • Resolving a half-remembered section number. A numeric query like 1904.7 biases the ranking toward section-number prefix matches, so the section you meant surfaces first.

Mistaken use​

  • Do not use search to fetch a known section's full text. Use /api/lookup/regulations/get with ?section=1904.7 — search returns snippets, not the complete text.
  • Do not use search to browse a part's structure. Use /api/lookup/regulations/tree — it returns one CFR part as a nested subpart/section outline in a single call.
  • Do not treat snippet as quotable regulation text. Snippets are excerpts with ** highlight markers inserted. Quote from the full_text returned by /api/lookup/regulations/get, which carries the source_url citation.
  • Do not pass title or part on a guidance search, or section on a regulation search. Each filter belongs to one mode; the wrong-mode filter does not narrow the results.

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. Empty results for a query you expected to match. Check the filters first — title=29 on a phrase that lives in another title, or section= narrowing guidance to a section the item is not tagged to, both produce clean empty responses.
  3. A section-number query returns unrelated prose matches. Include the whole fragment (1904.7, not .7) — the numeric-prefix bias keys off a query that looks like a section number.
  4. Guidance results seem missing for a non-1904 topic. Expected: the guidance corpus covers OSHA recordkeeping under 29 CFR 1904. For other topics, search the regulation corpus (type=regulation).

Rate limits​

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

Change history​

DateChange
2026-07-01Initial publication.
2026-10-14Moved from /api/regulations/search to /api/lookup/regulations/search. Every hit adds code and label beside the existing fields (a regulation's section and heading, a guidance item's identifier and subject). Examples recaptured.
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.