---
title: "Get Versions"
method: GET
path: "/api/versions"
---

# Get Versions

`GET /api/versions`

## Request

- Base URL: `https://pegarex.com.br` (the document declares no server; this is the origin it was published from)
- URL: `https://pegarex.com.br/api/versions`
- Auth: none declared

Returns distinct versions for a model filtered by category and optionally
body_style and a year range.

When a year filter is supplied, we read from `mv_car_filters` (10-dim rollup
that has the `year` column) so the version list reflects exactly the years
the user has selected. Without a year filter, we keep the original
`mv_car_metadata` path (smaller, faster) for parity with the old behavior.

## Query parameters

- `brand` string
- `model` string
- `model_id` integer
- `category` string
- `body_style` string, nullable
- `year_min` integer, nullable
- `year_max` integer, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/pegarex/apis/pegarex-api.md) · [All operations](https://skmtc.dev/pegarex/apis/pegarex-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pegarex/apis/pegarex-api/revisions/8c789c9bd72d?raw)
