8
8
Vehicle Information API is an API system for retrieving vehicle information to include, vehicle year, make, model, trim, transmission, engine and logos for vehicle makes.
9
9
For more information on this service or to subscribe, please visit [ Vehicle Information API] ( https://vehapi.com )
10
10
11
+ > NOTE: This package currently only works to retrieve vehicle data from our API, it will not work to retrieve ANY data from our MOTO API endpoints.
12
+ > We will be adding that ability in a future release.
13
+
11
14
## Installation
12
15
13
16
You can install the package via composer:
@@ -59,11 +62,11 @@ $vehYears = json_encode(LaravelVehapi::getAllYears($sort));
59
62
Let's get all the distinct years for all the makes available
60
63
``` php
61
64
/**
62
- * @param $minYear - required
63
- * @param $maxYear - required
65
+ * @param int $minYear - required
66
+ * @param int $maxYear - required
64
67
* @param string $sort - optional, defaults to 'asc'
65
68
*/
66
- LaravelVehapi::getYearsRange($minYear, $maxYear, $sort = 'asc');
69
+ LaravelVehapi::getYearsRange(int $minYear, int $maxYear, $sort = 'asc');
67
70
68
71
// Returns associative array
69
72
$vehYears = LaravelVehapi::getYearsRange('2010', '2014', 'desc');
@@ -72,21 +75,146 @@ $vehYears = LaravelVehapi::getYearsRange('2010', '2014', 'desc');
72
75
$vehYears = json_encode(LaravelVehapi::getYearsRange('2010', '2014', 'desc'));
73
76
```
74
77
75
- ### Changelog
78
+ Let's get all the distinct makes available
79
+ ``` php
80
+ /**
81
+ * @param string $sort - optional, defaults to 'asc'
82
+ */
83
+ LaravelVehapi::getAllMakes($sort = 'asc');
76
84
77
- Please see [ CHANGELOG] ( CHANGELOG.md ) for more information what has changed recently.
85
+ // Returns associative array
86
+ $vehMakes = LaravelVehapi::getAllMakes();
87
+
88
+ // Convert array to json format
89
+ $vehMakes = json_encode(LaravelVehapi::getAllMakes());
90
+ ```
91
+
92
+ Let's get all the distinct makes available for a specific year
93
+ ``` php
94
+ /**
95
+ * @param int $year - required
96
+ * @param string $sort - optional, defaults to 'asc'
97
+ */
98
+ LaravelVehapi::getMakesByYear($year, $sort = 'asc');
99
+
100
+ // Returns associative array
101
+ $vehMakes = LaravelVehapi::getMakesByYear(2015);
102
+
103
+ // Convert array to json format
104
+ $vehMakes = json_encode(LaravelVehapi::getMakesByYear(2015));
105
+ ```
106
+
107
+ Let's get all the distinct makes available for a specific year range
108
+ ``` php
109
+ /**
110
+ * @param int $minYear - required
111
+ * @param int $maxYear - required
112
+ * @param string $sort - optional, defaults to 'asc'
113
+ */
114
+ LaravelVehapi::getMakesByYearsRange($minYear, $maxYear, $sort = 'asc');
115
+
116
+ // Returns associative array
117
+ $vehMakes = LaravelVehapi::getMakesByYear(2015);
118
+
119
+ // Convert array to json format
120
+ $vehMakes = json_encode(LaravelVehapi::getMakesByYear(2015));
121
+ ```
122
+
123
+ Let's get all the models available for a specific make
124
+ ``` php
125
+ /**
126
+ * @param string $make - required
127
+ * @param string $sort - optional, defaults to 'asc'
128
+ */
129
+ LaravelVehapi::getAllModelsByMake($make, $sort = 'asc');
130
+
131
+ // Returns associative array
132
+ $vehModels = LaravelVehapi::getAllModelsByMake('Acura');
133
+
134
+ // Convert array to json format
135
+ $vehModels = json_encode(LaravelVehapi::getAllModelsByMake('Acura'));
136
+ ```
137
+
138
+ Let's get all the models available for a specific year & make
139
+ ``` php
140
+ /**
141
+ * @param int $year - required
142
+ * @param string $make - required
143
+ * @param string $sort - optional, defaults to 'asc'
144
+ */
145
+ LaravelVehapi::getModelsByYearAndMake($year, $make, $sort = 'asc');
146
+
147
+ // Returns associative array
148
+ $vehModels = LaravelVehapi::getModelsByYearAndMake(2015, 'Acura');
149
+
150
+ // Convert array to json format
151
+ $vehModels = json_encode(LaravelVehapi::getModelsByYearAndMake(2015, 'Acura'));
152
+ ```
153
+
154
+ Let's get all the trims levels available for a specific year, make & model
155
+ ``` php
156
+ /**
157
+ * @param int $year - required
158
+ * @param string $make - required
159
+ * @param string $model - required
160
+ */
161
+ LaravelVehapi::getTrimsByYearMakeAndModel($year, $make, $model);
162
+
163
+ // Returns associative array
164
+ $vehTrims = LaravelVehapi::getTrimsByYearMakeAndModel(2015, 'Acura', 'MDX');
165
+
166
+ // Convert array to json format
167
+ $vehTrims = json_encode(LaravelVehapi::getTrimsByYearMakeAndModel(2015, 'Acura', 'MDX'));
168
+ ```
78
169
79
- ## Contributing
170
+ Let's get all the transmissions available for a specific year, make, model & trim
171
+ ``` php
172
+ /**
173
+ * @param int $year - required
174
+ * @param string $make - required
175
+ * @param string $model - required
176
+ * @param string $trim - required
177
+ */
178
+ LaravelVehapi::getTransmissionsByYearMakeModelAndTrim($year, $make, $model, $trim);
179
+
180
+ // Returns associative array
181
+ $vehTransmissions = LaravelVehapi::getTransmissionsByYearMakeModelAndTrim(2015, 'Acura', 'MDX', 'FWD');
182
+
183
+ // Convert array to json format
184
+ $vehTransmissions = json_encode(LaravelVehapi::getTransmissionsByYearMakeModelAndTrim(2015, 'Acura', 'MDX', 'FWD'));
185
+ ```
186
+
187
+ Let's get all the engines available for a specific year, make, model, trim & transmission
188
+ ``` php
189
+ /**
190
+ * @param int $year - required
191
+ * @param string $make - required
192
+ * @param string $model - required
193
+ * @param string $trim - required
194
+ * @param string $transmission - required
195
+ */
196
+ LaravelVehapi::getEnginesByYearMakeModelTrimAndTransmission($year, $make, $model, $trim, $transmission);
197
+
198
+ // Returns associative array
199
+ $vehEngines = LaravelVehapi::getEnginesByYearMakeModelTrimAndTransmission(2015, 'Acura', 'MDX', 'FWD', '6-Speed Automatic');
200
+
201
+ // Convert array to json format
202
+ $vehEngines = json_encode(LaravelVehapi::getEnginesByYearMakeModelTrimAndTransmission(2015, 'Acura', 'MDX', 'FWD', '6-Speed Automatic'));
203
+ ```
80
204
81
- Please see [ CONTRIBUTING] ( CONTRIBUTING.md ) for details.
205
+ ### Changelog
206
+
207
+ Please see [ CHANGELOG] ( CHANGELOG.md ) for more information what has changed recently.
82
208
209
+ ### API Documentation
210
+ For a complete list of available API endpoints, visit [ API documentation] ( https://documenter.getpostman.com/view/185623/TVYM5c17 )
83
211
### Security
84
212
85
213
If you discover any security related issues, please email
[email protected] instead of using the issue tracker.
86
214
87
215
## Credits
88
216
89
- - [ RJ ] ( https://github.com/codebyray )
217
+ - [ CodebyRay ] ( https://github.com/codebyray )
90
218
- [ All Contributors] ( ../../contributors )
91
219
92
220
## License
0 commit comments