https://github.com/minel1410/car-price-predictor-api
An API made for the car price predictor model that serves as a backend for the car price predictor application.
https://github.com/minel1410/car-price-predictor-api
fastapi renderer
Last synced: about 2 months ago
JSON representation
An API made for the car price predictor model that serves as a backend for the car price predictor application.
- Host: GitHub
- URL: https://github.com/minel1410/car-price-predictor-api
- Owner: minel1410
- Created: 2024-08-13T16:36:57.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-27T14:22:13.000Z (almost 2 years ago)
- Last Synced: 2025-10-10T00:09:38.020Z (9 months ago)
- Topics: fastapi, renderer
- Language: Python
- Homepage: https://price-predictor-model-api.onrender.com
- Size: 8.8 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [Car Price Predictor API](https://price-predictor-model-api.onrender.com)
## Note
Since the API is hosted on Renderer, the loading time could take up to 2 minutes on the initial request.
## Overview
The Car Price Predictor API is a backend service developed using FastAPI. It serves as the backend for the Car Price Predictor application, allowing users to submit data about their vehicles and receive price predictions. The API is hosted on Render, which may cause responses to be delayed by a few minutes if the server is in sleep mode due to inactivity.
## Endpoints
### `/models`
- **Method**: `GET`
- **Description**: Retrieves a list of car brands and their associated models.
- **Response Model**: `List[BrandModel]`
- **Response Example**:
```json
[
{
"brand_id": 1,
"models": [
{
"model_id": 101,
"model_name": "Model A",
"brand_name": "Brand X"
},
...
]
},
...
]
## Endpoints
### `/fuel_types`
- **Method**: `GET`
- **Description**: Returns a dictionary of fuel types with their corresponding encoding values.
- **Response Example**:
```json
{
"Benzin": 0,
"Dizel": 1,
"Elektro": 2,
"Hibrid": 3,
"Plin": 4
}
### `/body_types`
- **Method**: `GET`
- **Description**: Provides a dictionary of body types with their corresponding encoding values.
- **Response Example**:
```json
{
"Caddy": 0,
"Kabriolet": 1,
"Karavan": 2,
"Kombi": 3,
"Limuzina": 4,
"Malo auto": 5,
"Monovolumen": 6,
"Off Road": 7,
"Ostalo": 8,
"Pick up": 9,
"SUV": 10,
"Sportski/kupe": 11,
"Terenac": 12
}
### `/post_car`
- **Method**: `POST`
- **Description**: Submits car data to receive a price prediction.
- **Request Model**: `ModelRequest`
- **Request Example**:
```json
{
"Mileage": 120000,
"Engine_volume": 2.0,
"Engine_power": 150,
"Registered": true,
"Year": 2018,
"brand_enc": 1,
"body_enc": 3,
"fuel_type_enc": 1,
"model_enc": 101
}