pnclFEED Free key

Quickstart notes

Poll several sports in one Python script

One session, one cursor per sport, and a shared pace. A small extension of the quickstart loop that covers multiple boards without surprises.

The quickstart loop polls one sport. Covering several sports is one loop over a list of sport IDs, with one cursor per sport and a pace that respects the shared allowance. It is a small change, and one budget mistake hides inside it.

One cursor per sport, one session for all

The since cursor tracks a position in one board's changes, so each sport keeps its own. A dictionary keyed by sport ID is enough: read the cursor for the board you are about to poll, send it, store the new one. The HTTP session, with the key in its header, is shared across all of them, exactly as the Python quickstart builds it, checked 2026-10-12.

SPORTS = [1, 2, 4]           # soccer, tennis, hockey
cursors = {}

while True:
    for sport_id in SPORTS:
        params = {"sport_id": sport_id}
        since = cursors.get(sport_id)
        if since is not None:
            params["since"] = since
        r = s.get(URL, params=params, timeout=10)
        if r.status_code == 429:
            time.sleep(int(r.headers.get("Retry-After", "5")))
            continue
        r.raise_for_status()
        data = r.json()
        cursors[sport_id] = data["last"]
        for ev in data["events"]:
            print(sport_id, ev["home"], "v", ev["away"])
    time.sleep(60)

One round-robin pass per minute covers each board once per minute, and the cursors keep every sport's deltas separate.

The budget mistake: multiplying without noticing

The free key allows 100 calls a day, per the pricing page, checked 2026-10-12. One sport every 15 minutes fits all day at 96 calls. Three sports at that rhythm need 288, and the script dies mid-afternoon. The budget is per key, not per sport, so the interval has to stretch with the sport count: three sports on the free key means about one round every 45 minutes, not three boards every 15.

On a paid plan the same arithmetic shifts to per-second: a round of three boards every second is 3 requests a second, well inside the REST tiers, and the interval stops being a budget question and becomes a freshness one.

When one script stops being enough

One loop is fine while the boards share a rhythm. When one sport needs a faster interval than the rest, or a failure in one should not stall the others, split the sports across processes. A single line per round, with the sport count and the number of changed events, keeps the loop observable without a dashboard: when the line stops appearing, the script stopped, and that is the monitoring that matters at this size. Until then, the single loop with per-sport cursors is the simplest thing that covers your list.

One session, one cursor per sport, one honest interval. Multi-sport polling is a dict and a loop, plus the arithmetic to keep the budget intact.