How to link reg number to search button

Hi
I want to look up vehicle details (engine size, vin number, MOT exp date etc…) by entering the vehicle reg number. I’ve purchased the API key from DVLA. How do i link the search button to the input box where customer enters the reg number? Please help me out.

thanks

Hi,

You can create an onClick event for the button, get the text input value and send an HTTP request to the API as explained in the API documentation.

Have a good day,
Tal.

also, note that any API keys you have should be kept secure.
this means it is better to have the code that uses the API key run as a backend script,
so no one can see your API key.

you can learn about using backend code here: Velo: Accessing 3rd-Party Services with the Fetch API | Help Center | Wix.com

1 Like