{
  "openapi": "3.0.1",
  "info": {
    "title": "Case Law Scraper",
    "description": "Search and retrieve US court opinions and case law from CourtListener - the largest open legal database with 4M+ court opinions. Search by keyword, filter by court, date range, and jurisdiction.",
    "version": "1.0",
    "x-build-id": "fqDG1brk0rUobiVmn"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~case-law-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-case-law-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/crawlerbros~case-law-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-case-law-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/crawlerbros~case-law-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-case-law-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "searchCases",
              "getCasesByJurisdiction",
              "getCaseDetail"
            ],
            "type": "string",
            "description": "Operation mode. 'searchCases' searches by keyword. 'getCasesByJurisdiction' gets cases from a specific jurisdiction. 'getCaseDetail' fetches specific cases by cluster ID (requires apiToken).",
            "default": "searchCases"
          },
          "apiToken": {
            "title": "CourtListener API Token",
            "type": "string",
            "description": "Optional API token from courtlistener.com for higher rate limits. Required for getCaseDetail mode. Free to register at https://www.courtlistener.com/register/"
          },
          "searchQuery": {
            "title": "Search Query",
            "type": "string",
            "description": "Keyword(s) to search for in case opinions. Supports boolean operators: AND, OR, NOT. Example: 'freedom of speech', 'first amendment school'"
          },
          "court": {
            "title": "Court",
            "enum": [
              "",
              "scotus",
              "ca1",
              "ca2",
              "ca3",
              "ca4",
              "ca5",
              "ca6",
              "ca7",
              "ca8",
              "ca9",
              "ca10",
              "ca11",
              "cadc",
              "cafc",
              "dcd",
              "ohioctapp",
              "nysupct",
              "calctapp",
              "texapp",
              "armfor"
            ],
            "type": "string",
            "description": "Filter by specific court ID (e.g. 'scotus' for Supreme Court, 'ca9' for 9th Circuit, 'ca2' for 2nd Circuit). Leave blank for all courts.",
            "default": ""
          },
          "jurisdiction": {
            "title": "Jurisdiction",
            "enum": [
              "",
              "F",
              "S",
              "C",
              "T"
            ],
            "type": "string",
            "description": "Filter by jurisdiction type: F=Federal, S=State, C=Committee, T=Territory. Leave blank for all.",
            "default": ""
          },
          "decisionDateMin": {
            "title": "Decision Date (from)",
            "type": "string",
            "description": "Filter cases decided on or after this date (YYYY-MM-DD format). Example: 2000-01-01"
          },
          "decisionDateMax": {
            "title": "Decision Date (to)",
            "type": "string",
            "description": "Filter cases decided on or before this date (YYYY-MM-DD format). Example: 2024-12-31"
          },
          "status": {
            "title": "Publication Status",
            "enum": [
              "",
              "Published",
              "Unpublished",
              "Errata",
              "Separate",
              "In-chambers",
              "Relating-to",
              "Unknown"
            ],
            "type": "string",
            "description": "Filter by publication status of the opinion.",
            "default": ""
          },
          "caseIds": {
            "title": "Case Cluster IDs (for getCaseDetail mode)",
            "type": "array",
            "description": "List of CourtListener cluster IDs to fetch details for (for getCaseDetail mode).",
            "items": {
              "type": "string"
            }
          },
          "jurisdictionSlug": {
            "title": "Jurisdiction Slug (for getCasesByJurisdiction mode)",
            "type": "string",
            "description": "The jurisdiction slug for getCasesByJurisdiction mode (e.g. 'cal' for California, 'ny' for New York, 'tex' for Texas, 'us' for federal)."
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of cases to return (1â€“1000).",
            "default": 50
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}