{
  "openapi": "3.0.1",
  "info": {
    "title": "CourtListener Legal Data Scraper",
    "description": "Scrape U.S. federal & state case law, RECAP dockets, oral arguments, and judges from CourtListener (Free Law Project). Powered by the official REST API — no scraping, no proxies, no captchas.",
    "version": "0.1",
    "x-build-id": "UHGDD7JAghe7WumP2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/alwaysprimedev~courtlistener-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-alwaysprimedev-courtlistener-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/alwaysprimedev~courtlistener-scraper/runs": {
      "post": {
        "operationId": "runs-sync-alwaysprimedev-courtlistener-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/alwaysprimedev~courtlistener-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-alwaysprimedev-courtlistener-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",
        "properties": {
          "searchType": {
            "title": "Search type",
            "enum": [
              "opinions",
              "recap",
              "recap_documents",
              "oral_arguments",
              "people"
            ],
            "type": "string",
            "description": "What kind of records to return. 'opinions' for case law, 'recap' for federal dockets sourced from PACER, 'recap_documents' for individual filings, 'oral_arguments' for argument audio, 'people' for federal & state judges.",
            "default": "opinions"
          },
          "query": {
            "title": "Search query",
            "type": "string",
            "description": "Free-text search applied across the selected record type. Supports quoted phrases ('miranda warning'), boolean operators (AND/OR/NOT), and field-prefix queries (e.g. caseName:'Roe v. Wade'). Leave empty to return all records matching the other filters."
          },
          "courtIds": {
            "title": "Courts (optional)",
            "type": "array",
            "description": "Restrict results to one or more courts by their CourtListener short ID (e.g. 'scotus' for the U.S. Supreme Court, 'ca9' for the Ninth Circuit, 'nyed' for E.D.N.Y.). Leave empty to search all courts.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "dateFiledAfter": {
            "title": "Filed after",
            "type": "string",
            "description": "Lower bound on the document's filing date. ISO format (YYYY-MM-DD). Leave empty for no lower bound."
          },
          "dateFiledBefore": {
            "title": "Filed before",
            "type": "string",
            "description": "Upper bound on the document's filing date. ISO format (YYYY-MM-DD). Leave empty for no upper bound."
          },
          "orderBy": {
            "title": "Sort order",
            "enum": [
              "score desc",
              "dateFiled desc",
              "dateFiled asc",
              "dateArgued desc",
              "dateArgued asc",
              "citeCount desc"
            ],
            "type": "string",
            "description": "How to sort results before paginating. Use 'score desc' for relevance to the query, 'dateFiled desc/asc' for chronological listings, or 'citeCount desc' to find frequently-cited opinions.",
            "default": "score desc"
          },
          "maxItems": {
            "title": "Maximum items",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Stop after pushing this many records to the dataset. Set 0 to fetch every match (capped only by your API rate limit).",
            "default": 50
          },
          "pageSize": {
            "title": "API page size",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Number of records requested per HTTP call to the CourtListener search endpoint. Larger pages are more efficient but each one counts as one API call against your rate limit. The API allows up to 100.",
            "default": 20
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "Maximum number of parallel HTTP calls. The CourtListener API throttles per token at 5 requests per minute by default, so increasing this past 1–2 only helps if you have a higher-tier API token.",
            "default": 1
          },
          "since": {
            "title": "Incremental: only fetch records newer than this date",
            "type": "string",
            "description": "Optional incremental mode. When set, results whose filing date is older than this are skipped. Combine with a scheduled run to keep a dataset up to date without refetching everything. ISO YYYY-MM-DD."
          },
          "apiToken": {
            "title": "CourtListener API token (optional)",
            "type": "string",
            "description": "Your personal CourtListener API token, found at courtlistener.com/profile/api-token/. Anonymous use is allowed and works for small runs, but a token gives you a private rate-limit pool and access to authenticated endpoints. CourtListener Membership unlocks higher throughput."
          },
          "startUrls": {
            "title": "Custom start URLs (advanced)",
            "type": "array",
            "description": "Advanced override. Provide one or more fully-formed CourtListener API search URLs (https://www.courtlistener.com/api/rest/v4/search/?…) to bypass the filters above and use the URLs as-is. Leave empty for normal use.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}