Sub Models
GET /api/submodels/v2
Section titled “GET /api/submodels/v2”Returns vehicle sub-models (e.g. Sport, Limited, XLT) for cars, trucks, vans, and SUVs. The demo dataset covers sub-models 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/submodels/v2?year=2024&make=Toyota&model=Tacoma" \ -H "Authorization: Bearer YOUR_JWT_TOKEN_HERE"const params = new URLSearchParams({ year: '2024', make: 'Toyota', model: 'Tacoma' });
const response = await fetch(`https://carapi.app/api/submodels/v2?${params}`, { headers: { 'Authorization': `Bearer ${jwt}` }});
const data = await response.json();console.log('Sub Models:', data);import requests
headers = { 'Authorization': f'Bearer {jwt}'}
params = { 'year': '2024', 'make': 'Toyota', 'model': 'Tacoma'}
response = requests.get( 'https://carapi.app/api/submodels/v2', headers=headers, params=params)
data = response.json()print('Sub Models:', data)use GuzzleHttp\Client;
$client = new Client();
$response = $client->get('https://carapi.app/api/submodels/v2', [ 'headers' => [ 'Authorization' => 'Bearer YOUR_JWT_TOKEN_HERE', ], 'query' => [ 'year' => '2024', 'make' => 'Toyota', 'model' => 'Tacoma', ],]);
$data = json_decode($response->getBody(), true);print_r($data);$url = 'https://carapi.app/api/submodels/v2?' . http_build_query([ 'year' => '2024', 'make' => 'Toyota', 'model' => 'Tacoma',]);
$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/submodels/v2?year=2024&make=toyota&model=tacoma", "count": 8, "pages": 1, "total": 8, "next": "", "prev": "", "first": "/api/submodels/v2?year=2024&make=toyota&model=tacoma", "last": "" }, "data": [ { "id": 80735, "oem_make_model_id": 5688, "year": 2024, "make": "Toyota", "model": "Tacoma", "submodel": "Limited" }, { "id": 80736, "oem_make_model_id": 5688, "year": 2024, "make": "Toyota", "model": "Tacoma", "submodel": "SR" }, { "id": 80737, "oem_make_model_id": 5688, "year": 2024, "make": "Toyota", "model": "Tacoma", "submodel": "SR5" }, { "id": 80738, "oem_make_model_id": 5688, "year": 2024, "make": "Toyota", "model": "Tacoma", "submodel": "TRD Off-Road" }, { "id": 80739, "oem_make_model_id": 5688, "year": 2024, "make": "Toyota", "model": "Tacoma", "submodel": "TRD PreRunner" }, { "id": 80740, "oem_make_model_id": 5688, "year": 2024, "make": "Toyota", "model": "Tacoma", "submodel": "TRD Pro" }, { "id": 80741, "oem_make_model_id": 5688, "year": 2024, "make": "Toyota", "model": "Tacoma", "submodel": "TRD Sport" }, { "id": 80742, "oem_make_model_id": 5688, "year": 2024, "make": "Toyota", "model": "Tacoma", "submodel": "Trailhunter" } ]}Filtering
Section titled “Filtering”curl "https://carapi.app/api/submodels/v2?year=2024&json=[{\"field\":\"make\",\"op\":\"in\",\"val\":[\"Ford\",\"Acura\"]}]" \ -H "Authorization: Bearer YOUR_JWT_TOKEN_HERE"const filter = JSON.stringify([ { field: 'make', op: 'in', val: ['Ford', 'Acura'] }]);
const response = await fetch( `https://carapi.app/api/submodels/v2?year=2024&json=${encodeURIComponent(filter)}`, { headers: { 'Authorization': `Bearer ${jwt}` } });
const data = await response.json();console.log('Sub Models:', data);import requestsimport json
headers = { 'Authorization': f'Bearer {jwt}'}
params = { 'year': '2024', 'json': json.dumps([ {'field': 'make', 'op': 'in', 'val': ['Ford', 'Acura']} ])}
response = requests.get( 'https://carapi.app/api/submodels/v2', headers=headers, params=params)
data = response.json()print('Sub Models:', data)use GuzzleHttp\Client;
$client = new Client();
$response = $client->get('https://carapi.app/api/submodels/v2', [ 'headers' => [ 'Authorization' => 'Bearer YOUR_JWT_TOKEN_HERE', ], 'query' => [ 'year' => '2024', 'json' => json_encode([ ['field' => 'make', 'op' => 'in', 'val' => ['Ford', 'Acura']], ]), ],]);
$data = json_decode($response->getBody(), true);print_r($data);$filter = json_encode([ ['field' => 'make', 'op' => 'in', 'val' => ['Ford', 'Acura']],]);
$url = 'https://carapi.app/api/submodels/v2?' . http_build_query(['year' => '2024', '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);