Api documentation

Api documentation

Get Letter Grade Rating by Car Make/Model/Year

Content: Letter Grade Rating
 
 
v2
 
 

Description

Get the Edmunds.com Letter Grade Car Rating by the car Make/Model/Year information.

URL

  1. https://api.edmunds.com/api/vehicle/v2/grade/{make}/{model}/{year}?submodel={submodel}&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. "submodel": "Sedan"
  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 style name for this vehicle is: " + res.style;
  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/grade/honda/accord/2013', 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>