odds-api-io 1.3.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +324 -249
  2. package/dist/cjs/client.d.ts +278 -0
  3. package/dist/cjs/client.js +536 -292
  4. package/dist/cjs/client.js.map +1 -1
  5. package/dist/cjs/errors.d.ts +63 -0
  6. package/dist/cjs/errors.js +54 -36
  7. package/dist/cjs/errors.js.map +1 -1
  8. package/dist/cjs/helpers.d.ts +5 -0
  9. package/dist/cjs/helpers.js +13 -0
  10. package/dist/cjs/helpers.js.map +1 -0
  11. package/dist/cjs/index.d.ts +15 -0
  12. package/dist/cjs/index.js +15 -3
  13. package/dist/cjs/index.js.map +1 -1
  14. package/dist/cjs/package.json +1 -0
  15. package/dist/cjs/types.d.ts +770 -0
  16. package/dist/cjs/types.js +4 -1
  17. package/dist/cjs/types.js.map +1 -1
  18. package/dist/cjs/version.d.ts +1 -0
  19. package/dist/cjs/version.js +5 -0
  20. package/dist/cjs/version.js.map +1 -0
  21. package/dist/cjs/websocket.d.ts +210 -0
  22. package/dist/cjs/websocket.js +405 -0
  23. package/dist/cjs/websocket.js.map +1 -0
  24. package/dist/esm/client.d.ts +278 -0
  25. package/dist/esm/client.js +537 -293
  26. package/dist/esm/client.js.map +1 -1
  27. package/dist/esm/errors.d.ts +63 -0
  28. package/dist/esm/errors.js +49 -34
  29. package/dist/esm/errors.js.map +1 -1
  30. package/dist/esm/helpers.d.ts +5 -0
  31. package/dist/esm/helpers.js +9 -0
  32. package/dist/esm/helpers.js.map +1 -0
  33. package/dist/esm/index.d.ts +15 -0
  34. package/dist/esm/index.js +5 -2
  35. package/dist/esm/index.js.map +1 -1
  36. package/dist/esm/package.json +1 -0
  37. package/dist/esm/types.d.ts +770 -0
  38. package/dist/esm/types.js +4 -1
  39. package/dist/esm/types.js.map +1 -1
  40. package/dist/esm/version.d.ts +1 -0
  41. package/dist/esm/version.js +2 -0
  42. package/dist/esm/version.js.map +1 -0
  43. package/dist/esm/websocket.d.ts +210 -0
  44. package/dist/esm/websocket.js +367 -0
  45. package/dist/esm/websocket.js.map +1 -0
  46. package/dist/types/client.d.ts +155 -195
  47. package/dist/types/client.d.ts.map +1 -1
  48. package/dist/types/errors.d.ts +48 -24
  49. package/dist/types/errors.d.ts.map +1 -1
  50. package/dist/types/helpers.d.ts +6 -0
  51. package/dist/types/helpers.d.ts.map +1 -0
  52. package/dist/types/index.d.ts +8 -3
  53. package/dist/types/index.d.ts.map +1 -1
  54. package/dist/types/types.d.ts +659 -187
  55. package/dist/types/types.d.ts.map +1 -1
  56. package/dist/types/version.d.ts +2 -0
  57. package/dist/types/version.d.ts.map +1 -0
  58. package/dist/types/websocket.d.ts +211 -0
  59. package/dist/types/websocket.d.ts.map +1 -0
  60. package/package.json +46 -16
@@ -1,319 +1,279 @@
1
- import { OddsAPIClientConfig, Sport, League, Event, HistoricalEvent, Participant, Bookmaker, EventOdds, HistoricalEventOdds, OddsMovement, ArbitrageBet, ValueBet, GetEventsParams, GetHistoricalEventsParams, GetOddsParams, GetHistoricalOddsParams, GetOddsMovementParams, GetMultiEventOddsParams, GetUpdatedOddsSinceParams, GetParticipantsParams, GetArbitrageBetsParams, GetValueBetsParams, DroppingOddsEntry, GetDroppingOddsParams } from './types.js';
1
+ import type { OddsAPIClientConfig, RateLimitInfo, Sport, League, Event, HistoricalEvent, Participant, Bookmaker, SelectedBookmakers, MarketsResponse, MarketsBySport, EventOdds, HistoricalEventOdds, OddsMovement, UpdatedOddsResult, OddsSnapshot, EventSummary, ArbitrageBet, ValueBet, DroppingOddsEntry, DroppingOddsPage, SettlementsResponse, GradeSelection, GradesResponse, Outright, OutrightOdds, OutrightResults, Mapping, MappingsPage, GetLeaguesOptions, GetEventsParams, SearchEventsOptions, GetHistoricalEventsParams, SearchHistoricalEventsParams, GetOddsParams, GetMultiEventOddsParams, GetHistoricalOddsParams, GetClosingLinesParams, GetOddsMovementParams, GetUpdatedOddsSinceParams, PollUpdatedOddsParams, GetOddsSummaryParams, GetOddsSummaryMultiParams, GetParticipantsParams, GetArbitrageBetsParams, GetValueBetsParams, GetDroppingOddsParams, GetOutrightsParams, GetOutrightOddsParams, GetMappingsParams, PageOptions, CommaList } from './types.js';
2
2
  /**
3
- * Official Node.js client for Odds-API.io
3
+ * Official Node.js client for Odds-API.io.
4
4
  *
5
5
  * @example
6
6
  * ```typescript
7
7
  * import { OddsAPIClient } from 'odds-api-io';
8
8
  *
9
- * const client = new OddsAPIClient({ apiKey: 'your-api-key' });
9
+ * const client = new OddsAPIClient({ apiKey: process.env.ODDS_API_KEY! });
10
10
  * const sports = await client.getSports();
11
11
  * ```
12
12
  */
13
13
  export declare class OddsAPIClient {
14
- private apiKey;
15
- private baseUrl;
16
- private timeout;
14
+ private readonly apiKey;
15
+ private readonly baseUrl;
16
+ private readonly timeout;
17
+ private readonly maxRetries;
18
+ private readonly maxRetryDelay;
19
+ private readonly fetchImpl?;
20
+ /** Rate-limit headers from the most recent response, when the server sent them. */
21
+ lastRateLimit?: RateLimitInfo;
17
22
  constructor(config: OddsAPIClientConfig);
23
+ private buildUrl;
24
+ private send;
25
+ private backoff;
26
+ private retryDelay;
27
+ private toError;
28
+ private get;
29
+ /** All sports. No API key needed. */
30
+ getSports(): Promise<Sport[]>;
18
31
  /**
19
- * Make a GET request to the API
20
- */
21
- private request;
22
- /**
23
- * Make a PUT request to the API
24
- */
25
- private requestPut;
26
- /**
27
- * Handle error responses from the API
28
- */
29
- private handleErrorResponse;
30
- /**
31
- * Get all available sports
32
- *
33
- * @returns List of available sports
32
+ * Leagues for a sport.
34
33
  *
35
34
  * @example
36
35
  * ```typescript
37
- * const sports = await client.getSports();
38
- * console.log(`Found ${sports.length} sports`);
36
+ * const leagues = await client.getLeagues('football');
39
37
  * ```
40
38
  */
41
- getSports(): Promise<Sport[]>;
39
+ getLeagues(sport: string, options?: GetLeaguesOptions): Promise<League[]>;
42
40
  /**
43
- * Get leagues for a specific sport
44
- *
45
- * @param sport - Sport identifier (e.g., 'basketball', 'football')
46
- * @returns List of leagues
41
+ * The market catalogue: exact market names per sport, with shape, period and
42
+ * whether each is served prematch and live. Use it before passing `markets`
43
+ * to other calls. No API key needed.
47
44
  *
48
45
  * @example
49
46
  * ```typescript
50
- * const leagues = await client.getLeagues('basketball');
47
+ * const { markets } = await client.getMarkets('football');
51
48
  * ```
52
49
  */
53
- getLeagues(sport: string): Promise<League[]>;
50
+ getMarkets(sport: string): Promise<MarketsResponse>;
51
+ getMarkets(): Promise<MarketsBySport>;
54
52
  /**
55
- * Get events with optional filters
56
- *
57
- * @param params - Event filter parameters
58
- * @returns List of events
53
+ * Events for a sport. Without `to` the window is the next 14 days; each
54
+ * response is capped at 5000 events (see `iterateEvents`).
59
55
  *
60
56
  * @example
61
57
  * ```typescript
62
- * const events = await client.getEvents({
63
- * sport: 'basketball',
64
- * league: 'usa-nba'
65
- * });
58
+ * const events = await client.getEvents({ sport: 'football', league: 'england-premier-league', status: 'pending,live' });
66
59
  * ```
67
60
  */
68
61
  getEvents(params: GetEventsParams): Promise<Event[]>;
69
62
  /**
70
- * Get a specific event by ID
71
- *
72
- * @param eventId - Event ID
73
- * @returns Event details
63
+ * Every event matching the filters, paging with limit and skip.
74
64
  *
75
65
  * @example
76
66
  * ```typescript
77
- * const event = await client.getEventById('62924717');
67
+ * for await (const event of client.iterateEvents({ sport: 'football', to: '2027-01-01T00:00:00Z' })) {
68
+ * console.log(event.home, event.away);
69
+ * }
78
70
  * ```
79
71
  */
80
- getEventById(eventId: string): Promise<Event>;
72
+ iterateEvents(params: GetEventsParams, options?: PageOptions): AsyncGenerator<Event>;
73
+ /** One event by id. */
74
+ getEventById(eventId: string | number): Promise<Event>;
75
+ /** Live events, optionally for one sport. Live events carry `clock`. */
76
+ getLiveEvents(sport?: string): Promise<Event[]>;
81
77
  /**
82
- * Get currently live events for a sport
83
- *
84
- * @param sport - Sport identifier
85
- * @returns List of live events
78
+ * Search events by team or league name (min 3 characters, up to 10 results).
86
79
  *
87
80
  * @example
88
81
  * ```typescript
89
- * const liveEvents = await client.getLiveEvents('basketball');
82
+ * const live = await client.searchEvents('Liverpool', { status: 'live' });
90
83
  * ```
91
84
  */
92
- getLiveEvents(sport: string): Promise<Event[]>;
85
+ searchEvents(query: string, options?: SearchEventsOptions): Promise<Event[]>;
93
86
  /**
94
- * Search for events by keyword
95
- *
96
- * @param query - Search query
97
- * @returns List of matching events
98
- *
99
- * @example
100
- * ```typescript
101
- * const events = await client.searchEvents('Lakers');
102
- * ```
87
+ * Finished events for one league. The span from `from` to `to` is at most 31
88
+ * days; use `iterateHistoricalEvents` for longer ranges.
103
89
  */
104
- searchEvents(query: string): Promise<Event[]>;
90
+ getHistoricalEvents(params: GetHistoricalEventsParams): Promise<HistoricalEvent[]>;
91
+ /** Finished events for one league over any range, fetched in 31-day windows. */
92
+ iterateHistoricalEvents(params: GetHistoricalEventsParams): AsyncGenerator<HistoricalEvent>;
93
+ /** Search finished events by team name, across leagues (31-day span, default the last 31 days). */
94
+ searchHistoricalEvents(params: SearchHistoricalEventsParams): Promise<HistoricalEvent[]>;
105
95
  /**
106
- * Get finished historical events within a date range
107
- *
108
- * @param params - Historical event filter parameters
109
- * @returns List of historical events
96
+ * Odds for a finished event, in the `/odds` shape.
110
97
  *
111
98
  * @example
112
99
  * ```typescript
113
- * const events = await client.getHistoricalEvents({
114
- * sport: 'football',
115
- * league: 'england-premier-league',
116
- * from: '2026-01-01T00:00:00Z',
117
- * to: '2026-01-31T23:59:59Z'
118
- * });
100
+ * const odds = await client.getHistoricalOdds({ eventId: 67697888, bookmakers: ['Bet365', 'SingBet'], markets: ['ML'] });
119
101
  * ```
120
102
  */
121
- getHistoricalEvents(params: GetHistoricalEventsParams): Promise<HistoricalEvent[]>;
103
+ getHistoricalOdds(params: GetHistoricalOddsParams): Promise<HistoricalEventOdds>;
122
104
  /**
123
- * Get closing odds for a historical event
124
- *
125
- * @param params - Historical odds query parameters
126
- * @returns Historical event odds data
105
+ * Closing odds for every settled event across up to 10 leagues (paid plans).
106
+ * Up to 366 days per call, 100 events per page (see `iterateClosingLines`).
127
107
  *
128
108
  * @example
129
109
  * ```typescript
130
- * const odds = await client.getHistoricalOdds({
131
- * eventId: '67697888',
132
- * bookmakers: 'singbet,bet365'
110
+ * const lines = await client.getClosingLines({
111
+ * sport: 'football',
112
+ * leagues: ['england-premier-league'],
113
+ * from: '2026-08-01T00:00:00Z',
114
+ * to: '2026-10-31T23:59:59Z',
115
+ * markets: ['ML', 'Totals'],
116
+ * bookmakers: ['Bet365'],
133
117
  * });
134
118
  * ```
135
119
  */
136
- getHistoricalOdds(params: GetHistoricalOddsParams): Promise<HistoricalEventOdds>;
120
+ getClosingLines(params: GetClosingLinesParams): Promise<HistoricalEventOdds[]>;
121
+ /** Every closing line matching the filters, paging with limit and skip. */
122
+ iterateClosingLines(params: GetClosingLinesParams, options?: PageOptions): AsyncGenerator<HistoricalEventOdds>;
137
123
  /**
138
- * Get odds for a specific event
139
- *
140
- * @param params - Odds query parameters
141
- * @returns Event odds data
124
+ * Odds for one event. Pass `markets` to keep the response small.
142
125
  *
143
126
  * @example
144
127
  * ```typescript
145
- * const odds = await client.getEventOdds({
146
- * eventId: '62924717',
147
- * bookmakers: 'singbet,bet365'
148
- * });
128
+ * const odds = await client.getEventOdds({ eventId: 62924717, bookmakers: ['Bet365', 'SingBet'], markets: ['ML', 'Totals'] });
129
+ * const ml = odds.bookmakers['Bet365']?.find((m) => m.name === 'ML');
149
130
  * ```
150
131
  */
151
132
  getEventOdds(params: GetOddsParams): Promise<EventOdds>;
133
+ /** Odds for up to 10 events in one request. */
134
+ getOddsForMultipleEvents(params: GetMultiEventOddsParams): Promise<EventOdds[]>;
152
135
  /**
153
- * Track odds movements for an event
154
- *
155
- * @param params - Odds movement parameters
156
- * @returns Historical odds movements
157
- *
158
- * @example
159
- * ```typescript
160
- * const movements = await client.getOddsMovement({
161
- * eventId: '62924717',
162
- * bookmaker: 'singbet',
163
- * market: 'moneyline'
164
- * });
165
- * ```
136
+ * Odds for up to 10 events plus the WebSocket sequence at that moment.
137
+ * Rebuild state from `data`, then connect or reconnect with `lastSeq: seq`.
166
138
  */
167
- getOddsMovement(params: GetOddsMovementParams): Promise<OddsMovement>;
139
+ getOddsSnapshot(params: GetMultiEventOddsParams): Promise<OddsSnapshot>;
140
+ private multiOddsQuery;
168
141
  /**
169
- * Get odds for multiple events at once
170
- *
171
- * @param params - Multi-event odds parameters
172
- * @returns Array of event odds
142
+ * Price history for one market at one bookmaker (prematch only).
173
143
  *
174
144
  * @example
175
145
  * ```typescript
176
- * const odds = await client.getOddsForMultipleEvents({
177
- * eventIds: '12345,67890',
178
- * bookmakers: 'singbet,bet365'
179
- * });
146
+ * const history = await client.getOddsMovement({ eventId: 62924717, bookmaker: 'Bet365', market: 'ML' });
180
147
  * ```
181
148
  */
182
- getOddsForMultipleEvents(params: GetMultiEventOddsParams): Promise<EventOdds[]>;
149
+ getOddsMovement(params: GetOddsMovementParams): Promise<OddsMovement>;
183
150
  /**
184
- * Get odds updated since a given timestamp
185
- *
186
- * @param params - Updated odds parameters
187
- * @returns Array of updated event odds
188
- *
189
- * @example
190
- * ```typescript
191
- * const updatedOdds = await client.getUpdatedOddsSince({
192
- * since: Math.floor(Date.now() / 1000) - 20, // seconds, at most 90 old
193
- * bookmaker: 'Bet365',
194
- * sport: 'football',
195
- * markets: 'ML,Spread,Totals', // required from 15 October 2026
196
- * });
197
- * ```
151
+ * Market groups changed since `since` for one bookmaker and sport. The result
152
+ * is a delta: merge it into what you hold, keyed by event and market.
153
+ * See `pollUpdatedOdds` for a loop that follows X-Next-Since.
198
154
  */
199
155
  getUpdatedOddsSince(params: GetUpdatedOddsSinceParams): Promise<EventOdds[]>;
156
+ /** Like `getUpdatedOddsSince`, plus the X-Next-Since, X-Server-Time and X-Unknown-Markets headers. */
157
+ getUpdatedOddsSinceWithMeta(params: GetUpdatedOddsSinceParams): Promise<UpdatedOddsResult>;
200
158
  /**
201
- * Get participants (teams/players) for a sport
202
- *
203
- * @param params - Participant query parameters
204
- * @returns List of participants
159
+ * Polls `/odds/updated`, passing each X-Next-Since as the next `since`.
160
+ * A page cut short by `limit` is followed up at once.
205
161
  *
206
162
  * @example
207
163
  * ```typescript
208
- * const participants = await client.getParticipants({
209
- * sport: 'basketball',
210
- * search: 'Warriors'
211
- * });
164
+ * const controller = new AbortController();
165
+ * for await (const batch of client.pollUpdatedOdds({ bookmaker: 'Bet365', sport: 'football', markets: ['ML'], signal: controller.signal })) {
166
+ * for (const event of batch.data) merge(event);
167
+ * }
212
168
  * ```
213
169
  */
170
+ pollUpdatedOdds(params: PollUpdatedOddsParams): AsyncGenerator<UpdatedOddsResult>;
171
+ /**
172
+ * Best, average, median, worst and fair price per market line across
173
+ * bookmakers (Growth plans and above; lower plans get `demo: true`).
174
+ */
175
+ getOddsSummary(params: GetOddsSummaryParams): Promise<EventSummary>;
176
+ /** `getOddsSummary` for up to 10 events in one request. */
177
+ getOddsSummaryMulti(params: GetOddsSummaryMultiParams): Promise<EventSummary[]>;
178
+ private summaryQuery;
179
+ /** Teams and players for a sport. */
214
180
  getParticipants(params: GetParticipantsParams): Promise<Participant[]>;
181
+ /** One participant by id. */
182
+ getParticipantById(participantId: number | string): Promise<Participant>;
215
183
  /**
216
- * Get a specific participant by ID
217
- *
218
- * @param participantId - Participant ID
219
- * @returns Participant details
220
- *
221
- * @example
222
- * ```typescript
223
- * const participant = await client.getParticipantById(3428);
224
- * ```
184
+ * URL of a participant's PNG logo (use `homeId`/`awayId` from events).
185
+ * The URL carries your API key, so only hand it to a browser you trust;
186
+ * otherwise proxy it with `getParticipantLogo`.
225
187
  */
226
- getParticipantById(participantId: number): Promise<Participant>;
188
+ getParticipantLogoUrl(participantId: number | string): string;
189
+ /** A participant's logo as PNG bytes. Throws NotFoundError when there is none. */
190
+ getParticipantLogo(participantId: number | string): Promise<ArrayBuffer>;
191
+ /** All bookmakers with their current status. No API key needed. */
192
+ getBookmakers(): Promise<Bookmaker[]>;
193
+ /** The bookmakers selected on your key. */
194
+ getSelectedBookmakers(): Promise<SelectedBookmakers>;
195
+ /** Add bookmakers to your selection. */
196
+ selectBookmakers(bookmakers: CommaList): Promise<SelectedBookmakers>;
197
+ /** Clear your selection. Allowed once every 12 hours. */
198
+ clearSelectedBookmakers(): Promise<SelectedBookmakers>;
227
199
  /**
228
- * Get all available bookmakers
229
- *
230
- * @returns List of bookmakers
200
+ * Price gaps across your bookmakers where the best prices imply under 100%
201
+ * (prematch only, refreshed every few seconds). Prices move and limits
202
+ * apply, so check every leg before acting.
231
203
  *
232
204
  * @example
233
205
  * ```typescript
234
- * const bookmakers = await client.getBookmakers();
206
+ * const arbs = await client.getArbitrageBets({ bookmakers: ['Bet365', 'SingBet'], sport: 'football', minProfit: 1 });
235
207
  * ```
236
208
  */
237
- getBookmakers(): Promise<Bookmaker[]>;
209
+ getArbitrageBets(params: GetArbitrageBetsParams): Promise<ArbitrageBet[]>;
210
+ /** Prices above a fair-odds estimate at one bookmaker. */
211
+ getValueBets(params: GetValueBetsParams): Promise<ValueBet[]>;
238
212
  /**
239
- * Get your selected bookmakers
240
- *
241
- * @returns List of selected bookmakers
213
+ * Dropping odds from sharp bookmakers (paid plans).
242
214
  *
243
215
  * @example
244
216
  * ```typescript
245
- * const selected = await client.getSelectedBookmakers();
217
+ * const drops = await client.getDroppingOdds({ sport: 'football', markets: ['ML'], minDrop: 10 });
246
218
  * ```
247
219
  */
248
- getSelectedBookmakers(): Promise<Bookmaker[]>;
220
+ getDroppingOdds(params?: GetDroppingOddsParams): Promise<DroppingOddsEntry[]>;
221
+ /** Like `getDroppingOdds`, plus the pagination headers. */
222
+ getDroppingOddsPage(params?: GetDroppingOddsParams): Promise<DroppingOddsPage>;
223
+ /** Every dropping-odds entry matching the filters, page by page. */
224
+ iterateDroppingOdds(params?: GetDroppingOddsParams, options?: PageOptions): AsyncGenerator<DroppingOddsEntry>;
249
225
  /**
250
- * Select specific bookmakers for your account
251
- *
252
- * @param bookmakers - Comma-separated bookmaker IDs
253
- * @returns Success response
226
+ * Settlement records (status, final flag, final scores) for events (paid plans).
227
+ * More than 50 ids are split into several requests.
254
228
  *
255
229
  * @example
256
230
  * ```typescript
257
- * await client.selectBookmakers('singbet,bet365');
231
+ * const { settlements, notFound } = await client.getSettlements([74919888, 73101436]);
258
232
  * ```
259
233
  */
260
- selectBookmakers(bookmakers: string): Promise<{
261
- success: boolean;
262
- }>;
234
+ getSettlements(eventIds: CommaList<string | number>): Promise<SettlementsResponse>;
263
235
  /**
264
- * Clear your selected bookmakers
265
- *
266
- * @returns Success response
236
+ * Grade bet selections against final results (paid plans). Returns one grade
237
+ * per selection, in order. More than 50 selections are sent in batches.
238
+ * Re-send selections that are not `final`, at most once a minute.
267
239
  *
268
240
  * @example
269
241
  * ```typescript
270
- * await client.clearSelectedBookmakers();
242
+ * const { grades } = await client.gradeBets([
243
+ * { ref: 'bet-1', eventId: 74919888, market: 'Spread', hdp: -0.75, side: 'home' },
244
+ * ]);
271
245
  * ```
272
246
  */
273
- clearSelectedBookmakers(): Promise<{
274
- success: boolean;
275
- }>;
247
+ gradeBets(selections: GradeSelection[]): Promise<GradesResponse>;
248
+ /** Same as `gradeBets` (the API operation is called GradeSelections). */
249
+ gradeSelections(selections: GradeSelection[]): Promise<GradesResponse>;
276
250
  /**
277
- * Find arbitrage betting opportunities
278
- *
279
- * @param params - Arbitrage bet parameters
280
- * @returns List of arbitrage opportunities
251
+ * Tournaments for a sport (golf today), sorted by date.
281
252
  *
282
253
  * @example
283
254
  * ```typescript
284
- * const arbs = await client.getArbitrageBets({
285
- * bookmakers: 'singbet,bet365',
286
- * limit: 10,
287
- * includeEventDetails: true
288
- * });
255
+ * const tournaments = await client.getOutrights({ sport: 'golf', league: 'pga-tour' });
289
256
  * ```
290
257
  */
291
- getArbitrageBets(params: GetArbitrageBetsParams): Promise<ArbitrageBet[]>;
258
+ getOutrights(params: GetOutrightsParams): Promise<Outright[]>;
292
259
  /**
293
- * Find value betting opportunities
294
- *
295
- * @param params - Value bet parameters
296
- * @returns List of value bets
260
+ * Prices for one tournament: Winner, Top 5/10/20, the "(Incl. Ties)"
261
+ * variants and Make Cut, per bookmaker.
297
262
  *
298
263
  * @example
299
264
  * ```typescript
300
- * const valueBets = await client.getValueBets({
301
- * bookmaker: 'singbet',
302
- * includeEventDetails: true
303
- * });
265
+ * const odds = await client.getOutrightOdds({ id: 1001, bookmakers: ['DraftKings', 'Betfair Exchange'] });
304
266
  * ```
305
267
  */
306
- getValueBets(params: GetValueBetsParams): Promise<ValueBet[]>;
268
+ getOutrightOdds(params: GetOutrightOddsParams): Promise<OutrightOdds>;
269
+ /** Final positions and winners per market for one tournament. */
270
+ getOutrightResults(id: string | number): Promise<OutrightResults>;
307
271
  /**
308
- * Get dropping odds from sharp bookmakers.
309
- * @example
310
- * const drops = await client.getDroppingOdds({
311
- * sport: 'football',
312
- * market: 'ML',
313
- * minDrop: 10,
314
- * includeEventDetails: true
315
- * });
272
+ * A bookmaker's own event, market and outcome ids for our events (paid plans).
273
+ * Without eventId(s), marketId(s) or outcomeId it is a bulk sync with a cursor.
316
274
  */
317
- getDroppingOdds(params?: GetDroppingOddsParams): Promise<DroppingOddsEntry[]>;
275
+ getMappings(params: GetMappingsParams): Promise<MappingsPage>;
276
+ /** Every mapping row, following `nextCursor` until it is null. */
277
+ iterateMappings(params: GetMappingsParams, options?: PageOptions): AsyncGenerator<Mapping>;
318
278
  }
