---
title: "Get Years"
method: GET
path: "/api/years"
---

# Get Years

`GET /api/years`

## 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/years`
- Auth: none declared

Returns distinct years available for the given brand/model/version slice.

Reads from `mv_car_filters`, the 10-dim pre-aggregated rollup that carries
the `year` dimension. Used by the frontend to populate the Year dropdown
only with years that actually have listings for the current selection.

## Query parameters

- `brand` string
- `brand_id` integer
- `model` string
- `model_id` integer
- `version_id` integer
- `category` string
- `body_style` string, 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)
