Corpus Search API

Find provisions by topic or keyword.

GitHub OpenAPI

Operations 1

GET /api/v1/search Search US federal + state law #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/corpuslaw-us:corpuslaw-us-search-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

corpuslaw-us-search-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Corpuslaw Us Search API
  version: 1.0.0
  contact:
    name: Corpus
    url: https://corpuslaw.us
  license:
    name: Proprietary
  description: 'Operations tagged Search across 2 of this provider''s published API definitions: corpuslaw-us-openapi.json, corpuslaw-us-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://corpuslaw.us
  description: Production
security:
- bearerAuth: []
tags:
- name: Search
  description: Find provisions by topic or keyword.
paths:
  /api/v1/search:
    get:
      operationId: searchLaw
      summary: Search US federal + state law
      description: Hybrid semantic + keyword search over every ingested provision. Returns ranked results with citations, headings, and snippets. Check /api/v1/coverage first to see which jurisdictions are searchable. (Costs 1 credit.)
      tags:
      - Search
      responses:
        '200':
          description: Success
          headers:
            X-Credits-Remaining:
              $ref: '#/components/headers/XCreditsRemaining'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
          content:
            application/json:
              schema:
                type: object
                example:
                  results: SearchResultItem[] — nodeId, citation, heading, jurisdiction, codeBody, snippet, score
                  page: 1
                  pageSize: 20
                  total: 42
                  tookMs: 87
                  mode: hybrid
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientCredits'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimited'
      parameters:
      - name: q
        in: query
        required: true
        description: Search query (natural language or keywords).
        schema:
          type: string
          example: distillery permit requirements
      - name: page
        in: query
        required: false
        description: 1-based page number.
        schema:
          type: integer
          default: 1
      - name: limit
        in: query
        required: false
        description: Results per page (max 100).
        schema:
          type: integer
          default: 20
      - name: mode
        in: query
        required: false
        description: Retrieval mode. 'hybrid' fuses vector similarity with keyword search.
        schema:
          type: string
          enum:
          - hybrid
          - semantic
          - keyword
          default: hybrid
      - name: jurisdiction
        in: query
        required: false
        description: Scope to a jurisdiction short code (e.g. TX, US, CA-SF). US means federal law only; a state or city code includes its sub-jurisdictions. Without it, every jurisdiction is searched. See /api/v1/coverage for codes.
        schema:
          type: string
          example: TX
      - name: codeBody
        in: query
        required: false
        description: Scope to a single code body by UUID (from /api/v1/code-bodies).
        schema:
          type: string
      - name: facets
        in: query
        required: false
        description: Include facet counts (jurisdiction/tag histograms). Off by default to save latency; most agents don't need them.
        schema:
          type: boolean
          default: false
      security:
      - bearerAuth:
        - search
    servers:
    - url: https://corpuslaw.us
      description: Production
components:
  schemas:
    Error:
      type: object
      required:
      - error
      - message
      properties:
        error:
          type: string
          description: Machine-readable error code.
          example: insufficient_credits
        message:
          type: string
          description: Human-readable explanation with a recovery hint.
        upgradeUrl:
          type: string
          description: Where to buy more credits (present on 402).
        retryAfterSec:
          type: integer
          description: Seconds to wait before retrying (present on 429).
  headers:
    XRateLimitLimit:
      description: Requests-per-minute ceiling for this key's tier.
      schema:
        type: integer
    XCreditsRemaining:
      description: Credits left on this key after the call.
      schema:
        type: integer
  responses:
    InsufficientCredits:
      description: No credits remaining.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: insufficient_credits
            message: You have no credits remaining. Buy credits to continue.
            upgradeUrl: https://corpuslaw.us/api/v1/billing/checkout
    RateLimited:
      description: Rate limit exceeded. Respect `Retry-After`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: rate_limited
            message: Rate limit exceeded. Try again in 60 seconds.
            retryAfterSec: 60
    ValidationError:
      description: A required parameter is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: validation_error
            message: The 'q' parameter is required.
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: invalid_api_key
            message: 'A valid API key is required. Pass it via the Authorization: Bearer <key> header.'
    Forbidden:
      description: Key lacks the required scope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: insufficient_scope
            message: This key does not have any of the required scopes.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Pass your key as `Authorization: Bearer <api_key>`. Header only — query-param auth is disabled in production.'
x-refined-from:
- corpuslaw-us-openapi.json
- corpuslaw-us-openapi.yml