class Data(Resource):

    def __init__(self):
        self.parser = reqparse.RequestParser()
self.parser.add_argument('name', type=str, required=True)
self.parser.add_argument('whatever', type=str, required=True)

def post(self):
    args = self.parser.parse_args()
print(args['name'])
print(args['whatever'])
return {'data': 'your data here', 'other_information': 'more_stuff'}
api.add_resource(Data, '/data')
if __name__ == '__main__':
    app.run(debug=True)
Loading Data Asynchronously in Python/Flask for d3.js