{
  "openapi": "3.0.1",
  "info": {
    "title": "Court Records & Legal Research - LegalHarvest",
    "description": "Search public court records, case law, dockets, 50-state statutes, bills, filings, and federal regulations from one Apify Actor, with batch queries and AI-ready dossier outputs.",
    "version": "0.1",
    "x-build-id": "l9ncsTXzZvfr6Ry97"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/valor-investigations~legalharvest/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-valor-investigations-legalharvest",
        "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/valor-investigations~legalharvest/runs": {
      "post": {
        "operationId": "runs-sync-valor-investigations-legalharvest",
        "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/valor-investigations~legalharvest/run-sync": {
      "post": {
        "operationId": "run-sync-valor-investigations-legalharvest",
        "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": [
          "query"
        ],
        "properties": {
          "query": {
            "title": "Primary query",
            "type": "string",
            "description": "The first keyword, citation, company, bill, or docket query to search across enabled sources. Use this by itself for a normal single-query run, or pair it with batch_queries to run a quota-friendly batch in sequence. Citation examples: ORS 192.431, 42 U.S.C. 1983, 45 CFR 164.512, Ala. Code 36-12-40, Alaska Statutes 40.25.110, Ark. Code 25-19-105, A.R.S. 39-121, California Penal Code 187, C.R.S. 24-72-203, Conn. Gen. Stat. 1-210, 29 Del. C. 10003, Florida Statutes 119.07, O.C.G.A. 50-18-71, HRS 92F-11, Idaho Code 74-102, 5 ILCS 140/3, I.C. 5-14-3-3, Iowa Code 22.2, K.S.A. 45-218, KRS 61.872, La. R.S. 44:31, Maine Revised Statutes Title 1 section 408-A, Md. Code, General Provisions 4-201, MGL c.66 section 10, MCL 15.231, Minn. Stat. 13.03, Miss. Code 25-61-5, MCA 2-6-1003, Neb. Rev. Stat. 84-712, NDCC 44-04-18, NMSA 14-2-8, NRS 239.010, NJSA 47:1A-1, NY Pub Off Law 87, RSA 91-A:4, 51 O.S. 24A.5, R.I. Gen. Laws 38-2-3, RSMo 610.023, NCGS 132-1, ORC 2903.02, 65 Pa. C.S. 701, RCW 42.56.070, SDCL 1-27-1, S.C. Code 30-4-30, TCA 10-7-503, Utah Code 63G-2-201, Virginia Code 2.2-3704, 1 VSA 316, Wis. Stat. 19.35, W. Va. Code 29B-1-3, Wyo. Stat. 16-4-202, HB 4040. Oregon ORS remains the direct official state-statute adapter, and all 49 non-Oregon states now have exact-citation routing through official or state-backed paths when public sources are available, including targeted Connecticut, Indiana, Maryland, New Hampshire, Alabama, Arkansas, Hawaii, Mississippi, New Mexico, and Tennessee public-records paths.",
            "default": "Brown v. Board of Education"
          },
          "batch_queries": {
            "title": "Additional batch queries",
            "type": "array",
            "description": "Optional list of up to 99 additional queries to run after the primary query using the same search_mode, sources, jurisdiction filters, dates, and result settings. Batches execute sequentially to stay friendlier to public-source quotas. Dataset rows include batch_index so you can group results back to each query.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "search_mode": {
            "title": "Search mode",
            "enum": [
              "all",
              "case_law",
              "legislation",
              "statutes",
              "regulations",
              "dockets",
              "corporate",
              "spending"
            ],
            "type": "string",
            "description": "Choose which legal surface to search. In all mode, exact citations are auto-routed to the most relevant official sources when supported. Statute mode covers federal U.S. Code, official Oregon ORS lookups, and exact-citation state-statute lookups for all 49 non-Oregon states through official or state-backed paths, including targeted Connecticut, Indiana, Maryland, New Hampshire, Alabama, Arkansas, Hawaii, Mississippi, New Mexico, and Tennessee public-records adapters. Broader non-citation state statute discovery still uses the search-backed public statute layer.",
            "default": "all"
          },
          "jurisdictions": {
            "title": "Jurisdictions",
            "type": "array",
            "description": "Optional list of jurisdiction filters. Use state names or abbreviations like or, ak, al, ar, az, ca, co, ct, de, fl, ga, hi, ia, id, il, in, ks, ky, la, ma, md, me, mi, mn, mo, ms, mt, nc, nd, ne, nh, nj, nm, nv, ny, oh, ok, pa, ri, sc, sd, tn, tx, ut, va, vt, wa, wi, wv, wy, or washington for Open States bill queries. Oregon routes to the official ORS adapter, and all 49 non-Oregon states now have exact section-citation routing through official or state-backed paths, including targeted Connecticut, Indiana, Maryland, New Hampshire, Alabama, Arkansas, Hawaii, Mississippi, New Mexico, and Tennessee public-records coverage.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "Optional source override. Leave empty to use the default sources for the selected search mode. Supported values: courtlistener, congress_gov, ecfr, govinfo, federal_register, openstates, oregon_ors, sec_edgar, state_statutes, usaspending, us_code.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "date_from": {
            "title": "Date from",
            "type": "string",
            "description": "Optional start date in YYYY-MM-DD format."
          },
          "date_to": {
            "title": "Date to",
            "type": "string",
            "description": "Optional end date in YYYY-MM-DD format."
          },
          "max_results": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 250,
            "type": "integer",
            "description": "Maximum normalized results to keep after aggregation.",
            "default": 25
          },
          "generate_dossier": {
            "title": "Generate dossier report",
            "type": "boolean",
            "description": "Create AI-ready dossier outputs in the default key-value store. When enabled, LegalHarvest writes both a structured JSON investigation packet and a Markdown briefing that summarizes the retained results, source coverage, highlights, and next steps.",
            "default": false
          },
          "include_full_text": {
            "title": "Include full text",
            "type": "boolean",
            "description": "Request full text where a source supports it.",
            "default": false
          },
          "include_raw": {
            "title": "Include raw source payloads",
            "type": "boolean",
            "description": "Include raw source payloads in normalized results for debugging and schema refinement.",
            "default": false
          },
          "api_data_gov_key": {
            "title": "Data.gov API key",
            "type": "string",
            "description": "Optional bring-your-own API key for Congress.gov and GovInfo. Leave blank to use the actor owner's configured fallback if available."
          },
          "courtlistener_api_token": {
            "title": "CourtListener API token",
            "type": "string",
            "description": "Optional bring-your-own CourtListener token for authenticated CourtListener requests. Leave blank to use the actor owner's configured fallback if available."
          },
          "openstates_api_key": {
            "title": "OpenStates API key",
            "type": "string",
            "description": "Optional bring-your-own OpenStates key for state bill searches. Leave blank to use the actor owner's configured fallback if available."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}