API & Webhooks
Integrate Sectofy Apex real-time SMC, ICT, and PPA indicator alert triggers directly into automated trading bots, Discord webhooks, or institutional execution gateways.
Protocol Standard
HTTPS / TLS 1.3 POST
Dispatch Latency
< 18ms Global Relay
Authentication
HMAC-SHA256 Signature
1. Webhook Endpoint Target
Configure your TradingView alert message box to dispatch standard JSON payloads to your dedicated secure webhook URL whenever an Apex institutional structure break, order block test, or liquidity sweep triggers.
{
"secret": "YOUR_HMAC_SECRET_KEY",
"ticker": "{{ticker}}",
"exchange": "{{exchange}}",
"timeframe": "{{interval}}",
"signal": "{{strategy.order.action}}",
"price": {{close}},
"timestamp": "{{timenow}}",
"apex_version": "14.0",
"indicators": {
"structure_break": "BOS_BULLISH",
"order_block": "ACTIVE_DISCOUNT_OB",
"confluence_score": 94
}
}
2. Sample Webhook Receiver Listener
Here is a reference Python Flask snippet to validate incoming cryptographic signatures and parse Sectofy Apex trade alerts for automated execution bots.
from flask import Flask, request, jsonify
import hmac
import hashlib
app = Flask(__name__)
WEBHOOK_SECRET = b"YOUR_HMAC_SECRET_KEY"
@app.route('/webhook', methods=['POST'])
def receive_alert():
signature = request.headers.get('X-Apex-Signature', '')
payload = request.data
# Verify HMAC Signature for Institutional Security
expected_sig = hmac.new(WEBHOOK_SECRET, payload, hashlib.sha256).hexdigest()
if not hmac.compare_digest(signature, expected_sig):
return jsonify({"status": "error", "message": "Invalid signature"}), 403
data = request.json
print(f"Received Apex Signal for {data.get('ticker')} @ {data.get('price')}")
# Insert automated broker trade execution logic here
return jsonify({"status": "success", "processed": True}), 200
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
⚡ Rate Limits & Quotas
Standard institutional API keys permit up to 120 requests per minute per trading pair. Exceeding thresholds returns a 429 Too Many Requests response header.
- ✓ Dedicated IP Whitelisting available upon request
- ✓ Automatic exponential backoff supported
🛡️ Security Best Practices
Always verify incoming webhook requests using the X-Apex-Signature header to protect your automated infrastructure from unauthorized payload injection.
- ✓ End-to-end HTTPS encryption required
- ✓ Rotate your HMAC secret keys every 90 days