---
title: "Get Page Optimization Detail"
method: GET
path: "/{brand_id}/site-diagnostics/optimization"
tags: ["site-diagnostics"]
---

# Get Page Optimization Detail

`GET /{brand_id}/site-diagnostics/optimization`

Fetch the latest optimization run for one page: a summary of how many content blocks were transformed / enriched / removed, the optimized token total, and every block's before/after content.

By default only **reviewed** runs are returned (`completed`, `staged`, `deployed`, `acknowledged`) — i.e. optimizations a human accepted — not raw unreviewed optimizer output. Pass one or more `status` params to opt into other lifecycle states (e.g. `?status=pending`). Each chunk carries its own `status`, so a `rejected` block (its `after` was not accepted) is distinguishable from an `approved` one. Returns 404 when the page has no run in the requested statuses.

## Path parameters

- `brand_id` integer, required

## Query parameters

- `path` string, required — The page path, e.g. `/about`.
- `status` string[], nullable — Restrict to these run statuses. Default: reviewed runs only.

## Response `200`

Successful Response

- PathOptimization — Endpoint 2 response: a page's latest optimization run with before/after chunks.
  - `path` string, required
  - `status` 'pending' | 'completed' | 'staged' | 'deployed' | 'retired' | 'outdated' | 'acknowledged', required
  - `summary` OptimizationSummary, required — Per-category chunk counts and the optimized token total for a run.
    - `transformed` integer, required
    - `enriched` integer, required
    - `removed` integer, required
    - `tokens_after` integer, required
  - `chunks` OptimizationChunk[]
    - `id` string, required
    - `order` integer, required
    - `category` 'enriched' | 'transformed' | 'removed', nullable
    - `status` 'pending' | 'approved' | 'rejected', nullable
    - `before` ContentNode[]
      - `type` 'html'
      - `text` string, required
    - `after` ContentNode[]
      - `type` 'html'
      - `text` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/scrunchai/apis/scrunch-data-api.md) · [All operations](https://skmtc.net/scrunchai/apis/scrunch-data-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/scrunchai/scrunch-data-api/revisions/c4fe20c603a3/schema)
