Skip to content

Commit ecb2048

Browse files
Mlaz-codeclaude
andcommitted
fix: align OpenAPI spec, SDK docs, and API reference with canonical field names
OpenAPI spec used deprecated field names (ev_percent, true_probability, devig_book, kelly_fraction) that didn't match the canonical API response fields. Updated to ev_percentage, fair_probability, sharp_book, kelly_percent across EVOpportunity and HistoricalOpportunity schemas, examples, and all doc pages. Fixed SDK install command (@sharpapi/client → @sharp-api/client) and class names in llms-full.txt. Added llms.txt discovery link tags to HTML head via Next.js Metadata API. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f199545 commit ecb2048

11 files changed

Lines changed: 54 additions & 46 deletions

File tree

app/layout.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ export const metadata: Metadata = {
1919
siteName: 'SharpAPI Docs',
2020
images: [{ url: 'https://sharpapi.io/og-image.png', width: 1200, height: 630, alt: 'SharpAPI - Sports Betting Odds API' }],
2121
},
22+
alternates: {
23+
types: {
24+
'text/plain': [
25+
{ url: 'https://docs.sharpapi.io/llms.txt', title: 'LLM-friendly documentation' },
26+
{ url: 'https://docs.sharpapi.io/llms-full.txt', title: 'LLM-friendly full documentation' },
27+
],
28+
},
29+
},
2230
}
2331

