> ## Documentation Index
> Fetch the complete documentation index at: https://vaquill.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Response Formats

> The text formats the body endpoint returns and the source URL fields that deep-link back to official government text

A section can come back in more than one form. The API gives you rendered text
directly, plus links to the original files the source publishes. Which formats
exist depends on what the underlying government source makes available, so any
given field may be `null`.

## Text from the body endpoint

`GET /us/statutes/section/{actId}/body` returns the section's text in several
forms at once.

| Field | Contains |
| - | - |
| `html` | The whole body rendered as HTML (string or `null`) |
| `plain` | The whole body as plain text (string or `null`) |
| `content` | The operative text only, with the credit line and notes removed |
| `sourceCredit` | The publisher's credit line, split out of the body |
| `notes` | The notes apparatus the publisher prints after the section |
| `sourceUrl` | Where the government published this text (string or `null`) |
| `source` | Our storage identifier for the text. Not a citation. |
| `available` | Whether text was returned at all (bool) |
| `note` | An optional note when text is partial or unavailable (string or `null`) |

Always check `available` first.
Use `html` when you are displaying the section in a UI and want its structure
preserved, `plain` when you want the publisher's whole body as text.

### Telling the law from the apparatus

`plain` and `html` are the WHOLE body as the publisher prints it: the operative
text, then the source credit, then the notes apparatus (historical and revision
notes, committee reports, editorial notes, amendments, effective-date notes).

For **United States Code** sections that body is mostly not the law.
Measured 2026-09-02, the operative text is a median 46% of it across USC, and as
little as 3.4% on `17 U.S.C. § 107`, where 28,529 of 29,775 characters are
commentary.

So the granule is split into three additional fields, using the field delimiters
GPO publishes in the source: `content` is the operative text and nothing else,
`sourceCredit` is the credit line, and `notes` is the apparatus, kept because it
is the legislative history.

<Warning>
  **If you are feeding sections to a model, use `content`.**
  A model handed the full body will quote a 1992 amendment note as the law in
  force, and it will look right.

  ⚠️ USC only. CFR and the state corpora carry no equivalent structure in their
  sources, so all three fields are null there and `plain` remains the whole body.
  Null means "we cannot split this reliably", never "this section is empty".
</Warning>

### Choosing what comes over the wire: `format`

`format` selects which representations are returned.
Cost is unchanged whichever you pick: the fetch is the same either
way, so this buys payload size, not price.

| Value | Returns |
| - | - |
| `both` | `html` and `plain`. The default. |
| `html` | `html` only. Roughly halves the payload on a long section. |
| `plain` | `plain` only. |
| `content` | Neither `html` nor `plain`, only `content`, `sourceCredit` and `notes`. |

On `17 U.S.C. § 107`, `format=content` is about 1 KB over the wire instead of
about 30 KB, for the same price.
Only USC sections can be split, so on any other corpus `format=content` returns
no text at all.
Check `content` for null and fall back to `plain` if you are not sure which
corpus you have.

### Citing where the text came from

`sourceUrl` is where the government published this text.
Cite and verify against that, not against `source`, which names our storage
backend and is not a citation.

`sourceUrl` is null when we hold no official link for the section.
We never substitute a third-party compiler, so an absent link is the correct
answer rather than a gap you should work around.

## Point-in-time text: `asOf`

Pass `asOf=YYYY-MM-DD` to get the text as it stood on that date instead of
today's, at the same price.
The response then carries an `asOf` block saying which version you are holding
and how far the evidence for it reaches.

It is a reconstruction rather than an archive, and `asOf.isBounded` is the field
that says so.
See [Response Fields](/docs/api-guide/concepts/response-fields) for the full block
and how to read it before citing the text.

## Structured text and pincites

Pass `?structured=true` to `GET /us/statutes/section/{actId}/body` for two more
representations parsed from the text, at no extra cost:

| Field | Contains |
| - | - |
| `markdown` | The body as nested Markdown lists, one level per subsection depth (string or `null`) |
| `subsections` | A tree of the section's subsections for pincite addressing (array or `null`) |

Each node in `subsections` carries its marker and where it sits:

| Field | Contains |
| - | - |
| `label` | The marker as printed, e.g. `(b)` or `(2)` |
| `pincite` | The marker path from the section root, e.g. `(b)(2)` |
| `type` | The drafting level: `subsection`, `paragraph`, `subparagraph`, `clause`, or `subclause`. Use it to render the marker style (letters, numbers, roman). |
| `citation` | The full pinpoint citation when known, e.g. `42 U.S.C. § 1983(b)(2)` |
| `text` | The node's own text, excluding nested children |
| `children` | Nested subsections one level deeper (same shape) |

