Skip to content

Pybaseball currently throwing 403 error - cannot use any functions #507

Description

@andrewscheiner

When running pybaseball functions in my Python code, I am unable to use any of the package's functions because I get the following error:

get_pitching_leaders("AL")
HTTPError: Error accessing 'https://www.fangraphs.com/leaders-legacy.aspx'. Received status code 403.

I am also unable to run the functions pitching_stats() and batting_stats() as the throw the same error. When I click on this link (in the error above), it seems Fangraphs is asking for a security check (some sort of CAPTCHA) so Python is unable to access the site and thus, cannot run the code in the functions.

Python / Version Details

Python version: 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:03:56) [MSC v.1929 64 bit (AMD64)]
pybaseball version: 2.2.7
pip-26.0.1

Can someone please look into how to fix this error? I would be happy to provide more details if needed. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions