SDKs 0.21.0 read matching events from data and lookups
The TypeScript, Python, and Go SDKs 0.21.0 type GET /v1/matching-markets/sports as a data array of events plus lookups, with labels and market names required.
SDKBreaking
The TypeScript (@predictorsdk/client), Python (predictorsdk), and Go (github.com/PredictorSDK/sdk-go) SDKs are released at 0.21.0, typing the matching response changes shipped the same day. Upgrade now: 0.20.0 and earlier cannot read the new response. Python's client requires the canonical_events field the API no longer sends and raises on every matching call, and TypeScript and Go find no events.
- Events are
data, a list in start order. TypeScriptresponse.data(CanonicalSportsEvent[]), Pythonresponse.data, Goresponse.Data([]*CanonicalSportsEvent) replace thecanonicalEvents/canonical_events/CanonicalEventsmap. Read each event's ID from its owneventId/event_id/EventID. - Lookups are
lookups. A map from each identifier you sent to aSportsMatchingLookupwitheventIds/event_ids/EventIDs, empty when the identifier found nothing. It is absent (undefined,None,nil) on a list page. - Fields that are always present are required. A source market's
marketName/market_name/MarketNameand its outcomes'labelandoutcomeId/outcome_id/OutcomeIDare plain strings now, as are an event's sport, league and participants, a participant's name and role, a submarket's display name and metric, and a canonical outcome's type and side. In Go each changes from*stringtostring, so drop the dereference:*m.MarketNamebecomesm.MarketName. That is the source-breaking part for Go; TypeScript and Python only lose anundefined/Nonecase. - The docstrings match the API:
include_submarketsdefaults by mode,source_idaccepts Polymarket condition IDs and rejects side names, and Kalshi and Pred outcomes are labelledYes/No.