---
title: "Get commodity graph for a commodity tree"
method: GET
path: "/public/v1/network/tree/{commodityTreeId}/commodity-graph"
tags: ["Collections - Network"]
deprecated: true
---

# Get commodity graph for a commodity tree

`GET /public/v1/network/tree/{commodityTreeId}/commodity-graph`

> **Deprecated.**

⚠️ **DEPRECATED** - This endpoint is deprecated and will be removed at the end of December 2026.

**Note**: Responses include a `Sunset` HTTP header (RFC 8594) indicating the removal date.

---

## Migration Required

This endpoint has been replaced by the v2 Network API. Please migrate to the new endpoint:

### Replacement Endpoint

| Old Endpoint | New Endpoint | Purpose |
|--------------|--------------|---------|
| `GET /public/v1/network/tree/{commodityTreeId}/commodity-graph` | `GET /public/v2/network/tree/{commodityTreeId}/commodity-graph` | Get commodity graph for a commodity tree |

---

## Why Migrate?

The v2 Network API provides improvements:

### 1. Enhanced Response Structure
- **v1**: Returns `PublicTreeTargetV1` structure
- **v2**: Returns `PublicTreeTargetV2` structure with additional metadata
- **v2**: Better organized response format

### 2. Improved Consistency
- **v2**: Aligned with other v2 API endpoints
- **v2**: Consistent response structures across network endpoints

### 3. Better Documentation
- Comprehensive examples for all endpoints
- Detailed error response documentation
- Clear parameter descriptions

---

## Quick Migration Guide

### Step 1: Update Endpoint URL

**Before:**
```http
GET /public/v1/network/tree/456/commodity-graph
```

**After:**
```http
GET /public/v2/network/tree/456/commodity-graph
```

### Step 2: Update Response Parsing

**Before:** Parse `PublicTreeTargetV1` structure

**After:** Parse `PublicTreeTargetV2` structure (may have additional fields)

---

## Breaking Changes

1. **Endpoint Path**: Changed from `/public/v1/network/tree/{commodityTreeId}/commodity-graph` to `/public/v2/network/tree/{commodityTreeId}/commodity-graph`
2. **Response Structure**: Returns `PublicTreeTargetV2` instead of `PublicTreeTargetV1` (may have additional fields)

---

**Required Permission**: `ACCESS_PUBLIC_COMMODITY_GRAPH`

**Performance Impact**: High

## Path parameters

- `commodityTreeId` integer, required

## Response `200`

OK

## Other responses

- `403` — 403 Forbidden - Authentication or authorization failure. This status code is returned when: (1) the request lacks valid authentication credentials (missing or invalid X-Auth-Token header), or (2) the authenticated user does not have the required permission to access this resource.
- `429` — 429 Too Many Requests - API rate limit exceeded. The request has been rejected because the rate limit for this endpoint has been exceeded. Default rate limits: GET requests - 100 per 10 seconds, 500 per minute; POST/PUT/PATCH/DELETE requests - 20 per 10 seconds, 100 per minute. For increased access, please contact customer success.
- `500` — 500 Internal Server Error - An unexpected error occurred on the server. The request may or may not have been processed.

---

[API](https://skmtc.net/prewave/apis/public-prewave-api.md) · [All operations](https://skmtc.net/prewave/apis/public-prewave-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/prewave/public-prewave-api/revisions/466169815b78/schema)
