How to display API data by entering a postcode into a search bar?

I currently have an input search bar with a submit button and code that will display the API data that I want. However, in the URL for the API, it sets the location to the postcode “FK1 5LD” as you can see the section “area=FK1%205LD”. The way the data is displayed and formatted works perfectly for me. But I would like to be able to type in the postcode “FK1 5LD” into the input search bar and when I click the submit button, it would display the API data I have already coded. Thank you! Search Bar and Button HTML