DEV Community

Cover image for Set Up Crypto Regime Shift Webhooks in 5 Minutes
Gunnar Thorderson
Gunnar Thorderson

Posted on • Originally published at getregime.com

Set Up Crypto Regime Shift Webhooks in 5 Minutes

Set Up Crypto Regime Shift Webhooks in 5 Minutes

The most valuable moment in crypto is when the market regime changes — bull to bear, bear to chop, chop to bull. If you find out 30 minutes late, you've already lost money.

Regime webhooks notify you the instant a regime transition is detected. Here's how to set them up.

Prerequisites

  • A Regime Pro account (start free trial)
  • A webhook URL (Slack, Discord, or your own server)

Step 1: Register a Webhook

curl -X POST https://getregime.com/api/v1/webhooks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-server.com/regime-webhook",
    "events": ["regime.change"]
  }'
Enter fullscreen mode Exit fullscreen mode

Step 2: Receive Events

When the regime changes, you'll receive a POST request:

{
  "event": "regime.change",
  "data": {
    "regime": "bear",
    "previousRegime": "chop",
    "confidence": 0.87,
    "timestamp": "2026-03-26T14:30:00Z",
    "signals": {
      "bullish": 1,
      "bearish": 4,
      "neutral": 1
    }
  },
  "signature": "sha256=abc123..."
}
Enter fullscreen mode Exit fullscreen mode

Slack Integration

Use a Slack incoming webhook URL directly:

curl -X POST https://getregime.com/api/v1/webhooks \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://hooks.slack.com/services/YOUR/WEBHOOK/URL",
    "events": ["regime.change"]
  }'
Enter fullscreen mode Exit fullscreen mode

Discord Integration

Same approach with a Discord webhook:

curl -X POST https://getregime.com/api/v1/webhooks \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://discord.com/api/webhooks/YOUR/WEBHOOK",
    "events": ["regime.change"]
  }'
Enter fullscreen mode Exit fullscreen mode

Verify Signatures

All webhooks are signed with HMAC-SHA256. Verify them to prevent spoofing:

import hmac
import hashlib

def verify_webhook(payload, signature, secret):
    expected = hmac.new(secret.encode(), payload.encode(), hashlib.sha256).hexdigest()
    return hmac.compare_digest(f"sha256={expected}", signature)
Enter fullscreen mode Exit fullscreen mode

Use Case: Auto-Adjust Trading Bot

from flask import Flask, request

app = Flask(__name__)

@app.route("/regime-webhook", methods=["POST"])
def handle_regime_change():
    data = request.json["data"]

    if data["regime"] == "bear" and data["confidence"] > 0.8:
        # Close all longs, reduce exposure
        close_all_positions()
        send_alert(f"BEAR REGIME at {data['confidence']:.0%} — positions closed")
    elif data["regime"] == "bull":
        # Resume normal trading
        enable_trading()

    return "", 200
Enter fullscreen mode Exit fullscreen mode

Full webhook docs: getregime.com/quickstart

Example receiver: github.com/Thordersonjg/regime-webhook-alerts


Try Regime Intelligence

Regime is a real-time crypto market regime detection API. One endpoint tells you if the market is bull, bear, or chop — so your bot only trades when conditions match your strategy.

Free API access → | See pricing → | API docs →

Top comments (0)