Skip to content

Schedule API shouldn't require date #245

@blahblablee

Description

@blahblablee

Currently if you try to access the schedule api like this

https://statsapi.mlb.com/api/v1/schedule?gamePk=831508

by using

>>> mlb = mlbstatsapi.Mlb()
>>> games = mlb.get_scheduled_games_by_date(gamePks=831508)

you'll get back a None

If you include the date

>>> mlb = mlbstatsapi.Mlb()
>>> games = mlb.get_scheduled_games_by_date(date="2026-03-14", gamePks=831508)

you'll get back the correct games object.

I was testing an application using the library and have a few other data validation issues I'm going to open a pull request for when I have time to run the tests properly, but this one I'm not sure what the correct change would be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions