You have to create an html file which will get all the inputs that are going to be passed in the arguments of your post api then that api is going to process all the data and return the data which is going to be used in the graph. you can see these posts How can I get the named parameters from a URL using Flask? and docs https://flask.palletsprojects.com/en/stable/templating/