Api documentation

Api documentation

Spec: Style

Spec: Style
 
 
v3 v2
 
 

Description

Get style details based on different filters.

URL

  1. http://api.edmunds.com/api/vehicle/v3/styles?makeNiceName={makeNiceName}&modelNiceName={modelNiceName}&api_key={api key}&pageNum={pageNum}&pageSize={pageSize}

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 A List of Styles for the Honda Civic</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. "makeNiceName": "honda",
  16. "modelNiceName": "civic",
  17. "pagenum": 1,
  18. "pagesize": 10
  19. };
  20. // Callback function to be called when the API response is returned
  21. function success(res) {
  22. var body = document.getElementById('results-body');
  23. body.innerHTML = "The first style id for Honda Civic is " +
  24. res.results[0].id;
  25. }
  26. // Oops, Houston we have a problem!
  27. function fail(data) {
  28. console.log(data);
  29. }
  30. // Fire the API call
  31. res.api('/api/vehicle/v3/styles', options, success, fail);
  32. // Additional initialization code such as adding Event Listeners goes here
  33. };
  34. // Load the SDK asynchronously
  35. (function(d, s, id){
  36. var js, sdkjs = d.getElementsByTagName(s)[0];
  37. if (d.getElementById(id)) {return;}
  38. js = d.createElement(s); js.id = id;
  39. js.src = "path/to/sdk/file";
  40. sdkjs.parentNode.insertBefore(js, sdkjs);
  41. }(document, 'script', 'edmunds-jssdk'));
  42. </script>
  43. </body>
  44. </html>