Overview
The Search API uses consistent data models across all endpoints. All operations follow an asynchronous job-based workflow with standardized request and response formats.SearchJobRequest
Request schema for creating a new search job.Field Details
Search query string (minimum 1 character)Supports:
- Section numbers:
"Section 10.5.3" - Code references:
"AISC 360-16 G2.1" - Technical terms:
"reinforcement requirements" - Natural language:
"What are deflection limits for steel beams?"
Filter results by regional design standardValid values:
"us"- US standards (AISC, ACI, ASCE, etc.)"eurocode"- European codes (EN 1992, etc.)"aus-nz"- Australian/New Zealand (AS codes)"canada"- Canadian codes (CSA)
Search within a specific document only
Page number for pagination (≥ 1)
Number of results per page (1-100)
JobResponse
Response when creating a job or checking its status.Status Values
| Status | Description |
|---|---|
pending | Job queued, not yet started |
in_progress | Search currently executing |
completed | Search finished successfully |
failed | Search encountered an error |
Example (Pending)
Example (Completed)
SearchResults
Search results with pagination information.SearchMatch
Individual search result with context and metadata.Field Details
Unique document identifier
Original PDF filename
Full document title and description
Regional standard category
The most relevant text excerpt matching the query (typically 100-200 characters)
Page number in the original PDF document
Match quality score from 0.0 (poor) to 1.0 (excellent)
Larger block of surrounding text (400-600 characters) to provide additional context
Type of content matched
"text"- Body text"table"- Content from a table"figure_caption"- Figure or diagram caption
Complete Example Response
BuildingCode
Metadata for a building code document.Example
CodesListResponse
Response when listing available building codes.Example
ErrorDetails
Error information when a job fails.Example
Common Error Codes
| Code | HTTP Status | Description |
|---|---|---|
INVALID_QUERY | 400 | Query string is empty or invalid |
INVALID_STANDARD | 400 | design_standard value is not recognized |
INVALID_DOCUMENT | 404 | document_id does not exist |
RATE_LIMIT_EXCEEDED | 429 | Too many requests in time window |
SEARCH_TIMEOUT | 500 | Search operation exceeded time limit |
INTERNAL_ERROR | 500 | Unexpected server error |
Validation Rules
Query Validation
Query Validation
- Required: Must be provided
- Length: Minimum 1 character, maximum 500 characters
- Type: Must be a string
design_standard Validation
design_standard Validation
- Optional: Can be omitted for global search
- Valid values:
"us","eurocode","aus-nz","canada" - Case-sensitive: Must use exact lowercase values
Pagination Validation
Pagination Validation
- page: Must be ≥ 1
- per_page: Must be 1-100
- Maximum results: No single query can return more than 200 total results
document_id Validation
document_id Validation
- Optional: Can be omitted
- Format: Must match available file_id from codes list
- Example:
"asce-7-22","aci-318-19"