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.
- Line-move webhooks. Alert when a price moves N cents or a line changes, filtered by league, book and market.
- Stable ids. Event, market and selection ids never change, even when a game goes live — safe to key your state on.
- Official SDKs. Node.js and Python clients with retries, streaming and webhook verification.
- Per-key limits. Give each service its own key with an IP allowlist and monthly credit cap.
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:
- Player props and part-game markets. Rules don't watch
player_*keys, halves or quarters. - Steam. A rule sees one book move. A steam alert needs several books moving the same way within a short window, which is a calculation across books.
- Best-price changes. "FanDuel now has the best price on the over" needs every book's price at once.
- Fast sequences. The cooldown keeps channels readable, but it hides a market that moves three times in five minutes.
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
| Plan | Alert rules | Webhook endpoints | Alert cost | Moves in live games | Stream |
|---|---|---|---|---|---|
| Edge, $49.99 | 10 | 2 | 1 credit each, from 100,000 a month | No | No |
| Sharp, $199.99 | 100 | 10 | Unlimited credits | No | No |
| Syndicate, $249.99 | 500 | 25 | Unlimited credits | Yes | 10 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
- Posting retries as news. A delivery retried after 10 minutes describes a price that may have moved again. Drop old ones, as the relay above does, or re-check the market with
/v1/events/{id}/odds(2 credits) before posting. - Losing the dedupe set on restart. Keep delivery ids in Redis or a table with a TTL of a day, not only in memory.
- Slow work before the response. PreciseAPI wants a 2xx within 5 seconds, and Discord may make you wait. Acknowledge first and queue the post. After 20 consecutive failures an endpoint is disabled and the account owner is emailed.
- Leaking the Discord webhook URL. Anyone who has it can post to your channel. Store it as a secret.
- One key for everything. Give the bot its own API key with an IP allowlist and a monthly credit cap, so a bug can't spend the whole account's balance. The key controls docs cover the options.
- Sounding like a tipster. Report what moved: book, market, from, to, time. PreciseAPI supplies data, not picks, and members should know a price can move again before they read the post.
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
- WebSocket stream: snapshots and deltas over one connection
- GET /v1/odds: Get odds
Products
- Game odds API: Betting odds API for moneylines, spreads and totals from 36 sources, for every period, plus alternate lines and team totals in one normalized schema.
- Live odds API: Live odds API with in-play prices pushed in under 500 ms over WebSocket on Syndicate, plus live scores, the game clock and automatic suspension of stale prices.
- Exchange odds API: Exchange odds API: Kalshi, Polymarket, Novig, ProphetX and 4CX prices in the same formats as sportsbook odds, with liquidity, on one event id.
- Positive EV API: Positive EV API data: every book’s price next to the no-vig fair line from the market consensus or a sharp book like Pinnacle, ranked by edge.
Related reading
- How to Build a Discord Odds Bot for Line-Move Alerts (Webhooks + Node.js): Relay PreciseAPI line-move webhooks into a Discord channel with Node.js. Signature checks, de-duplication, stale-alert filtering, embeds, batching and Discord rate limits.
- How to Detect Steam Moves with Real-Time Odds Data: What a steam move is, how to detect synchronized moves across sportsbooks in real time, a working JavaScript detector, and the false positives to filter out.
More use cases
- DFS & pick'em tools: An odds API for DFS and pick’em tools: PrizePicks, Underdog, Sleeper and Pick6 lines next to sharp sportsbook props on one player id, to find the best picks.
- Trading & market making: An odds API for sportsbooks and trading desks: every competitor’s price, sharp books and exchanges in real time, with line history, to price and manage risk.
- Media & affiliates: An odds API for affiliates, media and tipsters: live odds tables, best-price widgets and deep links to each book’s bet slip, from one normalized feed.
- Models & data science: Sports betting model data: market prices, implied probabilities and line history with stable ids, to train, backtest and run betting models and research.
Looking for a specific league or book? See the odds API directory, or compare plans.