Odds API for Discord bots and alerts

An odds API for Discord bots and alerts: signed webhooks on line moves, or a WebSocket feed for steam and best-price logic, so your bot posts the move as it happens.

Alerting services need three things: low latency, stable identifiers and events pushed to them. PreciseAPI delivers price changes over WebSocket and line moves as signed webhooks.

Most odds alert services start life as a Discord bot. A channel wants line movement alerts, someone writes a scraper, and the scraper breaks the first time a book changes its site. An odds API for Discord bots replaces the scraper with the two things a bot needs: a detector that notices moves across 36 sources, and a delivery path that reaches your code seconds after the move.

PreciseAPI works as an odds API for Discord bots in two ways. It can watch the feed for you and send a signed webhook, or you can watch the WebSocket stream and run your own logic. This page explains when to use each, how to build the relay that posts into Discord, Telegram or Slack, and what each plan allows.

How an odds API for Discord bots fits together

A bot has three jobs: detect a move, deliver it, and format it for the channel.

alert rule (PreciseAPI) ──signed POST──▶ your relay ──embed──▶ Discord channel webhook
WebSocket stream (Syndicate) ──deltas──▶ your detector ──▶ the same relay

The relay is a small HTTPS service you run. PreciseAPI can't usefully post into Discord directly, because Discord expects its own message format and won't check PreciseAPI's signature. The relay verifies each request, drops duplicates, decides what is worth posting and formats it.

Option 1: alert rules and a betting alerts webhook

Line-move rules are the shortest path. Create a rule under Dashboard → Alerts with the leagues, books and markets to watch and a threshold in cents (1 to 1,000, default 20). Send it to a webhook endpoint created under Dashboard → Webhooks, to email, or both. PreciseAPI then watches every matching full-game moneyline, spread and total and sends a line.moved event when a price moves by your threshold or a spread or total line changes.

Each delivery is a POST signed with your endpoint's whsec_ secret in the PreciseAPI-Signature header. Respond with a 2xx within 5 seconds. Failed deliveries are retried after 30 seconds, 2 minutes, 10 minutes, 1 hour and 6 hours, and delivery is at-least-once, so the same event can arrive twice. That is the whole contract of a betting alerts webhook: verify, acknowledge, de-duplicate. A minimal relay with the official Node.js SDK:

import express from 'express';
import { verifyWebhookSignature } from '@preciseapi/node';

const app = express();
const seen = new Set(); // use Redis or a table with a TTL in production

app.post('/webhooks/preciseapi', express.raw({ type: 'application/json' }), async (req, res) => {
  const ok = verifyWebhookSignature(req.body, req.get('PreciseAPI-Signature'), process.env.PRECISEAPI_WEBHOOK_SECRET);
  if (!ok) return res.sendStatus(400);
  const event = JSON.parse(req.body);
  res.sendStatus(200); // acknowledge first, post afterwards

  if (event.type !== 'line.moved' || seen.has(event.id)) return;
  seen.add(event.id);
  if (Date.now() - Date.parse(event.created) > 120_000) return; // a late retry: old news

  const { event: game, book, market, move, line } = event.data;
  const what = move ? `${move.outcome} ${move.from} → ${move.to} (${move.cents}¢)` : `line ${line.from} → ${line.to}`;
  await fetch(process.env.DISCORD_WEBHOOK_URL, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      embeds: [{ title: `${game.away.name} @ ${game.home.name}`, description: `${book.name} ${market.key}: ${what}`, timestamp: event.created }],
    }),
  });
});

app.listen(3000);

Two details trip people up. The top-level id identifies the delivery and is what you de-duplicate on, while the game is data.event.id; both start with evt_. And when a spread or total line changes, move is usually null and line holds { from, to }, because selection ids include the point. The step-by-step Discord odds bot tutorial adds batching and Discord rate-limit handling to this relay, and the odds alerts webhooks reference has the full payload.

Option 2: the stream, for what rules don't cover

Alert rules watch full-game moneylines, spreads and totals, and a market fires at most once every 10 minutes per rule. That suits "tell the channel when the line moves". It does not cover:

For these, subscribe to /v1/stream on Syndicate and run the detector in your own process. The detect steam moves post has a working detector, and the line movement API page covers the data behind it. On Edge or Sharp you can approximate best-price alerts by polling /v1/best-lines (3 credits per call) and comparing best_books between calls.

Which plan fits an odds alerts API workload

PlanAlert rulesWebhook endpointsAlert costMoves in live gamesStream
Edge, $49.991021 credit each, from 100,000 a monthNoNo
Sharp, $199.9910010Unlimited creditsNoNo
Syndicate, $249.9950025Unlimited creditsYes10 connections

A community bot watching a league or two runs comfortably on Edge. One relay can serve many rules, so the endpoint count is rarely the limit; the rule count is. A group that splits alerts by league, book and market outgrows 10 rules quickly, and Sharp allows 100. If members want alerts during games, or props, steam and best-price alerts, that is Syndicate: in-play moves only alert on that plan, and it is the one with the stream. The odds API pricing page lists everything else in each plan.

Pitfalls when you run an odds API for Discord bots

Beyond Discord

Nothing in the relay is specific to Discord. Replace the final fetch with a Telegram bot message, a Slack incoming webhook or a mobile push service, and the same rules drive every channel. The guide on how to build a sports betting bot covers bots that do more than relay alerts, the odds API Node.js tutorial builds a stream client with reconnects, and the NBA odds API and NFL odds API pages show which books price each league.

Frequently asked questions

Can PreciseAPI post straight into a Discord channel?

Not usefully. Discord expects content or embeds, while PreciseAPI sends a signed event envelope. A small relay verifies the signature, removes duplicates and formats the message. The Discord odds bot tutorial has a complete one.

How much does an alert cost?

On Edge, each delivered alert costs 1 credit from your 100,000 monthly credits, and alerts are skipped silently if the balance is empty. Sharp and Syndicate have unlimited credits. A market fires at most once every 10 minutes per rule, which caps the volume.

Can I get alerts on player props or games in progress?

Alert rules watch full-game moneylines, spreads and totals, and moves in games already in progress alert only on Syndicate. For props and part-game markets, stream those market keys over the WebSocket, also on Syndicate, and apply your own thresholds.

Does the bot tell members what to bet?

No. It reports observed price and line changes. PreciseAPI is a data API: it doesn't take bets or give picks, and a moved line is information, not a recommendation.

Alerts without running a poller

Line-move rules watch the feed for you. A rule fires when a main-market price moves by at least the number of cents you set, or when a spread or total line changes, and it can be narrowed to leagues, books and markets. Each alert is a signed POST to your webhook, an email, or both, and costs 1 credit. The same market fires at most once every 10 minutes per rule.

When to use the stream instead

Webhooks suit pre-game alerts and a set number of rules. If your service needs every price change, or watches games in progress, the WebSocket stream on Syndicate delivers each change with a sequence number, so you can tell when one was missed and ask for a resync. Edge includes 10 alert rules and 2 webhook endpoints, Sharp 100 and 10, and Syndicate 500 and 25.

Example request

GET /v1/odds?league=nba&markets=moneyline&books=draftkings,fanduel

Endpoints

Products

Related reading

More use cases

Looking for a specific league or book? See the odds API directory, or compare plans.