> ## Documentation Index
> Fetch the complete documentation index at: https://docs.case.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# SEC Filings

> Search EDGAR full-text filings and fetch per-entity SEC filing history

Search SEC EDGAR filings with a single legal research primitive. `legal.secFiling()` supports both full-text filing search via `efts.sec.gov` and structured company filing history via `data.sec.gov`.

```bash title="Endpoint" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
POST /legal/v1/sec-filing
```

## Full-text filing search

Use `type: 'search'` to search across the text of filings and exhibits.

<CodeGroup>
  ```bash title="cURL" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
  curl -X POST https://api.case.dev/legal/v1/sec-filing \
    -H "Authorization: Bearer $CASEDEV_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "search",
      "query": "\"material weakness\" internal controls",
      "formTypes": ["10-K", "10-Q"],
      "ticker": "AAPL",
      "dateAfter": "2020-01-01",
      "dateBefore": "2025-01-01",
      "limit": 10,
      "offset": 0
    }'
  ```

  ```bash title="CLI" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
  casedev legal:v1 sec-filing \
    --type search \
    --query '"material weakness" internal controls' \
    --form-type 10-K \
    --form-type 10-Q \
    --ticker AAPL \
    --date-after 2020-01-01 \
    --date-before 2025-01-01 \
    --limit 10 \
    --offset 0
  ```

  ```typescript title="Typescript" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
  const result = await client.legal.secFiling({
    type: 'search',
    query: '"material weakness" internal controls',
    formTypes: ['10-K', '10-Q'],
    ticker: 'AAPL',
    dateAfter: '2020-01-01',
    dateBefore: '2025-01-01',
    limit: 10,
    offset: 0,
  });

  console.log(result.total);
  console.log(result.filings[0].snippet);
  console.log(result.filings[0].documents[0].url);
  ```

  ```python title="Python" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
  result = client.legal.v1.sec_filing(
      type='search',
      query='"material weakness" internal controls',
      form_types=['10-K', '10-Q'],
      ticker='AAPL',
      date_after='2020-01-01',
      date_before='2025-01-01',
      limit=10,
      offset=0,
  )

  print(result.total)
  print(result.filings[0].snippet)
  print(result.filings[0].documents[0].url)
  ```

  ```go title="Go" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
  result, _ := client.Legal.V1.SecFiling(ctx, casedev.LegalV1SecFilingParams{
      Type:       casedev.F(casedev.LegalV1SecFilingParamsTypeSearch),
      Query:      casedev.F("\"material weakness\" internal controls"),
      FormTypes:  casedev.F([]string{"10-K", "10-Q"}),
      Ticker:     casedev.F("AAPL"),
      DateAfter:  casedev.F("2020-01-01"),
      DateBefore: casedev.F("2025-01-01"),
      Limit:      casedev.F(int64(10)),
      Offset:     casedev.F(int64(0)),
  })
  ```
</CodeGroup>

## Entity filing history

Use `type: 'entity'` when you already know the filer by CIK or ticker.

<CodeGroup>
  ```bash title="cURL" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
  curl -X POST https://api.case.dev/legal/v1/sec-filing \
    -H "Authorization: Bearer $CASEDEV_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "entity",
      "ticker": "AAPL",
      "formTypes": ["10-K", "8-K"],
      "dateAfter": "2022-01-01",
      "limit": 20,
      "offset": 0
    }'
  ```

  ```bash title="CLI" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
  casedev legal:v1 sec-filing \
    --type entity \
    --ticker AAPL \
    --form-type 10-K \
    --form-type 8-K \
    --date-after 2022-01-01 \
    --limit 20 \
    --offset 0
  ```

  ```typescript title="Typescript" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
  const result = await client.legal.secFiling({
    type: 'entity',
    ticker: 'AAPL',
    formTypes: ['10-K', '8-K'],
    dateAfter: '2022-01-01',
    limit: 20,
    offset: 0,
  });

  console.log(result.cik);
  console.log(result.filings[0].secUrl);
  ```

  ```python title="Python" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
  result = client.legal.v1.sec_filing(
      type='entity',
      ticker='AAPL',
      form_types=['10-K', '8-K'],
      date_after='2022-01-01',
      limit=20,
      offset=0,
  )

  print(result.cik)
  print(result.filings[0].sec_url)
  ```

  ```go title="Go" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
  result, _ := client.Legal.V1.SecFiling(ctx, casedev.LegalV1SecFilingParams{
      Type:      casedev.F(casedev.LegalV1SecFilingParamsTypeEntity),
      Ticker:    casedev.F("AAPL"),
      FormTypes: casedev.F([]string{"10-K", "8-K"}),
      DateAfter: casedev.F("2022-01-01"),
      Limit:     casedev.F(int64(20)),
      Offset:    casedev.F(int64(0)),
  })
  ```
</CodeGroup>

## Response fields

* `total`: total filings matching the request
* `filings[].accessionNumber`: SEC accession number for the filing
* `filings[].documents[]`: direct `sec.gov/Archives` URLs for the matched or primary filing document
* `filings[].snippet`: highlighted text excerpt from the SEC full-text search result; `null` for `type: 'entity'`
* `filings[].secUrl`: canonical EDGAR filing index page

## Notes

* `type: 'search'` uses SEC full-text search and supports boolean queries, phrases, and exhibit matches.
* `type: 'entity'` uses the filer submissions API and resolves tickers to CIKs automatically.
* `formTypes` passes through directly to the SEC APIs; no restricted enum is enforced.
* `limit` is capped at `100` and `offset` uses standard offset pagination.
* This endpoint is free and uses only SEC-operated infrastructure.
