# How to Map CS2 Defindex and Paint Index to Market Hash Name

`GET /v1/schema` lets you narrow an item by `def_index` and `paint_index`, but that pair usually does not identify one tradable market row. You must still resolve exterior, StatTrak or Souvenir state, and any phase variant.

Use the full `market_hash_name` only after those attributes agree.

## Understand what each index identifies

`def_index` identifies the underlying weapon or item definition. `paint_index` identifies a paint kit. The same paint kit can appear on several weapons, and one weapon-paint combination can have several wear and edition rows.

Treat the pair as a candidate filter:

1. Match `def_index`.
2. Match `paint_index` where the row exposes it.
3. Select the exact exterior.
4. Select normal, StatTrak, or Souvenir state.
5. Resolve any nested phase or specialty variant.
6. Return the schema's exact `market_hash_name`.

If more than one candidate remains, the input is incomplete. Do not choose the first row.

## Account for Doppler variants

Base Doppler and Gamma Doppler rows can intentionally omit `paint_index`. Their nested phase records carry the phase-specific paint identity.

Search both top-level rows and documented variants. Keep the parent market name beside the phase label so a phase does not lose its weapon, exterior, or edition context.

This is especially important when the same phase paint index appears across multiple knife or glove families.

## Preserve one-to-many results

A paint index alone can map to many names. Even the `def_index` and `paint_index` pair can map to several wear states. Return a candidate set when exterior or edition is unknown.

A useful result includes:

- exact `market_hash_name`;
- `def_index` and `paint_index`;
- exterior;
- StatTrak and Souvenir state;
- parent and variant identity when applicable;
- schema `generation_id`.

## Keep the resolver current

The schema is available on all plans, supports ETag validation, and is cached for one hour. Store `generation_id` with derived mappings and rebuild them when that generation changes.

For the paint-only view, see [map a CS2 paint index to skin names](/resources/how-to-map-cs2-paint-index-to-skin-name). To enumerate the wear candidates after resolving a finish, use [every wear for a CS2 skin](/resources/how-to-get-every-wear-for-cs2-skin).