319
279
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,EACL,MAAM,EACN,KAAK,EACL,eAAe,EACf,WAAW,EACX,SAAS,EACT,SAAS,EACT,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,yBAAyB,EACzB,aAAa,EACb,uBAAuB,EACvB,qBA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M,EAAE,kBAAkB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAInE;;;;;;;;OAQG;IACG,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,YAAY,CAAC;IAI3E,iEAAiE;IAC3D,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAQvE;;;OAGG;IACG,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC;IAQnE,kEAAkE;IAC3D,eAAe,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,GAAE,WAAgB,GAAG,cAAc,CAAC,OAAO,CAAC;CAUtG"}
@@ -1,39 +1,63 @@
1
- /**
2
- * Custom error classes for Odds-API.io client
3
- */
4
- /**
5
- * Base error class for all Odds-API.io errors
6
- */
1
+ import type { RateLimitInfo } from './types.js';
2
+ export interface OddsAPIErrorDetails {
3
+ status?: number;
4
+ /** The raw response body. */
5
+ body?: string;
6
+ rateLimit?: RateLimitInfo;
7
+ }
8
+ /** Base class for every error the SDK throws. `message` is the server's own error text when there is one. */
7
9
  export declare class OddsAPIError extends Error {
8
- constructor(message: string);
10
+ readonly status?: number;
11
+ readonly body?: string;
12
+ readonly rateLimit?: RateLimitInfo;
13
+ constructor(message: string, details?: OddsAPIErrorDetails);
9
14
  }
