Skip to content

Commit 1daed2c

Browse files
Mlaz-codeclaude
andcommitted
docs: fix 17 accuracy issues across 16 pages from full-site audit
Verified every response example, schema table, and code snippet against actual source code. Major fixes include: - events-by-id: rewrite response to match EventDetail (books/markets arrays) - events-markets: fix field names (type, selection_count, book_count, selections) - account-keys: fix all CRUD response structures to match KeyInfo type - health: remove data/meta wrapper, fix check field names - markets: remove category/selection_types, fix hasLine, add examples/counts - sports/leagues: remove nonexistent display_name field - odds-best: remove nonexistent selection_type field - odds-comparison: books_available is string[] not number - sportsbooks: odds_count→event_count, region→regions - overview: arbitrage min tier Pro→Hobby - opportunities-arbitrage: leg.odds→leg.odds_american - opportunities-middles: add fair_probability to odds objects - typescript SDK: kelly_fraction→kelly_percent - value-betting: ev_opportunity→ev:detected event name - index: fix missing /api in stream URL Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8c903c6 commit 1daed2c

16 files changed

Lines changed: 441 additions & 537 deletions

content/api-reference/account-keys.mdx

Lines changed: 29 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const response = await fetch(
4040
const { data } = await response.json();
4141

4242
for (const key of data) {
43-
console.log(`${key.name}: ${key.key_preview} (${key.status})`);
43+
console.log(`${key.name}: ${key.id_masked} (${key.is_active})`);
4444
}
4545
```
4646
</Tabs.Tab>
@@ -55,7 +55,7 @@ response = requests.get(
5555
keys = response.json()['data']
5656

5757
for key in keys:
58-
print(f"{key['name']}: {key['key_preview']} ({key['status']})")
58+
print(f"{key['name']}: {key['id_masked']} ({key['is_active']})")
5959
```
6060
</Tabs.Tab>
6161
</Tabs>
@@ -66,20 +66,22 @@ for key in keys:
6666
{
6767
"data": [
6868
{
69-
"key_id": "key_abc123def456",
69+
"id": "key_abc123def456",
70+
"id_masked": "sharpapi_...f456",
7071
"name": "Production",
71-
"key_preview": "sharpapi_...f456",
72-
"status": "active",
72+
"tier": "pro",
73+
"is_active": true,
7374
"created_at": "2025-10-15T08:30:00Z",
74-
"last_used_at": "2026-02-08T14:22:10Z"
75+
"updated_at": "2026-02-08T14:22:10Z"
7576
},
7677
{
77-
"key_id": "key_xyz789ghi012",
78+
"id": "key_xyz789ghi012",
79+
"id_masked": "sharpapi_...i012",
7880
"name": "Staging",
79-
"key_preview": "sharpapi_...i012",
80-
"status": "active",
81+
"tier": "pro",
82+
"is_active": true,
8183
"created_at": "2026-01-05T12:00:00Z",
82-
"last_used_at": "2026-02-07T09:15:30Z"
84+
"updated_at": "2026-02-07T09:15:30Z"
8385
}
8486
],
8587
"meta": {
@@ -100,12 +102,13 @@ for key in keys:
100102

101103
| Field | Type | Description |
102104
|-------|------|-------------|
103-
| `key_id` | string | Unique key identifier |
104-
| `name` | string | Human-readable key name |
105-
| `key_preview` | string | Masked preview of the key (first and last characters visible) |
106-
| `status` | string | Key status: `active` or `revoked` |
105+
| `id` | string | Unique key identifier |
106+
| `id_masked` | string | Masked preview of the key (first and last characters visible) |
107+
| `name` | string \| null | Human-readable key name |
108+
| `tier` | string | Subscription tier associated with the key |
109+
| `is_active` | boolean | Whether the key is currently active |
107110
| `created_at` | string | ISO 8601 timestamp of key creation |
108-
| `last_used_at` | string | ISO 8601 timestamp of last API request with this key |
111+
| `updated_at` | string | ISO 8601 timestamp of last key update |
109112

110113
---
111114

@@ -173,21 +176,16 @@ print(f"New key: {new_key['key']}")
173176
```json
174177
{
175178
"data": {
176-
"key_id": "key_new345mno678",
177-
"name": "Mobile App",
179+
"id": "key_new345mno678",
178180
"key": "sharpapi_new345mno678pqr901stu234vwx567",
179-
"key_preview": "sharpapi_...x567",
180-
"status": "active",
181-
"created_at": "2026-02-08T15:00:00Z"
182-
},
183-
"meta": {
184-
"updated_at": "2026-02-08T15:00:00Z"
181+
"name": "Mobile App",
182+
"tier": "pro"
185183
}
186184
}
187185
```
188186

189187
<Callout type="warning">
190-
**Important:** The full `key` value is **only returned once** at creation time. Store it securely immediately. Subsequent requests will only show the `key_preview`.
188+
**Important:** The full `key` value is **only returned once** at creation time. Store it securely immediately. Subsequent requests will only show the `id_masked` preview.
191189
</Callout>
192190

193191
---
@@ -224,8 +222,8 @@ const response = await fetch(
224222
headers: { 'X-API-Key': 'YOUR_API_KEY' }
225223
}
226224
);
227-
const { data } = await response.json();
228-
console.log(`Deleted key: ${data.key_id}`);
225+
const result = await response.json();
226+
console.log(`Deleted key: ${result.key_id}`);
229227
```
230228
</Tabs.Tab>
231229
<Tabs.Tab>
@@ -236,7 +234,7 @@ response = requests.delete(
236234
'https://api.sharpapi.io/api/v1/account/keys/key_xyz789ghi012',
237235
headers={'X-API-Key': 'YOUR_API_KEY'}
238236
)
239-
result = response.json()['data']
237+
result = response.json()
240238
print(f"Deleted key: {result['key_id']}")
241239
```
242240
</Tabs.Tab>
@@ -246,14 +244,9 @@ print(f"Deleted key: {result['key_id']}")
246244

247245
```json
248246
{
249-
"data": {
250-
"key_id": "key_xyz789ghi012",
251-
"status": "revoked",
252-
"deleted_at": "2026-02-08T15:05:00Z"
253-
},
254-
"meta": {
255-
"updated_at": "2026-02-08T15:05:00Z"
256-
}
247+
"deleted": true,
248+
"key_id": "key_xyz789ghi012",
249+
"message": "API key revoked successfully"
257250
}
258251
```
259252

@@ -386,7 +379,7 @@ X-Request-Id: req_keys123xyz
386379
1. **Use descriptive names** - Name keys by their purpose (e.g., "Production Server", "Staging", "Mobile App") to easily identify them later
387380
2. **Rotate regularly** - Rotate keys periodically (e.g., every 90 days) as a security best practice
388381
3. **Use separate keys per environment** - Create distinct keys for production, staging, and development
389-
4. **Monitor `last_used_at`** - Identify and clean up unused keys
382+
4. **Review inactive keys** - Identify and clean up unused keys
390383
5. **Store keys in secrets management** - Use environment variables or a secrets manager, never hardcode keys
391384
6. **Revoke compromised keys immediately** - If a key is exposed, delete or rotate it right away
392385

content/api-reference/events-by-id.mdx

Lines changed: 83 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -36,31 +36,37 @@ All responses include standard rate limit and metadata headers:
3636
| Field | Type | Description |
3737
|-------|------|-------------|
3838
| `id` | string | Unique event identifier |
39+
| `external_ids` | object | Map of sportsbook ID to that book's external event ID (e.g., `{ "draftkings": "12345", "fanduel": "67890" }`) |
3940
| `sport` | string | Sport identifier (e.g., `basketball`, `football`) |
4041
| `league` | string | League name (e.g., `NBA`, `NFL`) |
4142
| `home_team` | string | Home team name |
4243
| `away_team` | string | Away team name |
4344
| `start_time` | string | ISO 8601 event start time |
44-
| `status` | string | Event status: `scheduled`, `live`, `final`, `postponed`, `cancelled` |
45+
| `status` | string | Event status: `upcoming`, `live`, `final`, `postponed`, `cancelled` |
4546
| `is_live` | boolean | Whether the event is currently live |
46-
| `odds_count` | integer | Total number of odds lines available |
47-
| `markets` | object | Available markets with odds grouped by market type |
47+
| `books` | array | Sportsbooks covering this event, sorted by market count descending |
48+
| `markets` | array | Market types available for this event, sorted by selection count descending |
4849

49-
### Markets Object
50+
### Books Array
5051

51-
The `markets` field is an object where each key is a market type (e.g., `moneyline`, `spread`, `total`) and each value is an array of odds entries for that market.
52+
Each entry in the `books` array describes a sportsbook that has odds for this event.
5253

5354
| Field | Type | Description |
5455
|-------|------|-------------|
55-
| `markets.{type}` | array | Array of odds entries for this market type |
56-
| `markets.{type}[].sportsbook` | string | Sportsbook identifier |
57-
| `markets.{type}[].selection` | string | Selection name (team name, Over/Under) |
58-
| `markets.{type}[].selection_type` | string | `home`, `away`, `over`, `under` |
59-
| `markets.{type}[].line` | number \| null | Line value (for spread/total markets) |
60-
| `markets.{type}[].odds.american` | number | American odds (e.g., -110, +150) |
61-
| `markets.{type}[].odds.decimal` | number | Decimal odds (e.g., 1.909) |
62-
| `markets.{type}[].odds.probability` | number | Implied probability (e.g., 0.5238) |
63-
| `markets.{type}[].timestamp` | string | When these odds were last updated |
56+
| `id` | string | Sportsbook identifier (e.g., `draftkings`, `pinnacle`) |
57+
| `name` | string | Display name of the sportsbook |
58+
| `market_count` | integer | Number of distinct market types this book offers for the event |
59+
| `last_update` | string | ISO 8601 timestamp of the most recent odds update from this book |
60+
61+
### Markets Array
62+
63+
Each entry in the `markets` array summarizes an available market type for this event.
64+
65+
| Field | Type | Description |
66+
|-------|------|-------------|
67+
| `type` | string | Market type identifier (e.g., `moneyline`, `spread`, `total`, `player_prop`) |
68+
| `selection_count` | integer | Number of distinct selections available in this market |
69+
| `book_count` | integer | Number of sportsbooks offering this market |
6470

6571
## Example Requests
6672

@@ -80,7 +86,7 @@ const response = await fetch(
8086
);
8187
const { data, meta } = await response.json();
8288
console.log(`${data.home_team} vs ${data.away_team}`);
83-
console.log(`Markets: ${Object.keys(data.markets).join(', ')}`);
89+
console.log(`Markets: ${data.markets.map(m => m.type).join(', ')}`);
8490
```
8591
</Tabs.Tab>
8692
<Tabs.Tab>
@@ -94,7 +100,7 @@ response = requests.get(
94100
)
95101
event = response.json()['data']
96102
print(f"{event['home_team']} vs {event['away_team']}")
97-
print(f"Markets: {list(event['markets'].keys())}")
103+
print(f"Markets: {[m['type'] for m in event['markets']]}")
98104
```
99105
</Tabs.Tab>
100106
</Tabs>
@@ -111,121 +117,75 @@ Single-resource responses wrap the object in `data` as a single object (not an a
111117
{
112118
"data": {
113119
"id": "evt_nba_bos_lal_20260208",
120+
"external_ids": {
121+
"draftkings": "12345678",
122+
"fanduel": "87654321",
123+
"pinnacle": "556677889",
124+
"betmgm": "ms_44556"
125+
},
114126
"sport": "basketball",
115127
"league": "NBA",
116128
"home_team": "Boston Celtics",
117129
"away_team": "Los Angeles Lakers",
118130
"start_time": "2026-02-08T19:30:00Z",
119-
"status": "scheduled",
131+
"status": "upcoming",
120132
"is_live": false,
121-
"odds_count": 48,
122-
"markets": {
123-
"moneyline": [
124-
{
125-
"sportsbook": "draftkings",
126-
"selection": "Boston Celtics",
127-
"selection_type": "home",
128-
"line": null,
129-
"odds": {
130-
"american": -180,
131-
"decimal": 1.556,
132-
"probability": 0.643
133-
},
134-
"timestamp": "2026-02-08T12:05:00Z"
135-
},
136-
{
137-
"sportsbook": "draftkings",
138-
"selection": "Los Angeles Lakers",
139-
"selection_type": "away",
140-
"line": null,
141-
"odds": {
142-
"american": 155,
143-
"decimal": 2.55,
144-
"probability": 0.392
145-
},
146-
"timestamp": "2026-02-08T12:05:00Z"
147-
},
148-
{
149-
"sportsbook": "pinnacle",
150-
"selection": "Boston Celtics",
151-
"selection_type": "home",
152-
"line": null,
153-
"odds": {
154-
"american": -175,
155-
"decimal": 1.571,
156-
"probability": 0.636
157-
},
158-
"timestamp": "2026-02-08T12:03:00Z"
159-
},
160-
{
161-
"sportsbook": "pinnacle",
162-
"selection": "Los Angeles Lakers",
163-
"selection_type": "away",
164-
"line": null,
165-
"odds": {
166-
"american": 158,
167-
"decimal": 2.58,
168-
"probability": 0.388
169-
},
170-
"timestamp": "2026-02-08T12:03:00Z"
171-
}
172-
],
173-
"spread": [
174-
{
175-
"sportsbook": "draftkings",
176-
"selection": "Boston Celtics",
177-
"selection_type": "home",
178-
"line": -6.5,
179-
"odds": {
180-
"american": -110,
181-
"decimal": 1.909,
182-
"probability": 0.524
183-
},
184-
"timestamp": "2026-02-08T12:05:00Z"
185-
},
186-
{
187-
"sportsbook": "draftkings",
188-
"selection": "Los Angeles Lakers",
189-
"selection_type": "away",
190-
"line": 6.5,
191-
"odds": {
192-
"american": -110,
193-
"decimal": 1.909,
194-
"probability": 0.524
195-
},
196-
"timestamp": "2026-02-08T12:05:00Z"
197-
}
198-
],
199-
"total": [
200-
{
201-
"sportsbook": "draftkings",
202-
"selection": "Over",
203-
"selection_type": "over",
204-
"line": 224.5,
205-
"odds": {
206-
"american": -110,
207-
"decimal": 1.909,
208-
"probability": 0.524
209-
},
210-
"timestamp": "2026-02-08T12:05:00Z"
211-
},
212-
{
213-
"sportsbook": "draftkings",
214-
"selection": "Under",
215-
"selection_type": "under",
216-
"line": 224.5,
217-
"odds": {
218-
"american": -110,
219-
"decimal": 1.909,
220-
"probability": 0.524
221-
},
222-
"timestamp": "2026-02-08T12:05:00Z"
223-
}
224-
]
225-
}
133+
"books": [
134+
{
135+
"id": "draftkings",
136+
"name": "DraftKings",
137+
"market_count": 5,
138+
"last_update": "2026-02-08T12:05:00Z"
139+
},
140+
{
141+
"id": "fanduel",
142+
"name": "FanDuel",
143+
"market_count": 4,
144+
"last_update": "2026-02-08T12:04:30Z"
145+
},
146+
{
147+
"id": "pinnacle",
148+
"name": "Pinnacle",
149+
"market_count": 3,
150+
"last_update": "2026-02-08T12:03:00Z"
151+
},
152+
{
153+
"id": "betmgm",
154+
"name": "BetMGM",
155+
"market_count": 3,
156+
"last_update": "2026-02-08T12:02:15Z"
157+
}
158+
],
159+
"markets": [
160+
{
161+
"type": "moneyline",
162+
"selection_count": 2,
163+
"book_count": 4
164+
},
165+
{
166+
"type": "spread",
167+
"selection_count": 2,
168+
"book_count": 4
169+
},
170+
{
171+
"type": "total",
172+
"selection_count": 2,
173+
"book_count": 3
174+
},
175+
{
176+
"type": "player_prop",
177+
"selection_count": 18,
178+
"book_count": 2
179+
},
180+
{
181+
"type": "team_total",
182+
"selection_count": 4,
183+
"book_count": 1
184+
}
185+
]
226186
},
227187
"meta": {
228-
"updated_at": "2026-02-08T12:05:00Z"
188+
"event_id": "evt_nba_bos_lal_20260208"
229189
}
230190
}
231191
```

0 commit comments

Comments
 (0)