I have a new website where people can enter their car information, submit the forms, and I can gather everything needed to estimate their car’s value.
To achieve this, I have created forms with input fields such as “Brand,” “Model,” and “Kilometers.” For the “Brand” and “Model” fields, I want to use an API (Plate Decoder - CarsXE API Reference) to retrieve data in French.
I need your help with one specific task: setting up the API calls to retrieve car information for the “Brand” and “Model” input fields in my form. The inputs should be in the form of a list, populated with data from the API.
The basics of what you’re doing are relatively simple however most APIs cannot or should not be called from client-side code, so you need a middle-tier. I generally recommend serverless functions for this, Netlify’s are good and will keep your API key protected from theft and abuse.
If you’re doing especially high traffic or have tight rate limits on the API, or want higher performance, you can reverse-proxy and cache the results as well.