Paginate Pinnacle events and odds in Python
Answer: Both GET /v1/events and GET /v1/odds accept limit and offset (OpenAPI). Loop until a page returns fewer than limit rows. Prefer /v1/odds when you need markets inline; use /v1/events for schedules without prices.
Page through soccer moneylines#
import os, requests
KEY = os.environ["PINNFEED_KEY"]
H = {"x-api-key": KEY}
BASE = "https://pinnfeed.io/v1/odds"
params = {
"sport": "soccer",
"market": "moneyline",
"main": "true",
"live": "false",
"limit": 50,
"offset": 0,
}
all_events = []
while True:
r = requests.get(BASE, headers=H, params=params, timeout=20)
r.raise_for_status()
batch = r.json().get("events", [])
all_events.extend(batch)
if len(batch) < params["limit"]:
break
params["offset"] += params["limit"]
print(f"fetched {len(all_events)} events")
Useful filters from the OpenAPI: league, event, markets (moneyline,spread,total), live (true/false), main, specials=false, q (substring on team/league name).
Free (€0, 30 s delay) is enough for this poller. For push deltas, use Builder (€99/mo) and the WebSocket guide. Paid plans include a 3-day trial; a card is required and it is charged after day 3 unless you cancel. Educational content for adults (18+).
Questions people ask#
Is there a cursor instead of offset?#
No — the published OpenAPI uses integer offset on events/odds/closing. Keep limit stable across pages.
How big can limit be?#
Caps vary by endpoint; start at 50 and raise only if responses stay under your timeout. See the operation description in /openapi.json.