I am looking for some guidance for my script. As you can see, I want to have user input enter the vehicle reg number. This would then need to sit in the end of the URL so user input can dictate which vehicle is called via the API.
import requests
import json
registration = str(input("What's your REG number? "))
url = "https://beta.check-mot.service.gov.uk/trade/vehicles/mot-tests/?registration=PJ66FKY"
payload = {}
headers = {
'x-api-key': 'XXXXXXXXXXXXXXXXXXXXX',
'Content-Type': 'application/json',
'Cookie': 'visid_incap_1151098=RTIoGHIETUSrjaf5W7QCScxP2l4AAAAAQUIPAAAAAAAkfOLSmlzNbGFWSfE86hQh; nlbi_1151098=hrz6EkFnOlWdINdZsRy5CgAAAADwbuHnEYVAPG0gSttx0Nsd; incap_ses_869_1151098=w7M8LuMrFQob4OeqJlAPDM9R2l4AAAAAKnNYAG3p3JxlCSU27U1/Qw=='
}
response = requests.request("GET", url, headers=headers, data = payload)
#print(response.text.encode('utf8'))
print (json.dumps(response.json(), indent=4, sort_keys=True))