API Documentation
Base URL
All API endpoints are prefixed with: /api/v1/laws/us/code
For example: https://api.ontocracia.org/v1/laws/us/code/titles
Endpoints
Get All Titles
GET /titles
Returns a list of all available titles in the US Code.
Example Request:
GET /api/v1/laws/us/code/titles
Example Response:
{
"titles": [
{
"number": 1,
"name": "GENERAL PROVISIONS"
},
{
"number": 2,
"name": "THE CONGRESS"
}
]
}
Get Title Details
GET /titles/{title_number}
Returns detailed information about a specific title.
Example Request:
GET /api/v1/laws/us/code/titles/1
Parameters:
title_number: The number of the title (1-54)
Get Chapter Details
GET /titles/{title_number}/chapters/{chapter_number}
Returns detailed information about a specific chapter within a title.
Example Request:
GET /api/v1/laws/us/code/titles/1/chapters/1
Parameters:
title_number: The number of the titlechapter_number: The number of the chapter
Get Section Details
GET /titles/{title_number}/chapters/{chapter_number}/sections/{section_number}
Returns detailed information about a specific section within a chapter.
Example Request:
GET /api/v1/laws/us/code/titles/1/chapters/1/sections/1
Parameters:
title_number: The number of the titlechapter_number: The number of the chaptersection_number: The number of the section
Search
GET /search?q={query}
Search across all titles of the US Code.
Example Request:
GET /api/v1/laws/us/code/search?q=congress
Parameters:
q: The search query string
Rate Limiting
The API is rate limited to prevent abuse. Please contact us if you need higher limits.
Authentication
Currently, the API is publicly accessible without authentication. This may change in the future.