2432
export default function RootLayout({ children }) {

content/en/api-reference/opportunities-ev.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ GET /api/v1/opportunities/ev
1313
```
1414

1515
<Callout type="info">
16-
This endpoint replaces the former `/positive-ev` and `/value-bets` endpoints. All scoring fields (`confidence_score`, `kelly_fraction`, `fair_probability`) are now included in every response.
16+
This endpoint replaces the former `/positive-ev` and `/value-bets` endpoints. All scoring fields (`confidence_score`, `kelly_percent`, `fair_probability`) are now included in every response.
1717
</Callout>
1818

1919
## Authentication
@@ -38,7 +38,7 @@ Requires API key. **Pro tier or higher required.** Your account must have the `e
3838
| `max_market_width` | number || Maximum market width |
3939
| `max_odds_age` | number || Maximum odds age in seconds. Filters out stale opportunities where the underlying odds are older than this threshold. |
4040
| `date_range` | string || Filter by event date: `today`, `tomorrow`, or `week`. Dates are evaluated in **US Eastern Time (ET)**. |
41-
| `sort` | string | `-ev` | Sort field. Options: `ev`, `confidence`/`confidence_score`, `kelly`/`kelly_fraction`, `time`/`start_time`, `book_count`/`books`. Prefix with `-` for descending. |
41+
| `sort` | string | `-ev` | Sort field. Options: `ev`, `confidence`/`confidence_score`, `kelly`/`kelly_percent`, `time`/`start_time`, `book_count`/`books`. Prefix with `-` for descending. |
4242
| `limit` | integer | 50 | Results per page (max 200) |
4343
| `offset` | integer | 0 | Pagination offset (max 5000) |
4444

@@ -121,7 +121,7 @@ for opp in data['data']:
121121
"start_time": "2026-02-08T19:00:00Z",
122122
"is_live": false,
123123
"confidence_score": 87,
124-
"kelly_fraction": 0.021,
124+
"kelly_percent": 0.021,
125125
"book_count": 5,
126126
"arb_available": false,
127127
"arb_profit": null,
@@ -251,7 +251,7 @@ X-Request-Id: req_abc123def456
251251
| `start_time` | string\|null | ISO 8601 event start time |
252252
| `is_live` | boolean | Whether the event is currently live |
253253
| `confidence_score` | number | Multi-factor confidence score (0-100) |
254-
| `kelly_fraction` | number\|null | Kelly criterion optimal bet fraction (0.0 to 1.0) |
254+
| `kelly_percent` | number\|null | Kelly criterion optimal bet fraction (0.0 to 1.0) |
255255
| `book_count` | number | Number of sportsbooks offering this market |
256256
| `arb_available` | boolean | Whether an arbitrage exists on this market |
257257
| `arb_profit` | number\|null | Arbitrage profit percentage if available |
@@ -348,7 +348,7 @@ We recommend setting `min_ev=2` for most use cases. Marginal EV (below 2%) can b
348348

349349
## Kelly Criterion
350350

351-
The `kelly_fraction` field tells you the optimal fraction of your bankroll to wager according to the Kelly criterion (0.0 to 1.0, e.g. `0.021` = 2.1%):
351+
The `kelly_percent` field tells you the optimal fraction of your bankroll to wager according to the Kelly criterion (0.0 to 1.0, e.g. `0.021` = 2.1%):
352352

353353
```
354354
Kelly% = (edge / odds_to_1) = (fair_prob x decimal_odds - 1) / (decimal_odds - 1)
@@ -370,7 +370,7 @@ Kelly% = (edge / odds_to_1) = (fair_prob x decimal_odds - 1) / (decimal_odds - 1
370370
## Best Practices
371371

372372
1. **Set a minimum EV threshold** - Use `min_ev=2` or higher to focus on meaningful edges
373-
2. **Use Kelly sizing** - Use `kelly_fraction` to determine bet size (multiply by bankroll)
373+
2. **Use Kelly sizing** - Use `kelly_percent` to determine bet size (multiply by bankroll)
374374
3. **Filter by confidence** - Use `confidence_score` to prioritize high-confidence opportunities
375375
4. **Monitor `market_width`** - Narrow markets (low width) indicate more efficient pricing and more reliable EV calculations
376376
5. **Act quickly** - +EV opportunities are fleeting; lines move fast

content/en/api-reference/stream.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ A new positive expected value opportunity has been found. Only sent on `opportun
112112
```
113113
event: ev:detected
114114
id: evt_00043
115-
data: [{"id":"a1b2c3d4e5f6","game_id":"nba_phosuns_phi76ers_2026-02-08","ev_percentage":4.35,"odds_american":-105,"odds_decimal":1.952,"no_vig_odds":-101,"selection":"PHO Suns -3.5","market":"point_spread","line":-3.5,"sportsbook":"draftkings","game":"PHO Suns @ PHI 76ers","sport":"basketball","league":"nba","home_team":"PHI 76ers","away_team":"PHO Suns","start_time":"2026-02-08T19:00:00.000Z","is_live":false,"confidence_score":72,"kelly_fraction":0.038,"book_count":4,"detected_at":"2026-02-08T18:47:20.000Z"}]
115+
data: [{"id":"a1b2c3d4e5f6","game_id":"nba_phosuns_phi76ers_2026-02-08","ev_percentage":4.35,"odds_american":-105,"odds_decimal":1.952,"no_vig_odds":-101,"selection":"PHO Suns -3.5","market":"point_spread","line":-3.5,"sportsbook":"draftkings","game":"PHO Suns @ PHI 76ers","sport":"basketball","league":"nba","home_team":"PHI 76ers","away_team":"PHO Suns","start_time":"2026-02-08T19:00:00.000Z","is_live":false,"confidence_score":72,"kelly_percent":0.038,"book_count":4,"detected_at":"2026-02-08T18:47:20.000Z"}]
116116
```
117117

118118
### `ev:expired`

content/en/api-reference/websocket.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ Snapshot of opportunities for a single channel type. Sent once per subscribed op
209209
"start_time": "2026-02-08T19:00:00.000Z",
210210
"is_live": false,
211211
"confidence_score": 72,
212-
"kelly_fraction": 0.038,
212+
"kelly_percent": 0.038,
213213
"book_count": 4,
214214
"detected_at": "2026-02-08T18:47:20.000Z"
215215
}
@@ -322,7 +322,7 @@ New +EV opportunity found. Pro tier or higher only.
322322
"start_time": "2026-02-08T19:00:00.000Z",
323323
"is_live": false,
324324
"confidence_score": 72,
325-
"kelly_fraction": 0.038,
325+
"kelly_percent": 0.038,
326326
"book_count": 4,
327327
"detected_at": "2026-02-08T18:47:20.000Z"
328328
}

