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: regulations Added: 2026-07-01 Last reviewed: 2026-07-01

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/regulations/get for the complete text.

Endpoint

FieldValue
MethodGET
Path/api/regulations/search
Full URLhttps://engine.tripod-health.com/api/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.
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
qstringYesSearch 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.
titleintNoRestricts the search to one CFR title, 150. Regulation search only.
partstringNoRestricts the search to one CFR part (e.g. 1904). Regulation search only.
sectionstringNoGuidance search only. Filters to guidance items tagged to that section (e.g. 1904.5).
limitintNo10Maximum results to return. Range 150.

Body

None.

Response

Success — 200 OK

{
"results": [
{
"type": "regulation",
"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",
"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
},
{
"type": "regulation",
"id": 102660,
"cfr_title": 29,
"part": "1910",
"section": "1910.266",
"heading": "Logging operations.",
"content_type": "regulation",
"snippet": "Laws). 3. Basic anatomy. 4. Patient assessment and **first** **aid** for the following: a. Respiratory arrest. b. Cardiac...Application of dressings and slings. 7. **Treatment** of strains, sprains, and fractures. 8. Immobilization of injured persons",
"score": 0.99
}
],
"request_id": "a097204b-d510-42c5-b32d-229027b918b8",
"timestamp": "2026-07-02T00:42:48.110Z"
}

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[].idintegerYesStable numeric ID. Pass to /api/regulations/get ?id= for the full text.
results[].cfr_titleintegerYesCFR title number, 150.
results[].partstringYesCFR part (e.g. "1904"). Treat as opaque text — some parts carry a letter suffix.
results[].sectionstring | nullYesSection number (e.g. "1904.7"), or an appendix label for appendix items.
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[].idintegerYesStable numeric ID. Pass to /api/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 150, 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/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/regulations/search?q=parking%20lot&type=guidance&limit=2" \
-H "apikey: $ENGINE_API_KEY"

Receive (200):

{
"results": [
{
"type": "guidance",
"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",
"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": "e51b8c02-e792-418d-b2d5-dc8641fa64d6",
"timestamp": "2026-07-02T00:42:48.476Z"
}

curl — section-number fragment

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

Python (requests)

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

Node.js (native fetch)

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

TypeScript

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

interface GuidanceSearchResult {
type: "guidance";
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/regulations/search?q=first%20aid%20treatment",
);

Error scenarios

q too short

Send:

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

Receive (400):

{
"timestamp": "2026-07-01T17:32:10.812Z",
"error": "ValidationError",
"message": "Query parameter 'q' must be at least 2 characters",
"request_id": "docs-regulations-search-short-q",
"field": "q"
}

Invalid title

Send:

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

Receive (400):

{
"timestamp": "2026-07-01T17:32:10.812Z",
"error": "ValidationError",
"message": "Query parameter 'title' must be a CFR title number between 1 and 50",
"request_id": "docs-regulations-search-bad-title",
"field": "title"
}

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/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/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/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/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. Present in every response body and in 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.