Api documentation

Api documentation

Get Style Details for a Car Make/Model/Year

Spec Model/Year
 
 
v3 v2
 
 

Description

Get the style details for a specific car make/mode/year.

URL

  1. http://api.edmunds.com/api/vehicle/v2/{make}/{model}/{year}?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>Get models and model/year IDs for the 2011 Lexus RX-350</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. // Callback function to be called when the API response is returned
  16. function success(res) {
  17. var body = document.getElementById('results-body');
  18. body.innerHTML = "The first style for the 2011 Lexus RX-350 " +
  19. res.styles[0].name;
  20. }
  21. // Oops, Houston we have a problem!
  22. function fail(data) {
  23. console.log(data);
  24. }
  25. // Fire the API call
  26. res.api('/api/vehicle/v2/lexus/rx350/2011', options, success, fail);
  27. // Additional initialization code such as adding Event Listeners goes here
  28. };
  29. // Load the SDK asynchronously
  30. (function(d, s, id){
  31. var js, sdkjs = d.getElementsByTagName(s)[0];
  32. if (d.getElementById(id)) {return;}
  33. js = d.createElement(s); js.id = id;
  34. js.src = "path/to/sdk/file";
  35. sdkjs.parentNode.insertBefore(js, sdkjs);
  36. }(document, 'script', 'edmunds-jssdk'));
  37. </script>
  38. </body>
  39. </html>