Get All Titles
GETRetrieve a list of all titles in the US Code.
/api/v1/us/code/titles
Example Request
curl -X GET "http://api.ontocracia.com/api/v1/us/code/titles" \
-H "Accept: application/json"
Example Response
{
"titles": [
{
"number": 1,
"name": "GENERAL PROVISIONS",
"chapters_count": 4
},
{
"number": 2,
"name": "THE CONGRESS",
"chapters_count": 30
}
// ...
]
}
Get Title Details
GETRetrieve details and contents of a specific title.
/api/v1/us/code/titles/{title_number}
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| title_number | integer | Yes | The number of the title to retrieve (1-54) |
Example Request
curl -X GET "http://api.ontocracia.com/api/v1/us/code/titles/1" \
-H "Accept: application/json"
Example Response
{
"title": {
"number": 1,
"name": "GENERAL PROVISIONS",
"chapters": [
{
"number": 1,
"name": "Rules of Construction",
"sections_count": 8
},
// ...
]
}
}
Get Chapter
GETRetrieve a specific chapter from a title.
/api/v1/us/code/titles/{title_number}/chapters/{chapter_number}
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| title_number | integer | Yes | The number of the title |
| chapter_number | integer | Yes | The number of the chapter |
Example Request
curl -X GET "http://api.ontocracia.com/api/v1/us/code/titles/1/chapters/1" \
-H "Accept: application/json"
Get Section
GETRetrieve a specific section from a chapter.
/api/v1/us/code/titles/{title_number}/chapters/{chapter_number}/sections/{section_number}
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| title_number | integer | Yes | The number of the title |
| chapter_number | integer | Yes | The number of the chapter |
| section_number | integer | Yes | The number of the section |
Example Request
curl -X GET "http://api.ontocracia.com/api/v1/us/code/titles/1/chapters/1/sections/1" \
-H "Accept: application/json"
Search
GETSearch across all titles of the US Code.
/api/v1/us/code/search
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| q | string | Yes | Search query term |
| title | integer | No | Filter results by title number |
| limit | integer | No | Maximum number of results (default: 20, max: 100) |
Example Request
curl -X GET "http://api.ontocracia.com/api/v1/us/code/search?q=congress&title=1&limit=5" \
-H "Accept: application/json"