> ## 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.

# Count the sections in a scope

> How many sections sit in a jurisdiction, corpus, code, title, chapter or part.

**Cost**: 1 credit. A scope that matches nothing is refunded, because an empty
answer here is usually a wrong filter rather than a finding.

Use it to size a job before you run it. Walking a container with
`/us/statutes/divisions` and hydrating what you find is cheap per call and adds
up across a whole corpus, so this is the call that tells you what you are about
to spend before you spend it.

**There is no `query` parameter, on purpose.** Search ranks over a bounded
window, so "how many sections match this query" has no answer beyond the size of
that window. This counts a SCOPE, which is exact. Pair the two: count the scope
here, enumerate it with `/us/statutes/divisions`, then rank within it using
`/us/statutes/search`.

The figure counts SECTIONS. Long sections are stored as several passages and are
counted once.



## OpenAPI

````yaml https://api.vaquill.ai/external/openapi.json post /api/v1/us/statutes/count
openapi: 3.1.0
info:
  title: Vaquill Developer API
  description: >-
    Public API for legal statutes and legislation.


    **Authentication**: Pass your API key via the `Authorization: Bearer
    vq_key_...` header.


    **Credits**: Each call costs API credits. See `GET
    /api/v1/api-credits/pricing` for the full pricing matrix.


    ## Jurisdictions


    | Jurisdiction | Coverage | `countryCode` |

    |---|---|---|

    | **United States** | USC and the Statutes at Large, the CFR and its annual
    editions, all 52 state and territory statutory codes (50 states plus DC and
    Puerto Rico), state administrative regulations, court rules, federal and
    state constitutions, federal agency guidance and adjudications, the Federal
    Register, the Sentencing Guidelines and US tax treaties. | `US` |


    See the full [Coverage page](https://www.vaquill.ai/docs/api-guide/coverage)
    for the jurisdiction-by-jurisdiction breakdown, or call
    `/us/statutes/coverage` for live counts. Coverage is per (jurisdiction,
    corpusType) pair, so treat that endpoint as the authoritative list rather
    than this summary.


    ## Endpoints


    - **US Statutes**: Search and retrieve any of the corpora above with full
    text, resolve a citation to its exact section, browse the statutory
    hierarchy, read a section as it stood on a past date, and follow its change
    history, cross-references and defined terms

    - **Board Watches**: Subscribe to a corpus source and get a webhook or email
    when it refreshes with real changes (free, API key required)

    - **Pricing**: Credit costs per endpoint (no auth required)


    ## Rate limits


    Limits are enforced per API key and scale with your plan. A `429` response
    includes a `Retry-After` header.


    | Plan | Per minute | Per hour | Per day |

    |---|---|---|---|

    | Vaquill API Pro | 60 | 1,000 | 2,000 |

    | Vaquill API Business | 150 | 2,500 | 10,000 |


    For full documentation, visit the [API
    Reference](https://www.vaquill.ai/docs/api-reference/).
  version: 1.0.0
  contact:
    name: Vaquill API Support
    url: https://www.vaquill.ai
    email: support@vaquill.ai
  license:
    name: Proprietary
    url: https://www.vaquill.ai/terms
  termsOfService: https://www.vaquill.ai/terms
servers:
  - url: https://api.vaquill.ai
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: US Statutes
    description: >-
      Search and retrieve US primary law. Covers the United States Code and the
      Statutes at Large, the Code of Federal Regulations and its annual
      editions, state statutory codes and administrative regulations, federal
      and state constitutions, court rules, Federal Register rules and
      Presidential documents, federal and state agency guidance, agency
      adjudications, state Attorney General opinions, the Sentencing Guidelines
      and US tax treaties. Scope a search with the `corpusType` filter, and call
      `/us/statutes/coverage` for the live jurisdiction-by-corpusType list.


      - **Search**: Search across all USC, CFR, state, and regulatory sections

      - **Section**: Get metadata, citation, hierarchy, and source links for a
      specific section

      - **Body**: Get the full text of a section
  - name: Board Watches
    description: >-
      Law-change alerts. Subscribe to a **board** (a tracked corpus source,
      identified by `corpusType` plus an optional `state`) and get a webhook or
      email whenever it refreshes with real changes, naming the exact sections
      that changed. Fetch old-vs-new text for any amended section via the change
      diff.


      Boards refresh on their own existing cadence; watching one does not change
      how often it refreshes. Every endpoint here is **free**: authenticated by
      API key and rate-limited, but not credit-metered.


      See the [Law Change Alerts
      guide](https://www.vaquill.ai/docs/api-guide/alerts) for the full
      walkthrough.
  - name: Pricing
    description: >-
      Credit pricing and conversion rates. No authentication required. 1 credit
      = $0.01 USD.
  - name: Credits
    description: >-
      Your own credit balance: what is spendable right now, where it came from,
      and what is about to expire.


      Free and never charged, so it is safe to poll for low-balance alerting or
      to pre-flight a batch job.
externalDocs:
  description: Full API Reference
  url: https://www.vaquill.ai/docs/api-reference/
paths:
  /api/v1/us/statutes/count:
    post:
      tags:
        - US Statutes
      summary: Count the sections in a scope
      description: >-
        How many sections sit in a jurisdiction, corpus, code, title, chapter or
        part.


        **Cost**: 1 credit. A scope that matches nothing is refunded, because an
        empty

        answer here is usually a wrong filter rather than a finding.


        Use it to size a job before you run it. Walking a container with

        `/us/statutes/divisions` and hydrating what you find is cheap per call
        and adds

        up across a whole corpus, so this is the call that tells you what you
        are about

        to spend before you spend it.


        **There is no `query` parameter, on purpose.** Search ranks over a
        bounded

        window, so "how many sections match this query" has no answer beyond the
        size of

        that window. This counts a SCOPE, which is exact. Pair the two: count
        the scope

        here, enumerate it with `/us/statutes/divisions`, then rank within it
        using

        `/us/statutes/search`.


        The figure counts SECTIONS. Long sections are stored as several passages
        and are

        counted once.
      operationId: count_statute_sections_api_v1_us_statutes_count_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StatuteCountRequest'
        required: true
      responses:
        '200':
          description: The number of sections in scope, and the scope that produced it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatuteCountResponse'
        '401':
          description: Invalid or missing API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiDetailError'
        '402':
          description: Insufficient credits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiDetailError'
        '422':
          description: Unknown filter value or unknown field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiDetailError'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiDetailError'
components:
  schemas:
    StatuteCountRequest:
      properties:
        corpusType:
          anyOf:
            - type: string
              enum:
                - USC
                - CFR
                - STATE
                - CONSTITUTION
                - FEDERAL_RULES
                - STATE_CONSTITUTION
                - STATE_RULES
                - EXECUTIVE_ACTION
                - REGULATION
                - FEDERAL_REGISTER
                - FEDERAL_REGISTER_NOTICE
                - AGENCY_GUIDANCE
                - SENTENCING_GUIDELINES
                - US_TAX_TREATY
                - STATE_AGENCY_GUIDANCE
                - STATE_AG_OPINION
                - SESSION_LAW
                - STATUTE_COMPILATION
                - AGENCY_ADJUDICATION
                - CFR_ANNUAL
                - USC_ANNUAL
            - items:
                type: string
                enum:
                  - USC
                  - CFR
                  - STATE
                  - CONSTITUTION
                  - FEDERAL_RULES
                  - STATE_CONSTITUTION
                  - STATE_RULES
                  - EXECUTIVE_ACTION
                  - REGULATION
                  - FEDERAL_REGISTER
                  - FEDERAL_REGISTER_NOTICE
                  - AGENCY_GUIDANCE
                  - SENTENCING_GUIDELINES
                  - US_TAX_TREATY
                  - STATE_AGENCY_GUIDANCE
                  - STATE_AG_OPINION
                  - SESSION_LAW
                  - STATUTE_COMPILATION
                  - AGENCY_ADJUDICATION
                  - CFR_ANNUAL
                  - USC_ANNUAL
              type: array
            - type: 'null'
          title: Corpustype
          description: Corpus to count, single or list. Omit to count every corpus.
          examples:
            - REGULATION
        state:
          anyOf:
            - type: string
            - items:
                type: string
              type: array
            - type: 'null'
          enum:
            - federal
            - al
            - ak
            - az
            - ar
            - ca
            - co
            - ct
            - de
            - dc
            - fl
            - ga
            - hi
            - id
            - il
            - in
            - ia
            - ks
            - ky
            - la
            - me
            - md
            - ma
            - mi
            - mn
            - ms
            - mo
            - mt
            - ne
            - nv
            - nh
            - nj
            - nm
            - ny
            - nc
            - nd
            - oh
            - ok
            - or
            - pa
            - pr
            - ri
            - sc
            - sd
            - tn
            - tx
            - ut
            - vt
            - va
            - wa
            - wv
            - wi
            - wy
          title: State
          description: Two-letter jurisdiction code or `federal`, single or list.
          examples:
            - tx
        code:
          anyOf:
            - type: string
            - items:
                type: string
              type: array
            - type: 'null'
          title: Code
          description: State code identifier, e.g. `tx_26`. Pair with `state`.
          examples:
            - tx_26
        titleNumber:
          anyOf:
            - type: integer
            - type: 'null'
          title: Titlenumber
          description: USC or CFR title number.
          examples:
            - 42
        chapter:
          anyOf:
            - type: string
            - items:
                type: string
              type: array
            - type: 'null'
          title: Chapter
          description: Chapter identifier. Pair with `titleNumber` or `code`.
          examples:
            - '554'
        part:
          anyOf:
            - type: string
            - items:
                type: string
              type: array
            - type: 'null'
          title: Part
          description: CFR part identifier. Pair with `titleNumber`.
          examples:
            - '240'
        actStatus:
          anyOf:
            - type: string
            - items:
                type: string
              type: array
            - type: 'null'
          title: Actstatus
          description: Count only sections carrying this status.
          examples:
            - repealed
        excludeRepealed:
          type: boolean
          title: Excluderepealed
          description: >-
            Exclude sections whose status is affirmatively dead. A section with
            no recorded status is KEPT, because a missing status is not evidence
            of repeal. The US Code is served from a stored annual edition, so a
            section repealed after it closed is counted here; see the same field
            on `/search` for the measurement.
          default: false
          examples:
            - true
      additionalProperties: false
      type: object
      title: StatuteCountRequest
      description: >-
        Filter-only section count. See `POST /us/statutes/count`.


        Deliberately takes NO `query`. A count of "sections matching this query"

        does not exist: ranking runs over a bounded window, so the honest answer
        to

        that question is the window size rather than a corpus figure. This
        counts a

        SCOPE, which is exact, cheap, and the number an acquisition job actually

        needs before it starts walking.
    StatuteCountResponse:
      properties:
        count:
          type: integer
          title: Count
          description: >-
            Sections in scope. This is a SECTION count, not a passage count:
            long sections are stored as several passages and are counted once.
          default: 0
          examples:
            - 43638
        isExact:
          type: boolean
          title: Isexact
          description: >-
            True when the figure is an exact count rather than an estimate.
            Present so a future estimated mode cannot be mistaken for this one.
          default: true
          examples:
            - true
        scope:
          additionalProperties: true
          type: object
          title: Scope
          description: >-
            The filters that produced this figure, echoed back. A count with no
            scope attached is not reproducible, and an ignored filter would
            otherwise be invisible.
          examples:
            - corpusType: REGULATION
              state: tx
        processingTimeMs:
          type: number
          title: Processingtimems
          description: Server-side time for this request in milliseconds.
          default: 0
          examples:
            - 85.2
        creditsConsumed:
          type: number
          title: Creditsconsumed
          description: Credits actually charged for this call.
          default: 0
          examples:
            - 1
      type: object
      title: StatuteCountResponse
      description: Response for `POST /us/statutes/count`.
    ApiDetailError:
      properties:
        detail:
          type: string
          title: Detail
          description: >-
            Human-readable reason, safe to surface to an end user. Branch on the
            HTTP status rather than on this string: the wording is not part of
            the contract and may be reworded, but 401 (bad key), 402 (out of
            credits), 403 (missing scope), 404 (no such resource) and 429 (rate
            limited) are stable.
          examples:
            - Insufficient API credits.
      type: object
      required:
        - detail
      title: ApiDetailError
      description: |-
        Error envelope the API actually returns.

        All errors (401/402/403/404/422/429/5xx) come back as a single
        `detail` string (FastAPI default), e.g. `{"detail": "Insufficient API
        credits."}`. Documenting the real shape so client code can rely on it.
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: vq_key_*
      description: >-
        API key issued from the developer dashboard. Pass as `Authorization:
        Bearer vq_key_...`

````