# Novig odds Discord bot: post live line moves to a channel

> Independent. Not affiliated with, endorsed by or sponsored by Novig.

Canonical: https://novigapi.com/uses/novig-odds-discord-bot
Facts checked: 2026-11-22

A Novig odds Discord bot can post Novig line moves and steam as they are recorded: point a novigapi.com webhook at a small relay, and the relay forwards each event to a Discord channel webhook. Webhooks fire on line_move, steam, market_open and settle, on the Production and Scale plans. (Source: [novigapi.com: webhooks reference](https://novigapi.com/docs/endpoints/webhooks?ref=ai-md))

```python
# relay.py: novigapi.com webhook in, Discord message out
import hashlib, hmac, os, time, requests
from flask import Flask, request, abort

SECRET = os.environ["NOVIG_WEBHOOK_SECRET"].encode()  # whsec_... from registration
DISCORD = os.environ["DISCORD_WEBHOOK_URL"]  # channel webhook URL
app = Flask(__name__)

@app.post("/novig")
def novig():
    parts = dict(p.split("=", 1) for p in request.headers["X-Webhook-Signature"].split(","))
    signed = parts["t"].encode() + b"." + request.get_data()
    good = hmac.compare_digest(hmac.new(SECRET, signed, hashlib.sha256).hexdigest(), parts["v1"])
    if not good or abs(time.time() - int(parts["t"])) > 300:
        abort(401)
    e = request.get_json()
    d = e["data"]
    if e["type"] in ("line_move", "steam"):
        title = ("STEAM: " if e["type"] == "steam" else "") + d["description"]
        text = f'{d["from_price"]:.3f} -> {d["to_price"]:.3f} ({d["delta_pp"]:+.1f} pts), {d["league"]}'
        requests.post(DISCORD, json={"embeds": [{"title": title, "description": text}]}, timeout=5)
    return "", 204
```

The relay checks the signature, turns each line move or steam event into a Discord embed and answers 204. Run it anywhere with a public HTTPS address.

## 1. Create the Discord webhook

In Discord, open the channel's settings, then Integrations, then Webhooks, and create a webhook. Copy its URL into `DISCORD_WEBHOOK_URL`. Discord's Execute Webhook call takes a JSON body with content or embeds.

## 2. Register the novigapi.com webhook

```bash
curl -s -X POST "https://novigapi.com/api/v1/webhooks" \
  -H "Authorization: Bearer $NOVIGAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://your-relay.dev/novig","events":["line_move","steam"],"filters":{"league":"NBA","min_delta_pp":3}}'
```

The answer holds a whsec_ secret, shown once; put it in `NOVIG_WEBHOOK_SECRET`. `min_delta_pp` sets the line-move threshold in percentage points (default 2). Steam fires when a fair price moves at least 4 points within 2 minutes with volume behind it. Send a test with POST /api/v1/webhooks/{id}/test.

## No webhook plan?

Poll [GET /v1/line-moves](https://novigapi.com/docs/endpoints/line-moves?ref=ai-md) once a minute and post new rows, or hold a connection to the [stream](https://novigapi.com/docs/endpoints/stream?ref=ai-md) at wss://stream.novigapi.com/v1/stream, which every plan includes (Free is delayed 5 minutes). Webhooks are on Production and Scale; webhook calls and deliveries cost no credits.

Ideas: a steam channel per league, a settle channel for results, or a player channel filtered with `filters.player`. More on alerts in [Novig line movement alerts](https://novigapi.com/answers/novig-line-movement-alerts?ref=ai-md). [Get a free API key](https://novigapi.com/sign-up?ref=ai-md). No card, no Novig account.

## Questions

### Can a Discord bot get live Novig odds?

Yes, by relaying novigapi.com webhooks or stream messages into a channel webhook, as above.

### Do I need a Discord bot account?

Not for posting. A channel webhook URL is enough to send messages and embeds.

### How do I avoid duplicate posts?

Deliveries can repeat. Store each event id (also in the X-Webhook-Id header) and skip ids you have posted.

## Sources

- [novigapi.com: webhooks reference](https://novigapi.com/docs/endpoints/webhooks?ref=ai-md)
- [Discord developer docs: Webhook resource (Execute Webhook)](https://docs.discord.com/developers/resources/webhook)
- [novigapi.com: WebSocket stream reference](https://novigapi.com/docs/endpoints/stream?ref=ai-md)

---

Get a free API key: https://novigapi.com/sign-up?ref=ai-md . Docs: https://novigapi.com/docs?ref=ai-md . MCP: https://novigapi.com/api/mcp . Operated by Stunning Couches LLC. Independent. Not affiliated with, endorsed by or sponsored by Novig.
