There are many ways to accomplish what you're looking for, but I'll give you a couple basic examples here. The first way is to embed the inputted data as url parameters. You can use a GET request to do this. The other is to use a POST request where the request payload contains the input data.
Using a GET
The first step for this type of request is to set up the endpoint to pull the parameter value out of the url
from flask import request
@app.route('/get_example')
def get_example():
input_data = request.args.get('input')
input2_data = request.args.get('input2')
# Then you process your data however you need to
return {'input_1': input_data, 'input_2': input2_data}
Then you would hit this endpoint with your data directly embedded in the url:
https://your_api.com/get_example?input_data=some_stuff&input_data2=some_other_stuff
This would return {"input_1":"some_stuff", "input_2":"some_other_stuff}
Using a POST
For more complex data, it might be better to use a POST request
from flask import request
# it's important to include POST as one of the permitted methods
@app.route('/post_example', methods = ['GET','POST'])
def post_example():
# This returns a dictionary of the POST request payload
post_data = request.get_json(force = True)
post1_data = post_data['first_input']
post2_data = post_data['second_input']
return {'input_1': post1_data, 'input_2': post2_data}
Then you can hit your endpoint using curl:
curl -d "first_input=some_stuff&second_input=some_other_stuff" -X POST https://your_api.com/post_example
And it would return {"input_1":"some_stuff", "input_2":"some_other_stuff}
Some References
How can I get the named parameters from a URL using Flask?
https://www.educative.io/answers/how-to-perform-a-post-request-using-curl