Retrieve all available vehicle type classifications in the system. Each type includes region-specific information and can be used when creating vehicles in your fleet.
Reference Data: This endpoint returns standardized vehicle type classifications used across the platform. Use the vehicle type IDs returned here when creating vehicles with the unknown_vehicle_id parameter.
Retrieve available types before creating a vehicle:
Copy
def get_all_vehicle_types(): """Get all available vehicle types""" response = requests.get( "https://api.dcycle.io/v1/unknown-vehicles", headers=headers ) return response.json()# Get all typesall_types = get_all_vehicle_types()print(f"Available vehicle types: {len(all_types)}")# Find a specific typevan = next(v for v in all_types if v['type'] == 'van')print(f"Van ID: {van['id']}")
def get_vehicle_types_by_country(country_code): """Get vehicle types for a specific country""" response = requests.get( "https://api.dcycle.io/v1/unknown-vehicles", headers=headers ) vehicles = response.json() country_vehicles = [v for v in vehicles if v['country'] == country_code] return country_vehicles# Get vehicle types for Spainspain_vehicles = get_vehicle_types_by_country("ES")print("Available vehicle types in Spain:")for v in spain_vehicles: print(f" - {v['type']}")