---
title: "Get Years"
method: GET
path: "/api/calculator/years"
tags: ["calculator"]
---

# Get Years

`GET /api/calculator/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/calculator/years`
- Auth: none declared

Available years for the current selection.

With a brand AND model, returns year/fuel COMBINATIONS — the fuel variant is
part of what identifies a FIPE row, so /evaluate needs it. That is the code
format "2020-Gasolina".

With neither, returns PLAIN years ("2020"), so the control can be used as a
filter before anything else is picked. The frontend tells the two apart by
whether the code contains a "-", and only enables the lookup once it holds a
full combination.

## Query parameters

- `brand_code` string, nullable
- `model_code` 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)
