You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: document cursor-based pagination as recommended approach for /odds
Add ?cursor= param to odds.mdx and overview.mdx. Explain why offset-based
pagination drifts on live data, add a dedicated Pagination section with
full cURL/JS/Python examples using next_cursor, and update response JSON
samples to show next_cursor alongside next_offset.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: content/en/api-reference/odds.mdx
+72-33Lines changed: 72 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,8 @@ The sportsbooks returned in your results depend on your subscription tier. Free
37
37
|`group_by`| string | — | Group results by field (e.g., `event`) |
38
38
|`state`| string | — | US state code for sportsbook deep links (e.g., `nj`, `ny`, `il`). When set, `deep_link` URLs include `?state=XX` so the redirect targets the correct state-specific sportsbook domain. Only affects books with state-dependent URLs (BetMGM, Caesars, BetRivers). |
39
39
|`limit`| integer | 50 | Max results per page (max 200) |
|`offset`| integer | 0 | Pagination offset. May produce duplicate rows when live data updates between requests — use `cursor` for multi-page scans. |
41
+
|`cursor`| string | — | Opaque cursor from `next_cursor` in a previous response. **Recommended for multi-page scans** — stable against live data changes. Takes precedence over `offset` when both are provided. |
41
42
42
43
<Callouttype="info">
43
44
Use comma-separated values to filter by multiple sportsbooks: `sportsbook=draftkings,fanduel,betmgm`
@@ -83,46 +84,83 @@ curl -X GET "https://api.sharpapi.io/api/v1/odds?league=nba&sportsbook=draftking
**Use cursor-based pagination for multi-page scans.** The `/odds` endpoint serves live data that refreshes every ~15 seconds. With offset-based pagination, rows can shift positions between requests, causing duplicates at page boundaries. Cursor-based pagination anchors each page to the last seen item — no drift.
146
+
</Callout>
147
+
148
+
Each response includes both `next_cursor` (stable) and `next_offset` (legacy) in the `pagination` object. For sequential full-dataset scans, always use `next_cursor`.
Cursors are opaque — do not parse or construct them. They encode the sort position of the last item on the current page and are only valid for the same filter parameters.
161
+
162
+
`?offset=N` continues to work and is appropriate for single-page requests or direct position access. It is not recommended for iterating through live data.
163
+
126
164
## Response
127
165
128
166
### Success (200)
@@ -179,7 +217,8 @@ if result['meta']['pagination']['has_more']:
0 commit comments