Trims
GET /api/trims/v2
Section titled “GET /api/trims/v2”Returns vehicle trim levels with associated specifications. The demo dataset covers trims sold between 2015–2020. To access the full range from 1900 to today, subscribe and include a valid JWT.
Sample Request
Section titled “Sample Request”curl "https://carapi.app/api/trims/v2?year=2024&make=Honda&model=Civic" \ -H "Authorization: Bearer YOUR_JWT_TOKEN_HERE"const params = new URLSearchParams({ year: '2024', make: 'Honda', model: 'Civic' });
const response = await fetch(`https://carapi.app/api/trims/v2?${params}`, { headers: { 'Authorization': `Bearer ${jwt}` }});
const data = await response.json();console.log('Trims:', data);import requests
headers = { 'Authorization': f'Bearer {jwt}'}
params = { 'year': '2024', 'make': 'Honda', 'model': 'Civic'}
response = requests.get( 'https://carapi.app/api/trims/v2', headers=headers, params=params)
data = response.json()print('Trims:', data)use GuzzleHttp\Client;
$client = new Client();
$response = $client->get('https://carapi.app/api/trims/v2', [ 'headers' => [ 'Authorization' => 'Bearer YOUR_JWT_TOKEN_HERE', ], 'query' => [ 'year' => '2024', 'make' => 'Honda', 'model' => 'Civic', ],]);
$data = json_decode($response->getBody(), true);print_r($data);$url = 'https://carapi.app/api/trims/v2?' . http_build_query([ 'year' => '2024', 'make' => 'Honda', 'model' => 'Civic',]);
$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Authorization: Bearer YOUR_JWT_TOKEN_HERE',]);
$response = curl_exec($ch);curl_close($ch);
$data = json_decode($response, true);print_r($data);Sample Response
Section titled “Sample Response”{ "collection": { "url": "/api/trims/v2?year=2020&make=toyota&model=camry&submodel=le", "count": 2, "pages": 1, "total": 2, "next": "", "prev": "", "first": "/api/trims/v2?year=2020&make=toyota&model=camry&submodel=le", "last": "" }, "data": [ { "id": 8860, "make_id": 22, "model_id": 4779, "submodel_id": 73504, "year": 2020, "make": "Toyota", "model": "Camry", "series": null, "submodel": "LE", "trim": "LE", "description": "LE 4dr Sedan (2.5L 4cyl 8A)", "msrp": 24970, "invoice": 22848, "created": "2023-06-29T21:00:02-04:00", "modified": "2023-06-29T21:00:02-04:00" }, { "id": 8861, "make_id": 22, "model_id": 4779, "submodel_id": 73504, "year": 2020, "make": "Toyota", "model": "Camry", "series": null, "submodel": "LE", "trim": "LE", "description": "LE 4dr Sedan AWD (2.5L 4cyl 8A)", "msrp": 26370, "invoice": 24129, "created": "2023-06-29T21:00:02-04:00", "modified": "2023-06-29T21:00:02-04:00" } ]}Filtering
Section titled “Filtering”curl "https://carapi.app/api/trims/v2?year=2024&make=Honda&model=Civic&json=[{\"field\":\"engines.fuel_type\",\"op\":\"in\",\"val\":[\"Gasoline\",\"Electric\"]}]" \ -H "Authorization: Bearer YOUR_JWT_TOKEN_HERE"const filter = JSON.stringify([ { field: 'engines.fuel_type', op: 'in', val: ['Gasoline', 'Electric'] }]);
const response = await fetch( `https://carapi.app/api/trims/v2?year=2024&make=Honda&model=Civic&json=${encodeURIComponent(filter)}`, { headers: { 'Authorization': `Bearer ${jwt}` } });
const data = await response.json();console.log('Trims:', data);import requestsimport json
headers = { 'Authorization': f'Bearer {jwt}'}
params = { 'year': '2024', 'make': 'Honda', 'model': 'Civic', 'json': json.dumps([ {'field': 'engines.fuel_type', 'op': 'in', 'val': ['Gasoline', 'Electric']} ])}
response = requests.get( 'https://carapi.app/api/trims/v2', headers=headers, params=params)
data = response.json()print('Trims:', data)use GuzzleHttp\Client;
$client = new Client();
$response = $client->get('https://carapi.app/api/trims/v2', [ 'headers' => [ 'Authorization' => 'Bearer YOUR_JWT_TOKEN_HERE', ], 'query' => [ 'year' => '2024', 'make' => 'Honda', 'model' => 'Civic', 'json' => json_encode([ ['field' => 'engines.fuel_type', 'op' => 'in', 'val' => ['Gasoline', 'Electric']], ]), ],]);
$data = json_decode($response->getBody(), true);print_r($data);$filter = json_encode([ ['field' => 'engines.fuel_type', 'op' => 'in', 'val' => ['Gasoline', 'Electric']],]);
$url = 'https://carapi.app/api/trims/v2?' . http_build_query([ 'year' => '2024', 'make' => 'Honda', 'model' => 'Civic', 'json' => $filter,]);
$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Authorization: Bearer YOUR_JWT_TOKEN_HERE',]);
$response = curl_exec($ch);curl_close($ch);
$data = json_decode($response, true);print_r($data);GET /api/trims/v2/{id}
Section titled “GET /api/trims/v2/{id}”Returns all data associated with a single vehicle trim by its ID.
Sample Request
Section titled “Sample Request”curl "https://carapi.app/api/trims/v2/8860" \ -H "Authorization: Bearer YOUR_JWT_TOKEN_HERE"const trimId = 8860;
const response = await fetch(`https://carapi.app/api/trims/v2/${trimId}`, { headers: { 'Authorization': `Bearer ${jwt}` }});
const data = await response.json();console.log('Trim:', data);import requests
trim_id = 8860headers = { 'Authorization': f'Bearer {jwt}'}
response = requests.get( f'https://carapi.app/api/trims/v2/{trim_id}', headers=headers)
data = response.json()print('Trim:', data)use GuzzleHttp\Client;
$trimId = 8860;$client = new Client();
$response = $client->get("https://carapi.app/api/trims/v2/{$trimId}", [ 'headers' => [ 'Authorization' => 'Bearer YOUR_JWT_TOKEN_HERE', ],]);
$data = json_decode($response->getBody(), true);print_r($data);$trimId = 8860;
$ch = curl_init();curl_setopt($ch, CURLOPT_URL, "https://carapi.app/api/trims/v2/{$trimId}");curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Authorization: Bearer YOUR_JWT_TOKEN_HERE',]);
$response = curl_exec($ch);curl_close($ch);
$data = json_decode($response, true);print_r($data);Sample Response
Section titled “Sample Response”{ "id": 8860, "make_id": 22, "model_id": 4779, "submodel_id": 73504, "year": 2020, "make": "Toyota", "model": "Camry", "series": null, "submodel": "LE", "trim": "LE", "description": "LE 4dr Sedan (2.5L 4cyl 8A)", "msrp": 24970, "invoice": 22848, "created": "2023-06-29T21:00:02-04:00", "modified": "2023-06-29T21:00:02-04:00", "bodies": [ { "id": 8860, "make_model_trim_id": 8860, "type": "Sedan", "doors": 4, "length": "192.1", "width": "72.4", "seats": 5, "height": "56.9", "wheel_base": "111.2", "front_track": null, "rear_track": null, "ground_clearance": "5.7", "cargo_capacity": "15.1", "max_cargo_capacity": null, "curb_weight": 3296, "gross_weight": null, "max_payload": null, "max_towing_capacity": null } ], "engines": [ { "id": 8860, "make_model_trim_id": 8860, "engine_type": "gas", "fuel_type": "regular unleaded", "cylinders": "I4", "size": "2.5", "horsepower_hp": 203, "horsepower_rpm": 6600, "torque_ft_lbs": 184, "torque_rpm": 5000, "valves": 16, "valve_timing": "Variable", "cam_type": "Double overhead cam (DOHC)", "created": "2023-06-29T21:00:11-04:00", "modified": "2023-06-29T21:00:11-04:00" } ], "transmissions": [ { "description": "8-speed shiftable automatic" } ], "drive_types": [ { "description": "front wheel drive" } ], "mileages": [ { "id": 8860, "make_model_trim_id": 8860, "fuel_tank_capacity": "15.8", "combined_mpg": 32, "epa_city_mpg": 28, "epa_highway_mpg": 39, "range_city": 442, "range_highway": 616, "battery_capacity_electric": null, "epa_time_to_charge_hr_240v_electric": null, "epa_kwh_100_mi_electric": null, "range_electric": null, "epa_highway_mpg_electric": null, "epa_city_mpg_electric": null, "epa_combined_mpg_electric": null } ], "exterior_colors": [ { "id": 89104, "make_model_trim_id": 8860, "name": "Blue Streak Metallic", "rgb": "0,62,155" }, { "id": 89102, "make_model_trim_id": 8860, "name": "Brownstone", "rgb": "95,85,71" }, { "id": 89099, "make_model_trim_id": 8860, "name": "Celestial Silver Metallic", "rgb": "151,156,160" }, { "id": 89106, "make_model_trim_id": 8860, "name": "Galactic Aqua Mica", "rgb": "37,54,65" }, { "id": 89100, "make_model_trim_id": 8860, "name": "Midnight Black Metallic", "rgb": "23,23,23" }, { "id": 89105, "make_model_trim_id": 8860, "name": "Predawn Gray Mica", "rgb": "93,91,96" }, { "id": 89103, "make_model_trim_id": 8860, "name": "Ruby Flare Pearl", "rgb": "117,3,3" }, { "id": 89101, "make_model_trim_id": 8860, "name": "Super White", "rgb": "250,250,250" } ], "interior_colors": [ { "id": 32172, "make_model_trim_id": 8860, "name": "Ash, cloth", "rgb": "125,124,119" }, { "id": 32170, "make_model_trim_id": 8860, "name": "Black, cloth", "rgb": "0,0,0" }, { "id": 32171, "make_model_trim_id": 8860, "name": "Macadamia, cloth", "rgb": "208,190,166" } ]}GET /api/trims Deprecated
Section titled “GET /api/trims ”Use /api/trims/v2 for all new integrations.
GET /api/trims/{id} Deprecated
Section titled “GET /api/trims/{id} ”Use /api/trims/v2/{id} for all new integrations.