- Python 3.8 or higher
requests
libraryuagents
library
-
Clone the repository:
git clone https://github.com/gautammanak1/Vehicle-Details-Retrieval.git cd Vehicle-Details-Retrieval
-
Install the required libraries:
pip install requests pip install uagents
-
Configure the Agents: Update the
vehicle_number
andrapidapi_key
variables in therequest_vehicle_details
function within the code. Replace the example values with actual values. -
Run the Agents:
python vehicleAgent.py
The get_vehicle_details
function uses the requests
library to interact with the vehicle information API:
def get_vehicle_details(vehicle_number, rapidapi_key):
url = "https://rto-vehicle-information-verification-india.p.rapidapi.com/api/v1/rc/vehicleinfo"
payload = {
"reg_no": vehicle_number,
"consent": "Y",
"consent_text": "I hereby declare my consent agreement for fetching my information via AITAN Labs API"
}
headers = {
'content-type': "application/json",
'X-RapidAPI-Key': rapidapi_key,
'X-RapidAPI-Host': "rto-vehicle-information-verification-india.p.rapidapi.com"
}
response = requests.post(url, json=payload, headers=headers)
return response.text