Skip to content

Instantly share code, notes, and snippets.

@sirkirby
Created October 22, 2012 21:54
Show Gist options
  • Save sirkirby/3934770 to your computer and use it in GitHub Desktop.
Save sirkirby/3934770 to your computer and use it in GitHub Desktop.
RyanTech VIN Explosion API Decode VIN w/ jQuery
// using jQuery and jQuery-base64 https://github.com/carlo/jquery-base64
var creds = "Basic " + $.base64.encode("username:password");
$.ajax({
url: "http://vinexplosion.com/api/vin/decode/3GYFNAE36CS509361/?fuzzy=true",
dataType: "jsonp",
beforeSend: function (req) {
req.setRequestHeader("Authorization", creds);
req.setRequestHeader("Accept", "application/json");
},
success: function(data, status) {
alert(data.Vehicles[0].Providers[0].Make);
},
error: function() {
alert("failed");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment