Regulations Search
Status:
stableCategory:regulationsAdded:2026-07-01Last 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
| Field | Value |
|---|---|
| Method | GET |
| Path | /api/regulations/search |
| Full URL | https://engine.tripod-health.com/api/regulations/search |
| Authentication | API key (required) |
| Request body | none |
| Response body | application/json |
| Idempotent | Yes |
| Rate-limited | Yes |
Authentication
Send a valid API key in the apikey header. See
authentication.md.
Request
Headers
| Header | Required | Description |
|---|---|---|
apikey | Yes | Consumer API key. |
X-Request-ID | No | Optional 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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
q | string | Yes | — | 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. |
type | string | No | regulation | One of regulation, guidance. Picks the corpus: CFR regulation text, or OSHA recordkeeping guidance. |
title | int | No | — | Restricts the search to one CFR title, 1–50. Regulation search only. |
part | string | No | — | Restricts the search to one CFR part (e.g. 1904). Regulation search only. |
section | string | No | — | Guidance search only. Filters to guidance items tagged to that section (e.g. 1904.5). |
limit | int | No | 10 | Maximum results to return. Range 1–50. |
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
| Field | Type | Always present | Description |
|---|---|---|---|
results | array | Yes | Zero or more match objects, best match first. |
request_id | string | Yes | Correlation ID. Quote in support tickets. |
timestamp | string (ISO 8601 UTC) | Yes | Server time when the response was emitted. |
Regulation results (type=regulation)
| Field | Type | Always present | Description |
|---|---|---|---|
results[].type | string | Yes | Always regulation in this mode. |
results[].id | integer | Yes | Stable numeric ID. Pass to /api/regulations/get ?id= for the full text. |
results[].cfr_title | integer | Yes | CFR title number, 1–50. |
results[].part | string | Yes | CFR part (e.g. "1904"). Treat as opaque text — some parts carry a letter suffix. |
results[].section | string | null | Yes | Section number (e.g. "1904.7"), or an appendix label for appendix items. |
results[].heading | string | Yes | Official section heading. |
results[].content_type | string | Yes | regulation for section text, appendix for appendix material. |
results[].snippet | string | Yes | Excerpt around the match. Matched terms are wrapped in ** markers; may contain \n line breaks. Not the full text. |
results[].score | number | Yes | Relevance score, higher is better. Use it to compare results within one response, not as an absolute threshold. |
Guidance results (type=guidance)
| Field | Type | Always present | Description |
|---|---|---|---|
results[].type | string | Yes | Always guidance in this mode. |
results[].id | integer | Yes | Stable numeric ID. Pass to /api/regulations/get ?id=&type=guidance for the full text. |
results[].source_type | string | Yes | One of faq, interpretation (letter of interpretation), preamble (rulemaking preamble excerpt). |
results[].sections | array of string | Yes | The 29 CFR 1904 sections the item interprets (e.g. ["1904.5", "1904"]). |
results[].identifier | string | Yes | Natural identifier within its source_type — the OSHA FAQ number, letter date slug, or preamble slug. |
results[].subject | string | Yes | The item's subject line or question text. |
results[].snippet | string | Yes | Excerpt around the match, with ** markers on matched terms. |
results[].score | number | Yes | Relevance score, higher is better. |
Status codes
| Code | Meaning | When |
|---|---|---|
200 | OK | Search ran. results may be empty. |
400 | ValidationError | q missing or shorter than two characters, type not in the allowed set, title outside 1–50, part malformed, or limit out of range. |
401 | Unauthenticated | Missing or invalid API key. |
429 | RateLimited | Per-consumer rate limit exceeded. |
500 | InternalError | Unexpected failure. Quote request_id in the ticket. |
Examples
curl — regulation search
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 — guidance search
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 treatmentormachine guarding, scan the snippets, then fetch the winningidvia/api/regulations/get. - Locating official OSHA recordkeeping guidance. Set
type=guidanceto search FAQs, preamble excerpts, and letters of interpretation; addsection=1904.5to see only guidance tagged to one section. - Resolving a half-remembered section number. A numeric query like
1904.7biases 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/getwith?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
snippetas quotable regulation text. Snippets are excerpts with**highlight markers inserted. Quote from thefull_textreturned by/api/regulations/get, which carries thesource_urlcitation. - Do not pass
titleorparton a guidance search, orsectionon a regulation search. Each filter belongs to one mode; the wrong-mode filter does not narrow the results.
Debugging
- Capture
request_id. Present in every response body and in theX-Request-IDresponse header. - Empty
resultsfor a query you expected to match. Check the filters first —title=29on a phrase that lives in another title, orsection=narrowing guidance to a section the item is not tagged to, both produce clean empty responses. - 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. - 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.
Related
- regulations-get.md — fetch one item's complete
text by
idor section number. - regulations-tree.md — browse one CFR part as a nested subpart/section outline.
- recordability-analyze.md, recordability-factor.md, work_relatedness-analyze.md — the OSHA recordability analysis endpoints ground their AI reasoning in this same regulation and guidance content.
- authentication.md, errors.md, rate-limits.md, conventions.md — cross-cutting contract rules.
Change history
| Date | Change |
|---|---|
| 2026-07-01 | Initial publication. |