---
title: "⚖️ Compare Market Segments - Segment Analysis"
method: GET
path: "/steam/api/market-index/cs2/compare"
tags: ["Market Index"]
---

# ⚖️ Compare Market Segments - Segment Analysis

`GET /steam/api/market-index/cs2/compare`

## Request

- Base URL: `https://www.steamwebapi.com`
- URL: `https://www.steamwebapi.com/steam/api/market-index/cs2/compare`
- Auth: API key in query parameter `key`

Baseurl: https://www.steamwebapi.com/steam/api/market-index/cs2/compare?type=rarity&key=YOUR_API_KEY

    💬 **What this endpoint does:**
    - Compares market segments by a specific metric.
    - Returns sorted list with values and percentages.
    - Ideal for pie charts, ranking tables, or market analysis.

    🛠️ **Features:**
    - Compare by different metrics: price_index, turnover, sold24h, avg_price, listing_value, order_book_value.
    - Filter specific segments using `keys` parameter (comma-separated).
    - Results sorted by value in descending order.

    🌐 **How to use:**
    - Specify `type` parameter (required): item_group, rarity, wear, quality, stattrak, collection.
    - Optionally filter with `keys`: `?type=item_group&keys=knife,glove,rifle`.
    - Change metric: `?type=wear&metric=turnover`.

    📊 **Use Cases:**
    - Market share analysis by rarity or item type.
    - Compare trading volumes across different wears.
    - Identify top-performing market segments.

## Query parameters

- `type` 'item_group' | 'rarity' | 'wear' | 'quality' | 'stattrak' | 'collection', required
- `keys` string
- `metric` 'price_index' | 'turnover' | 'sold24h' | 'avg_price' | 'listing_value' | 'order_book_value'
- `format` string
- `pretty` '0' | '1'

## Response `200`

Segment comparison

- unknown

## Other responses

- `400`: Missing type parameter

---

[API](https://skmtc.dev/steamwebapi/apis/steamwebapi-com-third-party-steam-market-api-documentation.md) · [All operations](https://skmtc.dev/steamwebapi/apis/steamwebapi-com-third-party-steam-market-api-documentation/llms.txt) · [OpenAPI document](https://skmtc.dev/steamwebapi/apis/steamwebapi-com-third-party-steam-market-api-documentation/revisions/f9a4109cbda6?raw)
