from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/webhook', methods=['POST'])
def webhook():
data = request.json
print(f"Webhook received: {data}")
# Process the data as needed
return jsonify({'status': 'success'}), 200
if __name__ == '__main__':
app.run(port=5000)
This Flask app listens for POST requests on /webhook
and prints the received data. You can expand this to handle specific webhook events like order fills, price alerts, etc.