US Statutes

Find the citations in a text and resolve each

Read a block of text (a brief, a memo, a statute-heavy email, a model's answer) and return every distinct non-case legal citation in it, each resolved to the section it names. The text-in counterpart of POST /us/statutes/resolve: one call instead of extracting the citations yourself and sending them in batches of 50.

Extraction reads statutes, regulations, court rules, constitutions and registers, in federal and state form (42 U.S.C. § 1983(b), Cal. Civ. Code § 1942, Fed. R. Civ. P. 12, 8 CCR 1206-2, N.Y. Const. art. I, § 8). It does not extract case citations. It is measured, not perfect: about 0.92 to 0.98 precision and 0.80 to 0.85 recall on unseen opinion text, so a citation can be missed and a non-citation can be read as one; resolved is what we verified. extractorVersion is the extractor's version: the same text can yield different citations when it changes.

Dedupe. A citation and its pinpoint are one row however many times that exact pair appears (mentions counts them). Cal. Civ. Code § 1950.5(h) and Cal. Civ. Code § 1950.5(l) are two rows, each with its own pinpoint and pinpointMatch, so a wrong pinpoint on a repeated mention is checked and not hidden behind the first. A later bare section 1950.5(l) is read as the section the text already cited in full, when exactly one cited section has that number. The section is resolved once and charged once however many pinpoints of it appear. 42 U.S.C. § 1983 and 42 U.S.C.A. § 1983 are two rows, because they are two strings a reader might want checked; both carry the same actId.

Cost: 2 credits per DISTINCT citation (section, not pinpoint) sent to the resolver, the same as POST /us/statutes/resolve, so pasting a document costs what pasting its citations one by one costs. The extraction itself is free: resolve: false returns the citations found and charges nothing. An unresolved citation is charged (the verdict is the product); a session-law citation (skipped: session_law, read it under /us/session-laws) is not resolved here and not charged; a citation we fail to process is refunded one by one, and an outage that takes half of them or more answers 503 and refunds the call. The charge is taken after extraction and before any lookup, so creditsConsumed is known up front. One call resolves at most 200 distinct citations, so one click is at most 400 credits; truncated: true says more were found and only the listed ones were charged.

Limits. text is at most 200,000 characters (a 422, never a truncation) and must be text. A key may send 5,000 resolutions a day through this route; past that the call answers 429 with Retry-After and nothing is charged. The text is never stored.

Pinpoints. A citation printed with a pinpoint (42 U.S.C. § 1983(b)) also carries pinpointMatch: the unit it names, located inside the resolved section, as on GET /us/statutes/resolve (pinpoint there; here pinpoint is already the string printed in the text). Read pinpointMatch.matched first. It is present only for an exact match, adds no credits, and a row whose pinpoint could not be looked up this time keeps its resolution and gets a pinpointNote. pinpointMatch.matched: false (or matchLevel ancestor or none) says the section has no such unit; pinpointMatch.structure.quality: heuristic says the outline was parsed from the text and failed a check, so trust it less. A unit that EXISTS is not proof it says what the text claims: (l) exists in Cal. Civ. Code 1950.5 as a different rule than the one a brief may attribute to it. Compare pinpointMatch.text (the unit's own words) with the claim. A call spends at most about 20 seconds on pinpoints.

Unresolved rows carry missReason, candidates and missReasonHint, the same finding GET /us/statutes/resolve gives (no extra charge). Pass state (the document's jurisdiction) so a citation that names none, such as Civil Rule 56.1, is checked against the right one.

Related: POST /us/statutes/resolve for citations you already hold; GET /us/statutes/section/{actId} to read a resolved section.

post/api/v1/us/statutes/extract-citations

Request

Headers

Idempotency-Keystring nullable

Optional. 16 to 255 visible ASCII characters (a UUIDv4 is ideal). A retry with the same key and the same request replays the original 2xx response for 24 hours without charging again. The same key with a different request is rejected. Scope is the API key, method, path and body. The stored response body is a query-derived cache controlled by the account's data retention setting cacheQueryDerivedData: when it is false the body is never stored and a retry answers 409 idempotency_replay_unavailable, without charging again.

Example:3f9c2a1e-7b44-4d0a-9c1e-5a6b7c8d9e0f

Request body

textstring required

The text to read, 1 to 200,000 characters (a brief is about 30,000). Longer is a 422, never a silent truncation: a partial list reported as the whole is a wrong answer. Plain text; a body that is mostly binary is a 422.

state'al' | 'ak' | 'as' | 'az' | 'ar' | 'ca' | 'co' | 'ct' | 'de' | 'dc' | 'fl' | 'ga' | 'gu' | 'hi' | 'id' | 'il' | 'in' | 'ia' | 'ks' | 'ky' | 'la' | 'me' | 'md' | 'ma' | 'mi' | 'mn' | 'ms' | 'mo' | 'mt' | 'ne' | 'nv' | 'nh' | 'nj' | 'nm' | 'ny' | 'nc' | 'nd' | 'mp' | 'oh' | 'ok' | 'or' | 'pa' | 'pr' | 'ri' | 'sc' | 'sd' | 'tn' | 'tx' | 'ut' | 'vt' | 'vi' | 'va' | 'wa' | 'wv' | 'wi' | 'wy' nullable

The jurisdiction of the DOCUMENT as a two-letter state code (the forum of a filing, the governing state of a matter). It labels and scopes a citation that names no jurisdiction of its own (Civil Rule 56.1, Gov. Code § 12940); a citation that names a jurisdiction is always checked against that one, whatever this says.

resolveboolean

Resolve each distinct citation to its section (priced per distinct citation, see the endpoint's Cost). false returns the extraction alone, which is free.

includeUnresolvedboolean

false drops rows that did not resolve from citations. The counts and the charge are unchanged: an unresolved citation is a verdict that was paid for.

Example request

{
  "resolve": true,
  "state": "ca",
  "text": "Plaintiff sued under 42 U.S.C. § 1983(b). See also Cal. Civ. Code § 1942 and 42 U.S.C. § 1983."
}

Response

The distinct citations found, each resolved unless resolve is false.

truncatedboolean

True when more than 200 distinct citations were found and citations holds the first of them. counts.found still reports the number found, and only the ones listed were resolved and charged.

textCharsinteger required

Characters of text read.

extractorVersionstring required

The extractor's version. The same text can yield different citations when it changes, so cache extractions by text AND this value.

creditsConsumednumber

Credits actually charged. 0 when resolve is false.

processingTimeMsnumber

Server-side time for this request in milliseconds. Not billed on.

Example response

{
  "citations": [
    {
      "citation": "42 U.S.C. § 1983",
      "raw": "42 U.S.C. § 1983(b)",
      "type": "Statute",
      "subtype": "usc",
      "jurisdiction": "US",
      "jurisdictionSource": "cite",
      "pinpoint": "(b)",
      "mentions": 2,
      "actId": "USC_T42_C21_S1983",
      "subsection": "b",
      "matchLevel": "container",
      "pinpointMatch": {
        "requested": "(c)(1)",
        "path": [
          "c",
          "1"
        ],
        "label": "(1)",
        "level": "paragraph",
        "inferred": true,
        "matched": true,
        "matchLevel": "exact",
        "leadIn": [
          {
            "path": [
              "c"
            ],
            "label": "(c)",
            "text": "Unless a different limit is established under this Chapter, the limit is:"
          }
        ],
        "children": [
          {
            "path": [
              "c",
              "1"
            ],
            "label": "(1)",
            "level": "paragraph",
            "inferred": true
          }
        ],
        "siblings": {
          "previous": "b",
          "next": "d"
        },
        "charStart": 1204,
        "charEnd": 1873,
        "kind": "range",
        "reason": "no_such_subsection",
        "structure": {
          "source": "artifact",
          "quality": "verified",
          "builder": "ilga_html",
          "textSha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
        }
      },
      "missReason": "ambiguous_jurisdiction",
      "candidates": [
        {
          "state": "co",
          "actId": "REG_CO_T8_S1206-2",
          "citation": "8 CCR 1206-2"
        }
      ]
    }
  ],
  "extractorVersion": "0.6.0",
  "creditsConsumed": 6,
  "processingTimeMs": 412
}

Changes

No recorded changes to this operation across all 1 revision of this API.