Api documentation

Api documentation

Get Vehicle Details Through VIN Decoding

Spec: VIN Decoding
 
 
v2
 
 

Description

Decode the supplied VIN to its most basic vehicle specs (i.e. make, model, year, style, trim, engine and transmission details.)

Please note that this resource is not a VIN Lookup. Manufacturers can do the VIN lookup on their own vehicles, but since we cover all manufacturers and makes and models, we can reliably look up a vehicle by just its VIN. So what we do is reduce the VIN to a Squish VIN, or VIN prefix, which is basically the first 11 digits of the VIN minus the 9th digit which is a check digit.

URL

  1. https://api.edmunds.com/api/vehicle/v2/vins/{car VIN}?manufactureCode={manufacturer code}&fmt=json&api_key={api key}

Code Example

You need the Javascript SDK to run this example.

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset=utf-8>
  5. <title>Edmunds API Example</title>
  6. </head>
  7. <body>
  8. <div id="results-body"></div>
  9. <script>
  10. window.sdkAsyncInit = function() {
  11. // Instantiate the SDK
  12. var res = new EDMUNDSAPI('YOUR API KEY');
  13. // Optional parameters
  14. var options = {
  15. "manufacturerCode": "3548"
  16. };
  17. // Callback function to be called when the API response is returned
  18. function success(res) {
  19. var body = document.getElementById('results-body');
  20. body.innerHTML = "The car make is: " + res.styleHolder[0].makeName;
  21. }
  22. // Oops, Houston we have a problem!
  23. function fail(data) {
  24. console.log(data);
  25. }
  26. // Fire the API call
  27. res.api('/api/vehicle/v2/vins/4T1BK1EB6DU056165', options, success, fail);
  28. // Additional initialization code such as adding Event Listeners goes here
  29. };
  30. // Load the SDK asynchronously
  31. (function(d, s, id){
  32. var js, sdkjs = d.getElementsByTagName(s)[0];
  33. if (d.getElementById(id)) {return;}
  34. js = d.createElement(s); js.id = id;
  35. js.src = "path/to/sdk/file";
  36. sdkjs.parentNode.insertBefore(js, sdkjs);
  37. }(document, 'script', 'edmunds-jssdk'));
  38. </script>
  39. </body>
  40. </html>