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

# Get layer result

> Returns the incremental analysis result for a specific BFS depth layer, including the cumulative graph and detected patterns.

Each layer represents one level of depth in the BFS (breadth-first search) graph traversal. Layer 0 is the root address, layer 1 includes its direct counterparties, layer 2 their counterparties, and so on.

## Request

```bash theme={null}
curl https://api.wavynode.com/v1/analysis/{analysisId}/layers/{layer} \
  -H "x-api-key: ApiKey wavy_..."
```

### Path parameters

| Parameter    | Type          | Description                              |
| ------------ | ------------- | ---------------------------------------- |
| `analysisId` | string (uuid) | The analysis ID from the tracker service |
| `layer`      | integer       | The BFS depth level to fetch (0-based)   |

## Response — completed layer

```json theme={null}
{
  "success": true,
  "data": {
    "analysisId": "2912b99e-ddb7-41bf-af29-fa0136361bf7",
    "layer": 1,
    "status": "completed",
    "riskScore": 46,
    "isProvisional": true,
    "totalLayers": 7,
    "detectedPatterns": [
      {
        "patternType": "high_value_transfers",
        "confidence": 0.85,
        "severity": "medium",
        "description": "Multiple high-value transfers detected"
      }
    ],
    "newPatterns": [
      {
        "patternType": "high_value_transfers",
        "confidence": 0.85,
        "severity": "medium",
        "description": "Multiple high-value transfers detected"
      }
    ],
    "removedPatterns": [],
    "cumulativeGraph": {
      "rootAddress": "0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503",
      "nodes": { "0x47ac...": { "address": "0x47ac...", "type": "eoa" } },
      "edges": [{ "from": "0x47ac...", "to": "0xabcd...", "value": "1000000000" }],
      "metadata": { "totalNodes": 15, "totalEdges": 42 }
    },
    "newNodes": { "0xabcd...": { "address": "0xabcd...", "type": "eoa" } },
    "newEdges": [{ "from": "0x47ac...", "to": "0xabcd...", "value": "1000000000" }],
    "layerMetadata": {
      "processingTimeMs": 2340,
      "nodeCount": 15,
      "edgeCount": 42,
      "newNodeCount": 12,
      "newEdgeCount": 38,
      "errorCount": 0,
      "patternDetectionTimeMs": 180,
      "timestamp": "2026-04-29T16:22:32.000Z"
    }
  }
}
```

## Response — pending layer

If the requested layer hasn't been processed yet:

```json theme={null}
{
  "success": true,
  "data": {
    "analysisId": "2912b99e-ddb7-41bf-af29-fa0136361bf7",
    "layer": 5,
    "status": "pending",
    "totalLayers": 7
  }
}
```

### Response fields

| Field              | Type    | Description                                                    |
| ------------------ | ------- | -------------------------------------------------------------- |
| `analysisId`       | string  | The analysis identifier                                        |
| `layer`            | integer | The BFS depth level                                            |
| `status`           | string  | `completed`, `pending`, or `failed`                            |
| `riskScore`        | number  | Provisional risk score at this depth (0–100)                   |
| `isProvisional`    | boolean | `true` for all layers except the final one                     |
| `totalLayers`      | integer | Maximum depth (for progress calculation)                       |
| `detectedPatterns` | array   | All patterns detected in the cumulative graph up to this layer |
| `newPatterns`      | array   | Patterns first detected at this layer                          |
| `removedPatterns`  | array   | Patterns from the previous layer no longer detected            |
| `cumulativeGraph`  | object  | Full transaction graph from root to this depth                 |
| `newNodes`         | object  | Nodes added at this layer                                      |
| `newEdges`         | array   | Edges added at this layer                                      |
| `layerMetadata`    | object  | Processing statistics for this layer                           |

<Warning>
  The `layer` parameter is **0-based**. Layer 0 is the root address analysis. If `maxDepth` is 7, valid layers are 0 through 6.
</Warning>

## Caching

Completed layers are immutable. The API returns `Cache-Control: public, max-age=3600` for completed layers, so clients can safely cache them. Pending layers return `Cache-Control: no-cache`.

## Pattern diffing

Each layer includes `newPatterns` and `removedPatterns` relative to the previous layer. This enables incremental UI updates — you can highlight newly detected patterns without re-processing the entire list.

| Layer | Detected | New | Removed | Interpretation                                   |
| ----- | -------- | --- | ------- | ------------------------------------------------ |
| 0     | 0        | 0   | 0       | Root address only, no patterns yet               |
| 1     | 1        | 1   | 0       | First pattern detected at depth 1                |
| 2     | 2        | 1   | 0       | Additional pattern found at depth 2              |
| 3     | 1        | 0   | 1       | One pattern no longer detected with more context |
