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

# Get Extraction Stats

> GET /patterns/extraction-stats

Population 5C-extraction-completeness aggregate backing the frontend's
C5 bars. Counts over the five TOP-LEVEL `issues` columns named by
FIVE_C_COLUMNS (app/engine/forge/extract.py — concern/cause/context/
consequence/cap), NOT `structured_attrs`. A field "has a value" using
the EXACT same rule as `GET /issues/{id}/extraction`
(non-null AND non-empty-after-strip, via the shared
`normalize_5c_value`) — the two endpoints can never disagree about it.

`extracted` = issues with >=1 of the five fields having a value.
`fields.cN` = fraction (0..1) of EXTRACTED issues having that field —
wire key order is pinned (frontend labels): c1=concern, c2=cause,
c3=context, c4=consequence, c5=correction(<-issues.cap). This is
exactly `FIVE_C_COLUMNS`'s insertion order — never re-derive it.
`failures` = count of `review_items` with item_type='extraction' AND
status='open' (pending review).

Honest-empty: when the workspace has zero extracted issues, returns
`{"status": "no_data"}` (200, not 404 — no-data-yet is not an error;
same convention as GET /predictions/accuracy, predictions.py:400-401).



## OpenAPI

````yaml /openapi.json get /v1/patterns/extraction-stats
openapi: 3.1.0
info:
  description: Causeloop Platform Backend
  title: Causeloop API
  version: 1.0.0
servers: []
security: []
paths:
  /v1/patterns/extraction-stats:
    get:
      tags:
        - patterns
      summary: Get Extraction Stats
      description: |-
        GET /patterns/extraction-stats

        Population 5C-extraction-completeness aggregate backing the frontend's
        C5 bars. Counts over the five TOP-LEVEL `issues` columns named by
        FIVE_C_COLUMNS (app/engine/forge/extract.py — concern/cause/context/
        consequence/cap), NOT `structured_attrs`. A field "has a value" using
        the EXACT same rule as `GET /issues/{id}/extraction`
        (non-null AND non-empty-after-strip, via the shared
        `normalize_5c_value`) — the two endpoints can never disagree about it.

        `extracted` = issues with >=1 of the five fields having a value.
        `fields.cN` = fraction (0..1) of EXTRACTED issues having that field —
        wire key order is pinned (frontend labels): c1=concern, c2=cause,
        c3=context, c4=consequence, c5=correction(<-issues.cap). This is
        exactly `FIVE_C_COLUMNS`'s insertion order — never re-derive it.
        `failures` = count of `review_items` with item_type='extraction' AND
        status='open' (pending review).

        Honest-empty: when the workspace has zero extracted issues, returns
        `{"status": "no_data"}` (200, not 404 — no-data-yet is not an error;
        same convention as GET /predictions/accuracy, predictions.py:400-401).
      operationId: get_extraction_stats_v1_patterns_extraction_stats_get
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: true
                title: Response Get Extraction Stats V1 Patterns Extraction Stats Get
                type: object
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http

````