{
  "openapi": "3.0.1",
  "info": {
    "title": "CourtListener → Opinion & Docket Markdown",
    "description": "CourtListener opinions, dockets, and search → Markdown due-diligence / RAG cards + JSON. Keyless search by default; optional buyer CourtListener API token for /opinions/ and /dockets/. No PACER login. Failed rows free. 256 MB.",
    "version": "0.1",
    "x-build-id": "S1opnthA3NPgjTCdP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ingenious_quip_bxq~courtlistener-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ingenious_quip_bxq-courtlistener-markdown",
        "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/ingenious_quip_bxq~courtlistener-markdown/runs": {
      "post": {
        "operationId": "runs-sync-ingenious_quip_bxq-courtlistener-markdown",
        "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/ingenious_quip_bxq~courtlistener-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-ingenious_quip_bxq-courtlistener-markdown",
        "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",
        "properties": {
          "queries": {
            "title": "Search queries",
            "type": "array",
            "description": "Free-text CourtListener search queries (keyless). Uses GET /api/rest/v4/search/. One card per hit (capped by maxItems / searchPageSize).",
            "items": {
              "type": "string"
            }
          },
          "opinionIds": {
            "title": "Opinion IDs",
            "type": "array",
            "description": "CourtListener opinion IDs (integers) or /api/rest/v4/opinions/{id}/ URLs. Requires apiToken. Site /opinion/{id}/ URLs use cluster ids — prefer urls field or paste the cluster URL there.",
            "items": {
              "type": "string"
            }
          },
          "docketIds": {
            "title": "Docket IDs",
            "type": "array",
            "description": "CourtListener docket IDs or /docket/{id}/ / /api/rest/v4/dockets/{id}/ URLs. Requires apiToken.",
            "items": {
              "type": "string"
            }
          },
          "urls": {
            "title": "CourtListener URLs",
            "type": "array",
            "description": "Opinion, docket, or API URLs, e.g. https://www.courtlistener.com/opinion/8976604/miranda-v-arizona/ (cluster id) or /docket/{id}/…. Opinion/docket detail fetches require apiToken.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Dataset ID",
            "type": "string",
            "description": "Optional. Read queries/ids/urls from another run's dataset (field from 'ID field', else query / opinionId / docketId / url / id)."
          },
          "keyValueStoreId": {
            "title": "Key-value store ID",
            "type": "string",
            "description": "Optional. Read from a KV record: JSON {queries, opinionIds, docketIds, urls}, array, or plain text lines."
          },
          "keyValueRecordKey": {
            "title": "Key-value record key",
            "type": "string",
            "description": "Record key inside the key-value store.",
            "default": "INPUT_COURT"
          },
          "idField": {
            "title": "ID / query field (dataset / JSON objects)",
            "type": "string",
            "description": "Optional. Field name holding the query, id, or URL in dataset items or JSON objects."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "auto",
              "search",
              "opinion",
              "docket"
            ],
            "type": "string",
            "description": "auto = detect from dedicated fields (queries→search, opinionIds→opinion, docketIds→docket, urls parsed). search = force search type=o (or type=d only if you only pass docket-oriented queries via mode… use docket mode for docket search). opinion / docket force those authenticated endpoints when ids are given.",
            "default": "auto"
          },
          "apiToken": {
            "title": "CourtListener API token (optional BYOK)",
            "type": "string",
            "description": "Optional. Your free CourtListener API token from https://www.courtlistener.com/profile/api-token/ (sent as Authorization: Token <token>). Not required for search. Stored encrypted, never logged. Placeholders like YOUR_TOKEN are ignored. Publisher does not store a shared token. Never put PACER passwords here."
          },
          "stopOnAuthError": {
            "title": "Stop authenticated calls after auth error",
            "type": "boolean",
            "description": "After CourtListener returns 401/403 once on a token call, skip further authenticated endpoints. Search still works. Failed rows are free.",
            "default": true
          },
          "enrichSearchHits": {
            "title": "Enrich search hits with opinion fetch (when token set)",
            "type": "boolean",
            "description": "If apiToken is set, deepen each opinion search hit by fetching /opinions/{id}/ for fuller plain_text. Extra authenticated calls; respect rate limits.",
            "default": true
          },
          "includeRagChunks": {
            "title": "Write RAG chunks (CHUNKS.jsonl)",
            "type": "boolean",
            "description": "Write one self-describing chunk per card section to KV record CHUNKS.jsonl.",
            "default": true
          },
          "snippetMaxChars": {
            "title": "Max excerpt characters",
            "minimum": 200,
            "maximum": 50000,
            "type": "integer",
            "description": "Truncate opinion plain_text / HTML excerpt in Markdown to this many characters (note appended when truncated).",
            "default": 4000
          },
          "searchPageSize": {
            "title": "Search page size per query",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many search hits to request per query (further capped by maxItems).",
            "default": 5
          },
          "maxItems": {
            "title": "Max cards",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many successful cards (0 = no limit). Also caps the number of input targets processed.",
            "default": 50
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Parallel lookups. CourtListener rate-limits anonymous and free-token traffic; 2 is a safe default.",
            "default": 2
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 6,
            "type": "integer",
            "description": "Retries for HTTP 429 (honours Retry-After, capped at 30 s), 5xx, timeouts and network errors. 400/401/403/404 are not retried.",
            "default": 3
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Timeout for each CourtListener HTTP call.",
            "default": 30
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}