Our VINdecode API provides detailed vehicle specifications based on the submitted vehicle identification number (VIN). These specifications include the year, make, model, engine and transmission details, color, and both standard and optional equipment. This API method supports the submission of one VIN at a time and returns comprehensive specifications. The returned data includes the vehicle's country of origin, year/make/model details, engine and powertrain specifics, manufacturer-included options, and other specifications such as gross vehicle weight (GVW) and MSRP.
Our records show that some users with unlimited access to the VINdecode API tend to make excessive and sometimes unnecessary API calls. To maintain the overall health of our system, we may block traffic from a specific source once it reaches a certain level. This ensures that one user's actions do not negatively impact the larger community. We reserve the right to throttle excessive API calls or even refuse service if necessary.
Coding Examples
JavaScript(
Python,
C#,
Java,
PHP,
Swift)
<html>
<head></head>
<body>
<form id = "form">
<label>Please input a VIN:<input type="text" id ="input"></label>
<br>
<a href="javascript: fetchResponseXml()">Submit (XML Output)</a>
<br>
<a href="javascript: fetchResponseJson()">Submit (Json Output)</a>
</<form>
<pre id="out"></pre>
</body>
<script>
const form=document.getElementById("form")
const out=document.getElementById("out")
// Javascript XML
async function fetchResponseXml(){
const url="https://ws.vinquery.com/vindecode/v2?accesscode=YOUR_ACCESS_CODE&vin=YOUR_VIN&reportType=YOUR_REPORT_TYPE&format=xml;
var parser=new DOMParser();
var xmlHttp=new XMLHttpRequest();
xmlHttp.open("GET", url, false);
xmlHttp.send();
var xmlResponse=parser.parseFromString(xmlHttp.responseText, "text/xml");
console.log(xmlResponse)
var text="";
var children=xmlResponse.documentElement.childNodes;
for (var i=0; i < children.length; i++){
console.log(children)
// text += children[i].tagName+": "+children[i].textContent+"\n"
text += children[i].nodeName+": "+children[i].textContent+"\n"
}
out.textContent=text;
}
// Javascript Json
async function fetchResponseJson(){
const url="https://ws.vinquery.com/vindecode/v2?accesscode=YOUR_ACCESS_CODE&vin=YOUR_VIN&reportType=YOUR_REPORT_TYPE&format=json";
fetch(url).then(function(response){
return response.json()
}).then(function(data){
let text="";
for (let x in data){
text+=x+": "+data[x]+"\n";
}
out.textContent=text;
}).catch(function(){
out.textContent="Something went wrong..."
});
}
</script>
</html>
Python(
JavaScript,
C#,
Java,
PHP,
Swift)
import xml.etree.ElementTree as ET
import requests
url="https://ws.vinquery.com/vindecode/v2?accesscode=YOUR_ACCESS_CODE&reportType=YOUR_REPORT_TYPE&vin=YOUR_VIN";
response = requests.get(url)
xml = ET.fromstring(response.content.decode('UTF-8'))
output = "Model Year: " + xml[0][0].attrib['Model_Year'] + "\n"
output += "Make: " + xml[0][0].attrib['Make'] + "\n"
output += "Model: " + xml[0][0].attrib['Model'] + "\n"
output += "Trim Level: " + xml[0][0].attrib['Trim_Level']
...
print(output)
import requests
import json
url="https://ws.vinquery.com/vindecode/v2?accesscode=YOUR_ACCESS_CODE&vin=YOUR_VIN&reportType=YOUR_REPORT_TYPE&format=json"
response = requests.get(url)
result=response.json()
print(result)
if result["status"]=="SUCCESS":
print("Service: "+result["service"])
print("Version: "+result["version"])
print("Date: "+result["date"])
print("Status: "+result["status"])
vehicles=result["vehicles"]
for vehicle in vehicles:
print(vehicle["VINquery_Vehicle_ID"]["value"])
print(vehicle["Model Year"]["value"])
print(vehicle["Make"]["value"])
print(vehicle["Model"]["value"])
print(vehicle["Trim Level"]["value"])
else:
print("Service: "+result["service"])
print("Version: "+result["version"])
print("Date: "+result["date"])
print("Status: "+result["status"])
print("Message Key: "+str(result["message_key"]))
print("Message: "+result["message"])
C#(
JavaScript,
Python,
Java,
PHP,
Swift)
// C# XML
using System;
using System.Net;
using System.Xml;
String url="https://ws.vinquery.com/vindecode/v2?accesscode=YOUR_ACCESS_CODE&reportType=YOUR_REPORT_TYPE&vin=YOUR_VIN&format=xml";
String responseString = client.DownloadString(url);
Console.WriteLine("XML Output (Parsed): \n");
var xmlResponse = new XmlDocument();
xmlResponse.LoadXml(responseString);
foreach (XmlNode node in xmlResponse.DocumentElement.ChildNodes)
{
Console.WriteLine(node.Name + ": " + node.InnerText);
}
// C# Json
using System;
using System.Net;
using Newtonsoft.Json.Linq;
String url="https://ws.vinquery.com/vindecode/v2?accesscode=YOUR_ACCESS_CODE&reportType=YOUR_REPORT_TYPE&vin=YOUR_VIN&format=json";
String responseString = client.DownloadString(url);
Console.WriteLine("\nJSON Output (Parsed): \n");
JObject jsonResponse = JObject.Parse(responseString);
foreach (var node in jsonResponse)
{
Console.WriteLine(node.Key + ": " + node.Value);
}
Java(
JavaScript,
Python,
C#,
PHP,
Swift)
// Java XML
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.net.HttpURLConnection;
import java.net.URL;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import javax.xml.parsers.*;
String response = "";
URL url = new URL("https://ws.vinquery.com/vindecode/v2?accesscode=YOUR_ACCESS_CODE&reportType=YOUR_REPORT_TYPE&vin=YOUR_VIN&format=xml");
final HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream()));
StringBuilder sb = new StringBuilder();
while ((response = br.readLine()) != null) {
sb.append(response);
}
response = sb.toString();
con.disconnect();
System.out.println(response);
String output = "";
output = parseXML(response);
System.out.println(output);
private static String parseXML(String response) {
String output = "";
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new StringReader(response)));
document.getDocumentElement().normalize();
NodeList list = document.getFirstChild().getChildNodes();
Node node;
for (int i = 0; i < list.getLength(); i++) {
node = list.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
output += node.getNodeName() + ": " + node.getTextContent() + "\n";
}
}
return output;
}
// Java Json
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.net.HttpURLConnection;
import java.net.URL;
import org.json.JSONArray;
import org.json.JSONObject;
String response = "";
URL url = new URL("https://ws.vinquery.com/vindecode/v2?accesscode=YOUR_ACCESS_CODE&reportType=YOUR_REPORT_TYPE&vin=YOUR_VIN&format=json");
final HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream()));
StringBuilder sb = new StringBuilder();
while ((response = br.readLine()) != null) {
sb.append(response);
}
response = sb.toString();
con.disconnect();
System.out.println(response);
String output = "";
output = parseJSON(response);
System.out.println(output);
private static String parseJSON(String response) {
String output = "";
JSONObject jsonObject = new JSONObject(response.trim());
JSONArray names = jsonObject.names();
for (int i = 0; i < names.length(); i++) {
output += names.getString(i) + ": " + jsonObject.get(names.getString(i)) + "\n";
}
return output;
}
PHP(
JavaScript,
Python,
C#,
Java,
Swift)
// PHP XML
<?php
$response = file_get_contents('http://ws.vinquery.com/vindecode/v2?accesscode=YOUR_ACCESS_CODE&reportType=YOUR_REPORT_TYPE&vin=YOUR_VIN&format=xml');
$response = new SimpleXMLElement($response);
$string = $response -> asXML();
echo($string);
foreach($response -> VIN -> Vehicle -> Item as $Item) {
echo $Item['Key'], ': ', $Item['Value'], ' ';
}
?>
// PHP Json
<?php
$response = file_get_contents("http://ws.vinquery.com/vindecode/v2?accesscode=YOUR_ACCESS_CODE&reportType=YOUR_REPORT_TYPE&vin=YOUR_VIN&format=json");
echo($response);
$json = json_decode($response, true);
foreach ($json as $key => $value) {
echo($key.": ".$value."\n");
}
?>
Swift(
JavaScript,
Python,
C#,
Java,
PHP)
// Swift XML
import UIKit
if let url = URL(string: "https://ws.vinquery.com/vindecode/v2?accesscode=YOUR_ACCESS_CODE&reportType=YOUR_REPORT_TYPE&vin=YOUR_VIN") {
do {
let contents = try String(contentsOf: url)
print(contents)
} catch {
print("contents of the URL couldn't be loaded")
}
} else {
print("bad URL, try again")
}
// Swift Json
import UIKit
if let url = URL(string:"https://ws.vinquery.com/vindecode/v2?accesscode=YOUR_ACCESS_CODE&reportType=YOUR_REPORT_TYPE&vin=YOUR_VIN&format=json") {
do {
let contents = try String(contentsOf: url)
print(contents)
} catch {
print("contents of the URL couldn't be loaded")
}
} else {
print("bad URL, try again")
}