Skip to content

add get_scores_and_broadcast to in play service - #622

Open
niallsemple wants to merge 1 commit into
betcode-org:masterfrom
niallsemple:feature/scores-and-broadcast
Open

add get_scores_and_broadcast to in play service#622
niallsemple wants to merge 1 commit into
betcode-org:masterfrom
niallsemple:feature/scores-and-broadcast

Conversation

@niallsemple

Copy link
Copy Markdown

Fixes #569

Adds support for the in play service scoresAndBroadcast endpoint, which returns everything scores does plus broadcasts (tv / radio / bfLiveVideo availability and channels) and matchInfo (e.g. surface, numberOfSets) per event.

Changes

  • InPlayService.get_scores_and_broadcast(event_ids) — follows the exact pattern of the existing get_scores() / get_event_timelines() methods (same params, lightweight support, returns a list of resources.Scores)
  • New resources in inplayserviceresources.py: Broadcasts, RadioBroadcast, LiveVideoBroadcast and MatchInfo, exposed as optional Scores.broadcasts / Scores.match_info attributes (both default to None, so existing get_scores() responses are unaffected — covered by test)
  • LiveVideoBroadcast start/end times are parsed to tz-aware datetimes via BaseResource.strip_datetime, consistent with the rest of the library
  • Docs entry in docs/endpoints.md

Verification

  • 388 tests pass (python -m unittest discover), including new tests for the endpoint call (URL/params), resource parsing with broadcast/matchInfo data (mock JSON modelled on the payload shown in the issue), and the no-broadcast case
  • black --check clean with the pinned version (25.9.0)
  • Endpoint confirmed live: GET https://ips.betfair.com/inplayservice/v1.1/scoresAndBroadcast?eventIds=1&alt=json returns a valid JSON list

Adds support for the scoresAndBroadcast endpoint which returns
broadcast (tv/radio/bfLiveVideo) and matchInfo data alongside
scores, as requested in betcode-org#569.

- InPlayService.get_scores_and_broadcast() following the existing
  get_scores() pattern
- Broadcasts, RadioBroadcast, LiveVideoBroadcast and MatchInfo
  resources, exposed as optional Scores.broadcasts / Scores.match_info
- Tests and mock data covering both presence and absence of the
  new fields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] get additional data such as "broadcasts" and "matchInfo" of events returned in in_play_service

1 participant