averye-duke commited on
Commit
f2d2130
·
1 Parent(s): 2cb6529

Added a docstring to explain function and give API information

Browse files
Files changed (1) hide show
  1. nhtsa_api_call.py +5 -0
nhtsa_api_call.py CHANGED
@@ -1,6 +1,11 @@
1
  import requests
2
 
3
  def get_vehicle_info(vin):
 
 
 
 
 
4
  url = f'https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVin/{vin}?format=json'
5
  response = requests.get(url);
6
  data = response.json()
 
1
  import requests
2
 
3
  def get_vehicle_info(vin):
4
+ """
5
+ This function takes the parameter "vin" and uses the NHTSA Decode VIN API to retrive year, make, and model
6
+ The API returns a JSON file which is not a dictionary so the file must be searched with a for loop by "Variable"
7
+ For more API information visit https://vpic.nhtsa.dot.gov/api/
8
+ """
9
  url = f'https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVin/{vin}?format=json'
10
  response = requests.get(url);
11
  data = response.json()