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.
- package/README.md +324 -249
- package/dist/cjs/client.d.ts +278 -0
- package/dist/cjs/client.js +536 -292
- package/dist/cjs/client.js.map +1 -1
- package/dist/cjs/errors.d.ts +63 -0
- package/dist/cjs/errors.js +54 -36
- package/dist/cjs/errors.js.map +1 -1
- package/dist/cjs/helpers.d.ts +5 -0
- package/dist/cjs/helpers.js +13 -0
- package/dist/cjs/helpers.js.map +1 -0
- package/dist/cjs/index.d.ts +15 -0
- package/dist/cjs/index.js +15 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/types.d.ts +770 -0
- package/dist/cjs/types.js +4 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -0
- package/dist/cjs/version.js +5 -0
- package/dist/cjs/version.js.map +1 -0
- package/dist/cjs/websocket.d.ts +210 -0
- package/dist/cjs/websocket.js +405 -0
- package/dist/cjs/websocket.js.map +1 -0
- package/dist/esm/client.d.ts +278 -0
- package/dist/esm/client.js +537 -293
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/errors.d.ts +63 -0
- package/dist/esm/errors.js +49 -34
- package/dist/esm/errors.js.map +1 -1
- package/dist/esm/helpers.d.ts +5 -0
- package/dist/esm/helpers.js +9 -0
- package/dist/esm/helpers.js.map +1 -0
- package/dist/esm/index.d.ts +15 -0
- package/dist/esm/index.js +5 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +1 -0
- package/dist/esm/types.d.ts +770 -0
- package/dist/esm/types.js +4 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/version.d.ts +1 -0
- package/dist/esm/version.js +2 -0
- package/dist/esm/version.js.map +1 -0
- package/dist/esm/websocket.d.ts +210 -0
- package/dist/esm/websocket.js +367 -0
- package/dist/esm/websocket.js.map +1 -0
- package/dist/types/client.d.ts +155 -195
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/errors.d.ts +48 -24
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/helpers.d.ts +6 -0
- package/dist/types/helpers.d.ts.map +1 -0
- package/dist/types/index.d.ts +8 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types.d.ts +659 -187
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/version.d.ts +2 -0
- package/dist/types/version.d.ts.map +1 -0
- package/dist/types/websocket.d.ts +211 -0
- package/dist/types/websocket.d.ts.map +1 -0
- package/package.json +46 -16
package/dist/types/client.d.ts
CHANGED
|
@@ -1,319 +1,279 @@
|
|
|
1
|
-
import { OddsAPIClientConfig, Sport, League, Event, HistoricalEvent, Participant, Bookmaker, EventOdds, HistoricalEventOdds, OddsMovement, ArbitrageBet, ValueBet, GetEventsParams, GetHistoricalEventsParams, GetOddsParams, GetHistoricalOddsParams,
|
|
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:
|
|
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
|
-
*
|
|
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
|
|
38
|
-
* console.log(`Found ${sports.length} sports`);
|
|
36
|
+
* const leagues = await client.getLeagues('football');
|
|
39
37
|
* ```
|
|
40
38
|
*/
|
|
41
|
-
|
|
39
|
+
getLeagues(sport: string, options?: GetLeaguesOptions): Promise<League[]>;
|
|
42
40
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
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
|
|
47
|
+
* const { markets } = await client.getMarkets('football');
|
|
51
48
|
* ```
|
|
52
49
|
*/
|
|
53
|
-
|
|
50
|
+
getMarkets(sport: string): Promise<MarketsResponse>;
|
|
51
|
+
getMarkets(): Promise<MarketsBySport>;
|
|
54
52
|
/**
|
|
55
|
-
*
|
|
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
|
-
*
|
|
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
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
|
82
|
+
* const live = await client.searchEvents('Liverpool', { status: 'live' });
|
|
90
83
|
* ```
|
|
91
84
|
*/
|
|
92
|
-
|
|
85
|
+
searchEvents(query: string, options?: SearchEventsOptions): Promise<Event[]>;
|
|
93
86
|
/**
|
|
94
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
|
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
|
-
|
|
103
|
+
getHistoricalOdds(params: GetHistoricalOddsParams): Promise<HistoricalEventOdds>;
|
|
122
104
|
/**
|
|
123
|
-
*
|
|
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
|
|
131
|
-
*
|
|
132
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
|
|
139
|
+
getOddsSnapshot(params: GetMultiEventOddsParams): Promise<OddsSnapshot>;
|
|
140
|
+
private multiOddsQuery;
|
|
168
141
|
/**
|
|
169
|
-
*
|
|
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
|
|
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
|
-
|
|
149
|
+
getOddsMovement(params: GetOddsMovementParams): Promise<OddsMovement>;
|
|
183
150
|
/**
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
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
|
-
*
|
|
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
|
|
209
|
-
*
|
|
210
|
-
*
|
|
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
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
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
|
|
206
|
+
* const arbs = await client.getArbitrageBets({ bookmakers: ['Bet365', 'SingBet'], sport: 'football', minProfit: 1 });
|
|
235
207
|
* ```
|
|
236
208
|
*/
|
|
237
|
-
|
|
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
|
-
*
|
|
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
|
|
217
|
+
* const drops = await client.getDroppingOdds({ sport: 'football', markets: ['ML'], minDrop: 10 });
|
|
246
218
|
* ```
|
|
247
219
|
*/
|
|
248
|
-
|
|
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
|
-
*
|
|
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.
|
|
231
|
+
* const { settlements, notFound } = await client.getSettlements([74919888, 73101436]);
|
|
258
232
|
* ```
|
|
259
233
|
*/
|
|
260
|
-
|
|
261
|
-
success: boolean;
|
|
262
|
-
}>;
|
|
234
|
+
getSettlements(eventIds: CommaList<string | number>): Promise<SettlementsResponse>;
|
|
263
235
|
/**
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
*
|
|
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.
|
|
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
|
-
|
|
274
|
-
|
|
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
|
-
*
|
|
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
|
|
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
|
-
|
|
258
|
+
getOutrights(params: GetOutrightsParams): Promise<Outright[]>;
|
|
292
259
|
/**
|
|
293
|
-
*
|
|
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
|
|
301
|
-
* bookmaker: 'singbet',
|
|
302
|
-
* includeEventDetails: true
|
|
303
|
-
* });
|
|
265
|
+
* const odds = await client.getOutrightOdds({ id: 1001, bookmakers: ['DraftKings', 'Betfair Exchange'] });
|
|
304
266
|
* ```
|
|
305
267
|
*/
|
|
306
|
-
|
|
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
|
-
*
|
|
309
|
-
*
|
|
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
|
-
|
|
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,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,aAAa,EACb,KAAK,EACL,MAAM,EACN,KAAK,EACL,eAAe,EACf,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,OAAO,EACP,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,yBAAyB,EACzB,4BAA4B,EAC5B,aAAa,EACb,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,qBAAq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
-
|
|
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
|
-
|
|
10
|
+
readonly status?: number;
|
|
11
|
+
readonly body?: string;
|
|
12
|
+
readonly rateLimit?: RateLimitInfo;
|
|
13
|
+
constructor(message: string, details?: OddsAPIErrorDetails);
|
|
9
14
|
}
|
|
10
|
-
/**
|
|
11
|
-
|
|
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
|
-
*
|
|
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
|
|
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
|
-
|
|
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
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAA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AAG,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"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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 -
|
|
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 {
|
|
10
|
-
export
|
|
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;
|
|
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,uBAA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