Skip to content

Instantly share code, notes, and snippets.

@gastonfartek
Created December 30, 2018 17:41
Show Gist options
  • Save gastonfartek/e19f12ca99b77477209fb16d3dbcf46d to your computer and use it in GitHub Desktop.
Save gastonfartek/e19f12ca99b77477209fb16d3dbcf46d to your computer and use it in GitHub Desktop.
Python test
import json
from urllib.request import urlopen
response = urlopen('https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVin/1HD1BX5158Y047710?format=json')
responseData = response.read();
json = json.loads(responseData)
data = list(filter(lambda r: r['VariableId'] == 26 or r['VariableId'] == 28 or r['VariableId'] == 29, json['Results']))
print(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment