API DOCUMENTATION

DRIVETO PERFORMANCE DATA API // TECHNICAL REFERENCE

← BACK TO UI

Base URL

http://localhost:5001/api
⚡ Performance Note
All data is cached in memory for instant responses. Typical response time: 5-50ms.
📋 OpenAPI Specification
Download the machine-readable API specification: openapi.json
Compatible with Swagger, Postman, and other API tools

Health Check

GET /api/health

Verify API availability and status.

Response Example

JSON
{
  "status": "ok",
  "message": "Driveto API is running"
}

Code Examples

cURL
curl http://localhost:5001/api/health
Python
import requests

response = requests.get('http://localhost:5001/api/health')
data = response.json()
print(data['status'])
JavaScript
fetch('/api/health')
  .then(response => response.json())
  .then(data => console.log(data.status));

Statistics

GET /api/stats

Get comprehensive statistics about the dataset including total variants, models, data sources, and engine type distribution.

Response Example

JSON
{
  "total_products": 311,
  "total_brands": 1,
  "total_models": 298,
  "scrape_date": "2025-12-27T18:47:15.332819",
  "data_sources": {
    "motorizace": 290,
    "products": 21
  },
  "engine_types": {
    "Benzínový": 172,
    "Naftový": 122,
    "Elektrický": 11
  }
}

Products

GET /api/products

Get paginated product list with advanced filtering and sorting capabilities.

Query Parameters

Parameter Type Description
brandoptional string Filter by brand (e.g., "skoda")
modeloptional string Filter by model (partial match, e.g., "octavia")
engine_typeoptional string Filter by engine type (exact match: "Benzínový", "Naftový", "Elektrický")
min_poweroptional number Minimum power in kW
max_poweroptional number Maximum power in kW
transmissionoptional string Filter by transmission (partial match: "Manuální", "Automatická")
drive_typeoptional string Filter by drive type ("4x4", "2WD")
sortoptional string Sort field: power_kw, max_speed, acceleration_0_100, engine_volume, curb_weight_kg, model (default: model)
orderoptional string Sort order: "asc" or "desc" (default: asc)
limitoptional number Results per page (default: 50)
offsetoptional number Pagination offset (default: 0)

Response Structure

JSON
{
  "total": 98,
  "limit": 20,
  "offset": 0,
  "products": [
    {
      "brand": "skoda",
      "model": "octavia-ii-scout-2007-2009-2-0-fsi-110-kw...",
      "variant": "Škoda Octavia (II) Scout 2.0 FSI, 110 kW...",
      "product_url": "https://www.driveto.cz/pages/...",
      "engine_type": "Benzínový",
      "engine_volume": 1984,
      "power_kw": 110,
      "power_hp": 150,
      "torque_nm": 200,
      "max_speed": 202,
      "acceleration_0_100": 9.7,
      "transmission": "Manuální",
      "drive_type": "4x4",
      "consumption_combined": 8.7,
      "length_mm": 4581,
      "width_mm": 1784,
      "height_mm": 1533,
      "curb_weight_kg": 1505
    }
  ]
}

Example Requests

cURL
# Get Octavia models with 100+ kW power
curl "http://localhost:5001/api/products?model=octavia&min_power=100&limit=20"

# Get diesel engines sorted by power
curl "http://localhost:5001/api/products?engine_type=Naftový&sort=power_kw&order=desc"
Python
params = {
    'model': 'octavia',
    'min_power': 100,
    'sort': 'power_kw',
    'order': 'desc'
}
response = requests.get('http://localhost:5001/api/products', params=params)
data = response.json()

for product in data['products']:
    print(f"{product['variant']}: {product['power_kw']} kW")

Compare Products

GET /api/products/compare

Compare multiple products side-by-side by their URLs.

Query Parameters

Parameter Type Description
urlsrequired string Comma-separated list of product URLs to compare

Example Request

cURL
curl "http://localhost:5001/api/products/compare?urls=url1,url2,url3"

Brands

GET /api/brands

Get all available brands with model counts.

Models

GET /api/models

Get all models, optionally filtered by brand.

Query Parameters

Parameter Type Description
brandoptional string Filter models by brand

Engine Types

GET /api/engine-types

Get all engine types with variant counts.

Response Example

JSON
[
  {
    "type": "Benzínový",
    "count": 172
  },
  {
    "type": "Naftový",
    "count": 122
  }
]

Product Data Fields

Complete reference of all available product specification fields:

Field Type Description
brandstringCar brand (e.g., "skoda")
modelstringModel slug with specifications
variantstringHuman-readable variant name
product_urlstringSource URL on Driveto.cz
engine_typestringEngine type (Benzínový, Naftový, Elektrický, etc.)
engine_volumenumberEngine volume in cc
power_kwnumberPower in kilowatts
power_hpnumberPower in horsepower
torque_nmnumberTorque in Newton-meters
max_speednumberMaximum speed in km/h
acceleration_0_100number0-100 km/h acceleration in seconds
transmissionstringTransmission type
drive_typestringDrive type (4x4, 2WD)
euro_standardstringEuro emission standard
consumption_combinednumberCombined consumption in L/100km
consumption_citynumberCity consumption in L/100km
length_mmnumberLength in millimeters
width_mmnumberWidth in millimeters
height_mmnumberHeight in millimeters
wheelbase_mmnumberWheelbase in millimeters
cargo_volume_lnumberCargo volume in liters
curb_weight_kgnumberCurb weight in kilograms
roof_load_kgnumberRoof load capacity in kilograms
seating_capacitynumberNumber of seats