<CodeGroup>
  ```bash cURL theme={"theme":"github-dark"}
  curl "https://api.vaquill.ai/api/v1/us/statutes/section/USC_T42_C21_S1983/body?structured=true" \
    -H "Authorization: Bearer vq_key_..."
  ```

  ```python Python theme={"theme":"github-dark"}
  import requests

  data = requests.get(
      "https://api.vaquill.ai/api/v1/us/statutes/section/USC_T42_C21_S1983/body",
      headers={"Authorization": "Bearer vq_key_..."},
      params={"structured": "true"},
  ).json()

  def walk(nodes, depth=0):
      for n in nodes:
          print("  " * depth, n["pincite"], "->", (n["text"] or "")[:60])
          walk(n["children"], depth + 1)

  walk(data["subsections"] or [])
  ```
</CodeGroup>

<Note>
  `subsections` is derived from the section text by the drafting convention
  (`(a)` subsection, `(1)` paragraph, `(A)` subparagraph, `(i)` clause). It is
  richest for USC and CFR; a section with no marked subsections returns
  `subsections: []` with `markdown` equal to the plain text. Use `pincite` or
  `citation` to deep-link or quote a specific subsection.
</Note>

## Source URL fields

Search results and the section metadata object carry a set of source URL fields.
These point at the original files the publisher hosts. Any of them may be `null`
depending on what that source offers.

Start with `sourceUrl`.
It is the same official link the body endpoint returns, on every search result, section record and batch item, so one field name means one link everywhere.

| Field | Points to |
| - | - |
| `sourceUrl` | Where the government published this text: the link to cite. The publisher's own page when there is one, otherwise govinfo.gov, the state's page, or our archived copy of the publisher's page |
| `htmlUrl` | HTML version of the section |
| `pdfUrl` | PDF version |
| `xmlUrl` | XML version |
| `textUrl` | Plain-text version |
| `docxUrl` | DOCX version |
| `stateHtmlUrl` | The state legislature's own HTML page |
| `govInfoHtmlUrl` | The section on govinfo.gov (HTML) |
| `govInfoPdfUrl` | The section on govinfo.gov (PDF) |
| `externalUrl` | The publisher's own page for the section, exactly as recorded (uscode.house.gov, ecfr.gov, a state legislature or register) |

`source` is not a link.
It names a sub-source inside a multi-source corpus (a federal rules set, an agency) for use as a search filter, and is null on single-source corpora such as every state's statutes and regulations.

Where a state publishes its official text only through a commercial platform, the link is withheld under our licence: `sourceUrl` and `externalUrl` are null, and `licenseNote` says a link exists and is withheld.

Some official publishers serve their code only through a JavaScript application.
The Texas Administrative Code is the main case: the Secretary of State publishes it only on its Appian portal (`texas-sos.appianportalsgov.com`), so the link opens in a browser but returns an empty page shell to `curl` or any other plain HTTP client.
The link is still the correct citation.
To confirm a section without a browser, use `adoptingCitations`, which lists the register instruments that adopted and amended it (for Texas, citations such as `50 TexReg 8285`), and read the text we captured at `textUrl`.

<Info>
  The government links (`stateHtmlUrl`, `govInfoHtmlUrl`, `govInfoPdfUrl`) let
  you deep-link users straight back to authoritative text on the state
  legislature's site or govinfo.gov. That is the recommended way to cite a
  source in your product.
</Info>

## Picking the best available format

Because fields can be `null`, choose the best format that is present rather than
assuming one exists. This helper prefers an official government link, then falls
back through the other formats:

<CodeGroup>
  ```python Python theme={"theme":"github-dark"}
  def best_source_url(result):
      for field in (
          "sourceUrl",
          "govInfoHtmlUrl",
          "stateHtmlUrl",
          "htmlUrl",
          "govInfoPdfUrl",
          "pdfUrl",
          "textUrl",
          "xmlUrl",
          "docxUrl",
          "externalUrl",
      ):
          url = result.get(field)
          if url:
              return url
      return None
  ```

  ```javascript JavaScript theme={"theme":"github-dark"}
  function bestSourceUrl(result) {
    const order = [
      "sourceUrl",
      "govInfoHtmlUrl",
      "stateHtmlUrl",
      "htmlUrl",
      "govInfoPdfUrl",
      "pdfUrl",
      "textUrl",
      "xmlUrl",
      "docxUrl",
      "externalUrl",
    ];
    for (const field of order) {
      if (result[field]) return result[field];
    }
    return null;
  }
  ```
</CodeGroup>

<Tip>
  For displaying the text itself, prefer `html` from the `/body` endpoint. For
  citing where it came from, use `sourceUrl` so readers can verify against the
  authoritative source.
</Tip>

## Related

<CardGroup cols={2}>
  <Card title="Section Identifiers" icon="hashtag" href="/docs/api-guide/concepts/section-ids">
    How to get an actId and fetch a section's metadata and body.
  </Card>

  <Card title="Corpus Types" icon="layer-group" href="/docs/api-guide/concepts/corpus-types">
    The corpusType tokens you filter a search by.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.