US Constitution API Documentation

US Constitution API

API Documentation

API Documentation

Authentication

All API requests require authentication using an API key. Include your API key in the X-API-Key header with every request.

X-API-Key: YOUR_API_KEY

Base URL

All API endpoints are relative to the base URL: https://usconstitutionapi.com

API Endpoints

List All Documents

GET /api/documents

Returns a list of all available documents (Constitution and Bill of Rights).

Parameters

No parameters required.

Example Response

[
  {
    "id": 1,
    "title": "The Constitution of the United States",
    "description": "The founding document of the United States of America",
    "created_at": "2025-01-01T00:00:00.000Z"
  },
  {
    "id": 2,
    "title": "Bill of Rights",
    "description": "The first ten amendments to the United States Constitution",
    "created_at": "2025-01-01T00:00:00.000Z"
  }
]

Get a Specific Document

GET /api/documents/{document_id}

Returns a specific document by its ID.

Path Parameters

Parameter Type Description
document_id integer The ID of the document to retrieve

Example Response

{
  "id": 1,
  "title": "The Constitution of the United States",
  "description": "The founding document of the United States of America",
  "created_at": "2025-01-01T00:00:00.000Z",
  "sections": [
    {
      "id": 1,
      "section_type": "preamble",
      "number": null,
      "title": "Preamble",
      "content": "We the People of the United States, in Order to form a more perfect Union...",
      "parent_id": null
    },
    ...
  ]
}

Get Amendment by Number

GET /api/amendments/{amendment_number}

Returns a specific amendment by its number (roman numeral).

Path Parameters

Parameter Type Description
amendment_number string The amendment number (roman numeral, e.g., I, II, III)

Example Response

{
  "id": 36,
  "document_id": 3,
  "section_type": "amendment",
  "number": "I",
  "title": "Amendment I.",
  "content": "Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the government for a redress of grievances.",
  "parent_id": null
}

Search Documents

GET /api/search

Searches document content for a specific query term.

Query Parameters

Parameter Type Required Description
query string Yes The search term or phrase
document_id integer No Filter by document ID
section_type string No Filter by section type (article, amendment, etc.)

Example Response

[
  {
    "document_id": 3,
    "document_title": "Bill of Rights",
    "section_id": 36,
    "section_type": "amendment",
    "section_number": "I",
    "section_title": "Amendment I.",
    "content": "Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the government for a redress of grievances."
  },
  ...
]

Complete OpenAPI Documentation

View the complete API specification below: