Lex Machina Case Query API
Provides a filter based way to find cases.
Provides a filter based way to find cases.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
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.curl "https://apis.io/api/v1/apis/lex-machina-case-query-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
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: 3.2.0
info:
title: Lex Machina Case Query API
version: '20260324'
description: Provides a filter based way to find cases.
servers:
- url: https://api.lexmachina.com
description: Lex Machina production API
tags:
- name: Case Query
description: Provides a filter based way to find cases.
paths:
/query-state-cases:
post:
tags:
- Case Query
summary: Query State Cases
description: 'Queries enhanced state court cases.
- **data**: the state case query
See [https://developer.lexmachina.com/posts/query/state_query_usage/](https://developer.lexmachina.com/posts/query/state_query_usage/) for query formation.
The results will contain a list of cases, each with a specificed url and Lex Machina stateCaseId.'
operationId: query_state_cases
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/StateCaseQuery'
required: true
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/StateCaseQueryResult'
examples:
Query Results:
summary: Query Results
value:
cases:
- url: https://api.lexmachina.com/state-cases/2003442290
stateCaseId: 2003442290
- url: https://api.lexmachina.com/state-cases/2003442348
stateCaseId: 2003442348
- url: https://api.lexmachina.com/state-cases/2003442352
stateCaseId: 2003442352
- url: https://api.lexmachina.com/state-cases/2003463384
stateCaseId: 2003463384
- url: https://api.lexmachina.com/state-cases/2003442446
stateCaseId: 2003442446
'422':
description: Error - 422
content:
application/json:
examples:
Maximum Cases Per Page Exceeded:
summary: Maximum Cases Per Page Exceeded
value:
detail: Maximum cases per page is 100
Invalid Input:
summary: Invalid Input
value:
detail:
- type: missing
loc:
- body
- courts
- state
msg: Field required
input:
include:
- Fort Bend County District Court
Validation error:
summary: Validation error
value:
summary: Invalid input
detail:
- type: parsing
loc:
- path
- query
- body
msg: invalid input
input: '-1'
'401':
description: Invalid or expired token
content:
application/json:
examples:
Expired token:
summary: Expired token
value:
detail: 'Token time expired: Signature has expired.'
Invalid token:
summary: Invalid token
value:
detail: Invalid token
'404':
description: Not found
content:
application/json:
examples:
Not found:
summary: Not found
value:
summary: Unknown id
detail: Not Found
security:
- JwtAccessBearer: []
components:
schemas:
LawFirmFilter:
properties:
include:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Include
exclude:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Exclude
includePlaintiff:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Includeplaintiff
excludePlaintiff:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Excludeplaintiff
includeDefendant:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Includedefendant
excludeDefendant:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Excludedefendant
includeThirdParty:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Includethirdparty
excludeThirdParty:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Excludethirdparty
additionalProperties: false
type: object
title: LawFirmFilter
Ordering:
type: string
enum:
- ByFirstFiled
- ByLastFiled
title: Ordering
StateCaseQueryResult:
properties:
cases:
items:
$ref: '#/components/schemas/StateCaseReference'
type: array
title: Cases
additionalProperties: false
type: object
required:
- cases
title: StateCaseQueryResult
StateCourtFilter:
properties:
state:
type: string
title: State
include:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Include
exclude:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Exclude
additionalProperties: false
type: object
required:
- state
title: StateCourtFilter
NameFilter:
properties:
include:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Include
exclude:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Exclude
additionalProperties: false
type: object
title: NameFilter
JudgmentEventFilter:
properties:
include:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Include
exclude:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Exclude
additionalProperties: false
type: object
title: JudgmentEventFilter
ResolutionsFilter:
properties:
include:
anyOf:
- items:
$ref: '#/components/schemas/IndividualResolutionsFilter'
type: array
- type: 'null'
title: Include
exclude:
anyOf:
- items:
$ref: '#/components/schemas/IndividualResolutionsFilter'
type: array
- type: 'null'
title: Exclude
additionalProperties: false
type: object
title: ResolutionsFilter
EventFilter:
properties:
include:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Include
exclude:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Exclude
additionalProperties: false
type: object
title: EventFilter
StateCaseReference:
properties:
url:
type: string
title: Url
stateCaseId:
type: integer
title: Statecaseid
additionalProperties: false
type: object
required:
- url
- stateCaseId
title: StateCaseReference
PartyFilter:
properties:
include:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Include
exclude:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Exclude
includePlaintiff:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Includeplaintiff
excludePlaintiff:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Excludeplaintiff
includeDefendant:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Includedefendant
excludeDefendant:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Excludedefendant
includeThirdParty:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Includethirdparty
excludeThirdParty:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Excludethirdparty
additionalProperties: false
type: object
title: PartyFilter
CaseStatus:
type: string
enum:
- Open
- Terminated
title: CaseStatus
CaseTagsFilter:
properties:
include:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Include
exclude:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Exclude
additionalProperties: false
type: object
title: CaseTagsFilter
IndividualStateDamagesFilter:
properties:
name:
anyOf:
- $ref: '#/components/schemas/NameFilter'
- type: 'null'
date:
anyOf:
- $ref: '#/components/schemas/TimingFilter'
- type: 'null'
awardedToParties:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Awardedtoparties
awardedAgainstParties:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Awardedagainstparties
minimumAmount:
anyOf:
- type: number
- type: string
pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
- type: 'null'
title: Minimumamount
additionalProperties: false
type: object
title: IndividualStateDamagesFilter
JudgeFilter:
properties:
include:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Include
exclude:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Exclude
additionalProperties: false
type: object
title: JudgeFilter
AttorneyFilter:
properties:
include:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Include
exclude:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Exclude
includePlaintiff:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Includeplaintiff
excludePlaintiff:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Excludeplaintiff
includeDefendant:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Includedefendant
excludeDefendant:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Excludedefendant
includeThirdParty:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Includethirdparty
excludeThirdParty:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Excludethirdparty
additionalProperties: false
type: object
title: AttorneyFilter
CaseTypesFilter:
properties:
include:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Include
exclude:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Exclude
additionalProperties: false
type: object
title: CaseTypesFilter
IndividualRulingsFilter:
properties:
judgmentEvent:
anyOf:
- $ref: '#/components/schemas/JudgmentEventFilter'
- type: 'null'
awardedToParties:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Awardedtoparties
awardedAgainstParties:
anyOf:
- items:
type: integer
exclusiveMaximum: 2147483647.0
exclusiveMinimum: 0.0
type: array
- type: 'null'
title: Awardedagainstparties
date:
anyOf:
- $ref: '#/components/schemas/TimingFilter'
- type: 'null'
additionalProperties: false
type: object
title: IndividualRulingsFilter
TimingFilter:
properties:
onOrAfter:
anyOf:
- type: string
format: date
- type: 'null'
title: Onorafter
onOrBefore:
anyOf:
- type: string
format: date
- type: 'null'
title: Onorbefore
additionalProperties: false
type: object
title: TimingFilter
StateCaseQuery:
properties:
courts:
$ref: '#/components/schemas/StateCourtFilter'
caseStatus:
anyOf:
- $ref: '#/components/schemas/CaseStatus'
- type: 'null'
caseTypes:
anyOf:
- $ref: '#/components/schemas/CaseTypesFilter'
- type: 'null'
caseTags:
anyOf:
- $ref: '#/components/schemas/CaseTagsFilter'
- type: 'null'
dates:
anyOf:
- $ref: '#/components/schemas/CaseDatesFilter'
- type: 'null'
judges:
anyOf:
- $ref: '#/components/schemas/JudgeFilter'
- type: 'null'
events:
anyOf:
- $ref: '#/components/schemas/EventFilter'
- type: 'null'
lawFirms:
anyOf:
- $ref: '#/components/schemas/LawFirmFilter'
- type: 'null'
attorneys:
anyOf:
- $ref: '#/components/schemas/AttorneyFilter'
- type: 'null'
parties:
anyOf:
- $ref: '#/components/schemas/PartyFilter'
- type: 'null'
resolutions:
anyOf:
- $ref: '#/components/schemas/ResolutionsFilter'
- type: 'null'
damages:
anyOf:
- items:
$ref: '#/components/schemas/IndividualStateDamagesFilter'
type: array
- type: 'null'
title: Damages
rulings:
anyOf:
- items:
$ref: '#/components/schemas/IndividualRulingsFilter'
type: array
- type: 'null'
title: Rulings
ordering:
$ref: '#/components/schemas/Ordering'
default: ByFirstFiled
page:
type: integer
title: Page
default: 1
pageSize:
type: integer
title: Pagesize
default: 5
additionalProperties: false
type: object
required:
- courts
title: StateCaseQuery
example:
caseStatus: Terminated
courts:
include:
- Fort Bend County District Court
state: TX
dates:
filed:
onOrAfter: '2016-01-01'
terminated:
onOrBefore: '2021-05-01'
judges:
include:
- 1792
ordering: ByFirstFiled
page: 1
pageSize: 5
IndividualResolutionsFilter:
properties:
summary:
anyOf:
- type: string
- type: 'null'
title: Summary
specific:
anyOf:
- type: string
- type: 'null'
title: Specific
additionalProperties: false
type: object
title: IndividualResolutionsFilter
CaseDatesFilter:
properties:
filed:
anyOf:
- $ref: '#/components/schemas/TimingFilter'
- type: 'null'
terminated:
anyOf:
- $ref: '#/components/schemas/TimingFilter'
- type: 'null'
trial:
anyOf:
- $ref: '#/components/schemas/TimingFilter'
- type: 'null'
lastDocket:
anyOf:
- $ref: '#/components/schemas/TimingFilter'
- type: 'null'
additionalProperties: false
type: object
title: CaseDatesFilter
securitySchemes:
JwtAccessBearer:
type: http
scheme: bearer