A web application that provides an interface to search the Brazilian FIPE vehicle price table
3.2K
A web application that provides a user-friendly interface to search the Brazilian FIPE vehicle price table.
References:
It implements a Backend in Go (acting as a proxy to the FIPE data source and serving the Frontend), a simple Frontend using Go HTML Templates, Prometheus metrics, and Docker configurations.
To fulfill the requirement of tracking specific metrics (like "most searched model"), the Backend acts as a BFF (Backend for Frontend) [1] and [2].
templates/index.html) served by Go. It uses Vanilla JS to fetch data from the Go backend.Note: I am using the public API https://parallelum.com.br/fipe/api/v2 for this implementation. It is the community standard for FIPE data in Brazil, is free, requires no API keys, and uses the standard REST structure (Brands > Models > Years).
graph LR
User[Browser] -- "HTTP GET" --> Go["Go Backend (BFF)"]
Go -- "Records Metric" --> Prom[Prometheus Registry]
Go -- "Proxy Request" --> FIPE["FIPE API v2"]
FIPE -- "JSON Data" --> Go
Go -- "JSON Data" --> User
/static/ for better structure and caching./api/priceHistory and frontend UI to show price history for the last 12 months (configurable months)./health endpoint for Kubernetes/Docker probes.The backend exposes the following endpoints:
System Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /health | Returns 200 OK {"status": "ok"} if the app is running. |
GET | /metrics | Exposes data in Prometheus format. |
GET | /static | Exposes static assets. |
Business API (Proxy)
These endpoints proxy requests to https://fipe.parallelum.com.br/api/v2.
| Method | Endpoint | Params (Query String) | Description |
|---|---|---|---|
GET | /api/brands | type (cars, motorcycles, trucks) | Lists vehicle brands. |
GET | /api/models | type, brandId | Lists models for a brand. |
GET | /api/years | type, brandId, modelId | Lists available years for a model. |
GET | /api/price | type, brandId, modelId, yearId | (Critical) Returns the price and increments the search counter metric. |
GET | /api/priceHistory | type, brandId, modelId, yearId | Returns the price history for the last 12 months. |
The application exposes the following Prometheus metrics at /metrics endpoint:
Metric: fipe_http_requests_total:
path: The path of the HTTP request (e.g., /api/brands).method: The HTTP method used (e.g., GET).Metric: fipe_search_stats:
brand_name: Name of the brand (e.g., "Ford").model_name: Name of the model (e.g., "Fiesta 1.6").year_id: The year code (e.g., "2014-1").Metric: fipe_price_min
brand_namemodel_nameyear_idMetric: fipe_price_max
brand_namemodel_nameyear_idMetric: fipe_fuel_count
fuelMetric: fipe_brand_search_count
brand_nameExample:
# HELP fipe_search_stats Counter for specific vehicle searches by brand, model, and year
# TYPE fipe_search_stats counter
fipe_search_stats{brand_name="Audi",model_name="A3 1.8 Turbo 3p",year_id="2004-1"} 1
fipe_search_stats{brand_name="VW - VolksWagen",model_name="GOL 1.0",year_id="2010-1"} 3
Prometheus Query to find the top 5 most searched
topk(5, sum(fipe_search_stats) by (model_name))
Install Docker: https://docs.docker.com/get-started/get-docker/
Run the container
docker run -d -p 8080:8080 --rm --name gofipe aeciopires/gofipe:3.0.0
Access the application:

Install Golang (1.25+): https://go.dev/doc/install
Run the application:
cd app
go mod init gofipe
go run main.go
Access the application at http://localhost:8080.
Requirements:
Run the command.
cd app
make image
Aécio dos Santos Pires
https://linktr.ee/aeciopires
GPL-3.0 2026 Aécio dos Santos Pires
Content type
Image
Digest
sha256:c2a8639b8…
Size
11.7 MB
Last updated
7 months ago
docker pull aeciopires/gofipe