10
- /**
11
- * Thrown when the API key is invalid or missing
12
- */
15
+ /** 400: a parameter is missing or invalid. */
16
+ export declare class BadRequestError extends OddsAPIError {
17
+ constructor(message?: string, details?: OddsAPIErrorDetails);
18
+ }
19
+ /** 401: the API key is invalid or missing. */
13
20
  export declare class InvalidAPIKeyError extends OddsAPIError {
14
- constructor(message?: string);
21
+ constructor(message?: string, details?: OddsAPIErrorDetails);
15
22
  }
16
23
  /**
17
- * Thrown when rate limit is exceeded
24
+ * 403: the key's plan does not include this endpoint or bookmaker, or it lacks
25
+ * an add-on such as Outrights. The message says which, with a link to fix it.
18
26
  */
19
- export declare class RateLimitExceededError extends OddsAPIError {
20
- constructor(message?: string);
27
+ export declare class ForbiddenError extends OddsAPIError {
28
+ constructor(message?: string, details?: OddsAPIErrorDetails);
29
+ /** True when the 403 is about a paid add-on (for example Outrights). */
30
+ get isAddOnRequired(): boolean;
21
31
  }
22
- /**
23
- * Thrown when a resource is not found (404)
24
- */
32
+ /** 404: the resource does not exist. The message often lists what does. */
25
33
  export declare class NotFoundError extends OddsAPIError {
26
- constructor(message?: string);
34
+ constructor(message?: string, details?: OddsAPIErrorDetails);
27
35
  }
28
- /**
29
- * Thrown when request times out
30
- */
36
+ /** 429: rate limit reached. */
37
+ export declare class RateLimitError extends OddsAPIError {
38
+ /** Seconds to wait before retrying, from Retry-After or the rate-limit reset header. */
39
+ readonly retryAfter?: number;
40
+ constructor(message?: string, details?: OddsAPIErrorDetails & {
41
+ retryAfter?: number;
42
+ });
43
+ }
44
+ /** @deprecated Use `RateLimitError`; this is the same class. */
45
+ export declare const RateLimitExceededError: typeof RateLimitError;
46
+ /** @deprecated Use `RateLimitError`. */
47
+ export type RateLimitExceededError = RateLimitError;
48
+ /** 5xx: the server failed or is busy. */
49
+ export declare class ServerError extends OddsAPIError {
50
+ /** Seconds the server asked to wait (Retry-After), when it sent one. */
51
+ readonly retryAfter?: number;
52
+ constructor(message?: string, details?: OddsAPIErrorDetails & {
53
+ retryAfter?: number;
54
+ });
55
+ }
56
+ /** The request took longer than the configured timeout. */
31
57
  export declare class TimeoutError extends OddsAPIError {
32
58
  constructor(message?: string);
33
59
  }
34
- /**
35
- * Thrown when network request fails
36
- */
60
+ /** The request never reached the server or the connection failed. */
37
61
  export declare class NetworkError extends OddsAPIError {
38
62
  constructor(message: string);
39
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM;CAK5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E,wEAAwE;IACxE,IAAI,eAAe,IAAI,OAAO,CAE7B;CACF;AAED,2EAA2E;AAC3E,qBAAa,aAAc,SAAQ,YAAY;gBACjC,OAAO,SAAuB,EAAE,OAAO,GAAE,mBAAwB;CAI9E;AAED,+BAA+B;AAC/B,qBAAa,cAAe,SAAQ,YAAY;IAC9C,wFAAwF;IACxF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;gBAG3B,OAAO,SAAwB,EAC/B,OAAO,GAAE,mBAAmB,GAAG;QAAE,UAAU,CAAC,EAAE,MAAM,CAAA;KAAO;CAM9D;AAED,gEAAgE;AAChE,eAAO,MAAM,sBAAsB,uBAAiB,CAAC;AACrD,wCAAwC;AACxC,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC;AAEpD,yCAAyC;AACzC,qBAAa,WAAY,SAAQ,YAAY;IAC3C,wEAAwE;IACxE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;gBAEjB,OAAO,SAAiB,EAAE,OAAO,GAAE,mBAAmB,GAAG;QAAE,UAAU,CAAC,EAAE,MAAM,CAAA;KAAO;CAKlG;AAED,2DAA2D;AAC3D,qBAAa,YAAa,SAAQ,YAAY;gBAChC,OAAO,SAAoB;CAIxC;AAED,qEAAqE;AACrE,qBAAa,YAAa,SAAQ,YAAY;gBAChC,OAAO,EAAE,MAAM;CAI5B"}
@@ -0,0 +1,6 @@
1
+ import type { OutrightRunner, OutrightYesNoRunner, OutrightPriceRunner } from './types.js';
2
+ /** True for Make Cut style runners (yes/no prices) rather than Winner/Top N runners (odds/layOdds). */
3
+ export declare function isYesNoRunner(runner: OutrightRunner): runner is OutrightYesNoRunner;
4
+ /** True for Winner and Top N runners (odds, plus layOdds on exchanges). */
5
+ export declare function isPriceRunner(runner: OutrightRunner): runner is OutrightPriceRunner;
6
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE3F,uGAAuG;AACvG,wBAAgB,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,IAAI,mBAAmB,CAEnF;AAED,2EAA2E;AAC3E,wBAAgB,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,IAAI,mBAAmB,CAEnF"}
@@ -1,11 +1,16 @@
1
1
  /**
2
2
  * Odds-API.io Node.js SDK
3
3
  *
4
- * Official Node.js client for Odds-API.io - Real-time sports betting odds from 365+ bookmakers
4
+ * Official Node.js client for Odds-API.io: real-time sports betting odds from 450+ bookmakers.
5
5
  *
6
6
  * @packageDocumentation
7
7
  */
8
8
  export { OddsAPIClient } from './client.js';
9
- export { OddsAPIError, InvalidAPIKeyError, RateLimitExceededError, NotFoundError, TimeoutError, NetworkError, } from './errors.js';
10
- export type { OddsAPIClientConfig, Sport, League, Event, HistoricalSport, HistoricalLeague, HistoricalScore, HistoricalEvent, Participant, Bookmaker, MarketOdds, EventOdds, HistoricalEventOdds, HistoricalOddsMarket, HistoricalOddsSelection, OddsMovement, ArbitrageBet, ValueBet, GetEventsParams, GetHistoricalEventsParams, GetOddsParams, GetHistoricalOddsParams, GetOddsMovementParams, GetMultiEventOddsParams, GetUpdatedOddsSinceParams, GetParticipantsParams, GetArbitrageBetsParams, GetValueBetsParams, DroppingOddsEntry, GetDroppingOddsParams, } from './types.js';
9
+ export { OddsWebSocket, OddsWebSocketError } from './websocket.js';
10
+ export { VERSION } from './version.js';
11
+ export { isYesNoRunner, isPriceRunner } from './helpers.js';
12
+ export { OddsAPIError, BadRequestError, InvalidAPIKeyError, ForbiddenError, NotFoundError, RateLimitError, RateLimitExceededError, ServerError, TimeoutError, NetworkError, } from './errors.js';
13
+ export type { OddsAPIErrorDetails } from './errors.js';
14
+ export type { OddsWebSocketOptions, OddsWebSocketEvents, WebSocketLike, WebSocketConstructor, WsChannel, WsMessage, WsWelcomeMessage, WsOddsMessage, WsScoreMessage, WsStatusMessage, WsResyncRequiredMessage, WsReplayCompleteMessage, WsCloseInfo, WsReconnectInfo, } from './websocket.js';
15
+ export type { CommaList, MarketName, Sport, League, NamedSlug, Bookmaker, SelectedBookmakers, MarketInfo, MarketsResponse, MarketsBySport, EventStatus, PeriodKey, PeriodScore, Score, Clock, EsportsDetails, Event, HistoricalEvent, Participant, OddsLine, Market, EventOdds, HistoricalEventOdds, MarketOdds, HistoricalOddsMarket, HistoricalOddsSelection, HistoricalSport, HistoricalLeague, HistoricalScore, OddsMovementPoint, OddsMovement, UpdatedOddsResult, OddsSnapshot, SummaryOutcome, SummaryExchangeQuote, SummaryLine, SummaryMarket, EventSummary, EventInfo, BetSide, ArbitrageLeg, OptimalStake, ArbitrageBet, ValueBet, DroppingOddsEntry, DroppingOddsPage, Settlement, SettlementsResponse, GradeSelection, GradeResult, GradeReason, Grade, GradesResponse, OutrightMarketName, Outright, OutrightPriceRunner, OutrightYesNoRunner, OutrightRunner, OutrightMarket, OutrightOdds, OutrightResultRow, OutrightResults, Mapping, MappingsPage, RateLimitInfo, OddsAPIClientConfig, GetLeaguesOptions, GetEventsParams, SearchEventsOptions, GetHistoricalEventsParams, SearchHistoricalEventsParams, GetOddsParams, GetMultiEventOddsParams, GetHistoricalOddsParams, GetClosingLinesParams, GetOddsMovementParams, GetUpdatedOddsSinceParams, PollUpdatedOddsParams, GetOddsSummaryParams, GetOddsSummaryMultiParams, GetParticipantsParams, GetArbitrageBetsParams, GetValueBetsParams, GetDroppingOddsParams, GetOutrightsParams, GetOutrightOddsParams, GetMappingsParams, PageOptions, } from './types.js';
11
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,YAAY,EACZ,YAAY,GACb,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,mBAAmB,EACnB,KAAK,EACL,MAAM,EACN,KAAK,EACL,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,WAAW,EACX,SAAS,EACT,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,yBAAyB,EACzB,aAAa,EACb,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE5D,OAAO,EACL,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,WAAW,EACX,YAAY,EACZ,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,WAAW,EACX,eAAe,GAChB,MAAM,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