content/en/examples/value-betting.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async function sendAlert(opp) {
7070
{ name: 'Book', value: opp.sportsbook, inline: true },
7171
{ name: 'Odds', value: String(opp.odds_american), inline: true },
7272
{ name: 'EV', value: `+${opp.ev_percentage}%`, inline: true },
73-
{ name: 'Kelly', value: `${opp.kelly_fraction}`, inline: true },
73+
{ name: 'Kelly', value: `${opp.kelly_percent}`, inline: true },
7474
{ name: 'Devig', value: `${opp.no_vig_odds} (${opp.sharp_book})`, inline: true },
7575
)
7676
.setTimestamp();
@@ -130,7 +130,7 @@ Selection: ${opp.selection}
130130
Book: ${opp.sportsbook}
131131
Odds: ${opp.odds_american}
132132
EV: +${opp.ev_percentage}%
133-
Kelly: ${opp.kelly_fraction}
133+
Kelly: ${opp.kelly_percent}
134134
`.trim();
135135

136136
await bot.sendMessage(chatId, message, { parse_mode: 'Markdown' });

content/en/quickstart.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Response:
158158
"probability": 0.535
159159
},
160160
"ev_percentage": 4.35,
161-
"kelly_fraction": 0.0218
161+
"kelly_percent": 0.0218
162162
}
163163
],
164164
"meta": {

content/en/sdks/python.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ for arb in arbs.data:
4040
evs = client.ev.get(min_ev=3.0, sport="basketball")
4141
for opp in evs.data:
4242
print(f"+{opp.ev_percentage:.1f}% EV on {opp.selection} @ {opp.sportsbook}")
43-
if opp.kelly_fraction:
44-
print(f" Kelly: {opp.kelly_fraction:.1%}, Confidence: {opp.confidence_score}")
43+
if opp.kelly_percent:
44+
print(f" Kelly: {opp.kelly_percent:.1%}, Confidence: {opp.confidence_score}")
4545

4646
# Best odds across sportsbooks
4747
odds = client.odds.best(league="nba", market="moneyline")
@@ -83,7 +83,7 @@ for opp in evs.data:
8383
print(f"+{opp.ev_percentage:.1f}% on {opp.selection} @ {opp.sportsbook}")
8484
print(f" Fair probability: {opp.fair_probability}")
8585
print(f" Devig: {opp.devig_method} via {opp.sharp_book}")
86-
print(f" Kelly: {opp.kelly_fraction:.1%}")
86+
print(f" Kelly: {opp.kelly_percent:.1%}")
8787
print(f" Confidence: {opp.confidence_score}/100")
8888
```
8989

content/en/sdks/typescript.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ interface EVOpportunity {
115115
league: string;
116116
is_live: boolean;
117117
confidence_score: number;
118-
kelly_fraction: number | null;
118+
kelly_percent: number | null;
119119
possibly_stale: boolean;
120120
oldest_odds_age_seconds: number | null;
121121
warnings: string[];

public/llms-full.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ curl -H "X-API-Key: YOUR_KEY" \
869869
},
870870
"ev_percentage": 4.35,
871871
"edge": 0.023,
872-
"kelly_fraction": 0.0218,
872+
"kelly_percent": 0.0218,
873873
"kelly_half": 0.0109,
874874
"recommended_stake_pct": 1.09,
875875
"deep_link": "https://sportsbook.draftkings.com/...",
@@ -889,7 +889,7 @@ curl -H "X-API-Key: YOUR_KEY" \
889889

890890
**Key fields**:
891891
- `ev_percentage`: Expected value as a percentage (e.g., 4.35 = 4.35% edge)
892-
- `kelly_fraction`: Full Kelly criterion stake as fraction of bankroll
892+
- `kelly_percent`: Full Kelly criterion stake as fraction of bankroll
893893
- `kelly_half`: Half Kelly (more conservative, recommended)
894894
- `edge`: Raw probability edge (sharp probability - implied probability)
895895
- `sharp_odds`: Reference line from Pinnacle
@@ -1366,22 +1366,22 @@ SharpAPI uses canonical event IDs (e.g., `evt_nba_lal_bos_20260126`) to match th
13661366

13671367
### TypeScript / JavaScript
13681368
```
1369-
npm install @sharpapi/client
1369+
npm install @sharp-api/client
13701370
```
13711371
```typescript
1372-
import { SharpApiClient } from '@sharpapi/client';
1373-
const client = new SharpApiClient('sk_live_your_key');
1374-
const { data, meta } = await client.getOdds({ league: 'nba' });
1372+
import { SharpAPI } from '@sharp-api/client';
1373+
const api = new SharpAPI('sk_live_your_key');
1374+
const { data } = await api.odds.get({ league: 'nba' });
13751375
```
13761376

13771377
### Python
13781378
```
13791379
pip install sharpapi
13801380
```
13811381
```python
1382-
from sharpapi import SharpApiClient
1383-
client = SharpApiClient("sk_live_your_key")
1384-
odds = client.get_odds(league="nba")
1382+
from sharpapi import SharpAPI
1383+
client = SharpAPI("sk_live_your_key")
1384+
odds = client.odds.get(league="nba")
13851385
```
13861386

13871387
### Other Languages

public/llms.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
## Optional
4141

42-
- [TypeScript SDK](https://docs.sharpapi.io/en/sdks/typescript): `npm install @sharpapi/client`
42+
- [TypeScript SDK](https://docs.sharpapi.io/en/sdks/typescript): `npm install @sharp-api/client`
4343
- [Python SDK](https://docs.sharpapi.io/en/sdks/python): `pip install sharpapi`
4444
- [Streaming Guide](https://docs.sharpapi.io/en/streaming/overview): SSE and WebSocket setup
4545
- [Arbitrage Concepts](https://docs.sharpapi.io/en/concepts/arbitrage): How arbitrage detection works

0 commit comments

Comments
 (0)