Metadata-Version: 2.4
Name: crawlora-yahoo-sports
Version: 0.1.0
Summary: Crawlora Yahoo Sports API client with 53 endpoints for league, team, player, game, schedule, standings, rankings, and fantasy sports data
Author: Crawlora
License-Expression: MIT
Project-URL: Homepage, https://crawlora.net/?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=yahoo-sports-python-homepage
Project-URL: Documentation, https://crawlora.net/docs?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=yahoo-sports-python-api-docs
Project-URL: Repository, https://github.com/Crawlora-org/crawlora-yahoo-sports
Keywords: crawlora,api-client,sdk,web-scraping,scraping-api,yahoo-sports,yahoo-sports-api,yahoo-sports-scraper,yahoo-sports-data,yahoo-sports-league,yahoo-sports-team,yahoo-sports-player,yahoo-sports-game,yahoo-sports-schedule,yahoo-sports-standings,yahoo-sports-rankings,yahoo-sports-fantasy-sports-data
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typing-extensions>=4.7; python_version < "3.11"
Provides-Extra: async
Requires-Dist: httpx>=0.27; extra == "async"
Provides-Extra: test
Requires-Dist: mypy>=1.11; extra == "test"
Requires-Dist: pytest>=8; extra == "test"
Dynamic: license-file

# crawlora-yahoo-sports — Yahoo Sports API client for Python

Python client for Crawlora's hosted Yahoo Sports API. It exposes 53 API endpoints covering league, team, player, game, schedule, standings, rankings, and fantasy sports data. Requests go to [Crawlora](https://crawlora.net/?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=yahoo-sports-python-homepage); the package does not run a browser or scrape
Yahoo Sports locally. A Crawlora account and `CRAWLORA_API_KEY` are required,
and API use is billed under your Crawlora account. Crawlora is independent from and not endorsed by
Yahoo Sports or its owners.

## Install

```sh
python -m pip install crawlora-yahoo-sports
```

## Get an API key

Create an account at [crawlora.net](https://crawlora.net/signup?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=yahoo-sports-python-signup), then open the [Crawlora console](https://crawlora.net/app?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=yahoo-sports-python-console) for API-key setup. Set your key in the shell before running the client:

```sh
export CRAWLORA_API_KEY="your-crawlora-api-key"
```

## Use

Save this example as `example.py`, then run `python example.py` after installing the package and setting your API key.

```python
import os

from crawlora_yahoo_sports import YahooSportsClient

api_key = os.environ.get("CRAWLORA_API_KEY")
if not api_key:
    raise RuntimeError("Set CRAWLORA_API_KEY before running this example.")

with YahooSportsClient(api_key=api_key) as client:
    result_1 = client.dropdown_catalog()
    print(result_1)
    result_2 = client.game(league='nfl')
    print(result_2)
```

The package also exports `Client` as an alias for `YahooSportsClient`. Operation
methods are available directly in snake_case and through the `yahoo-sports`
group. The async package client is `AsyncYahooSportsClient`; see the [online
endpoint and parameter reference](https://github.com/Crawlora-org/crawlora-yahoo-sports/blob/main/docs/usage.md) and [runnable example](https://github.com/Crawlora-org/crawlora-yahoo-sports/blob/main/examples/python.py).

### Async usage

The package also exports `AsyncClient` for asynchronous requests:

```python
import asyncio
import os

from crawlora_yahoo_sports import AsyncClient

async def main():
    api_key = os.environ.get("CRAWLORA_API_KEY")
    if not api_key:
        raise RuntimeError("Set CRAWLORA_API_KEY before running this example.")
    async with AsyncClient(api_key=api_key) as client:
        result_1 = await client.dropdown_catalog()
        print(result_1)

asyncio.run(main())
```

See the [runnable example](https://github.com/Crawlora-org/crawlora-yahoo-sports/blob/main/examples/python.py) for a complete usage example.

## Supported Yahoo Sports API endpoints

This package exposes every route below through direct snake_case methods and the `yahoo-sports` group. See the [endpoint and parameter reference](https://github.com/Crawlora-org/crawlora-yahoo-sports/blob/main/docs/usage.md) for complete input details.

| Method | Endpoint | API operation | Description |
| --- | --- | --- | --- |
| `GET` | `/yahoo-sports/college-rankings` | `yahoo-sports-college-rankings` | Yahoo Sports college football and basketball rankings |
| `GET` | `/yahoo-sports/draft` | `yahoo-sports-draft` | Yahoo Sports NFL and NBA Draft hub |
| `GET` | `/yahoo-sports/dropdown-catalog` | `yahoo-sports-dropdown-catalog` | Yahoo Sports team and category dropdown data |
| `GET` | `/yahoo-sports/game` | `yahoo-sports-game` | Yahoo Sports game boxscore |
| `GET` | `/yahoo-sports/golf-leaderboard` | `yahoo-sports-golf-leaderboard` | Yahoo Sports golf tournament leaderboard |
| `GET` | `/yahoo-sports/golf-player` | `yahoo-sports-golf-player` | Yahoo Sports golf player profile |
| `GET` | `/yahoo-sports/golf-player-news` | `yahoo-sports-golf-player-news` | Yahoo Sports golf player news |
| `GET` | `/yahoo-sports/golf-players` | `yahoo-sports-golf-players` | Yahoo Sports golf player directory |
| `GET` | `/yahoo-sports/golf-schedule` | `yahoo-sports-golf-schedule` | Yahoo Sports golf tournament schedule |
| `GET` | `/yahoo-sports/home` | `yahoo-sports-home` | Yahoo Sports home-page stories |
| `GET` | `/yahoo-sports/injury-report` | `yahoo-sports-injury-report` | Yahoo Sports injury report |
| `GET` | `/yahoo-sports/league-schedule` | `yahoo-sports-league-schedule` | Yahoo Sports league schedule games |
| `GET` | `/yahoo-sports/leagues` | `yahoo-sports-leagues` | Yahoo Sports league catalog |
| `GET` | `/yahoo-sports/mma-fight-card` | `yahoo-sports-mma-fight-card` | Yahoo Sports MMA fight card |
| `GET` | `/yahoo-sports/mma-schedule` | `yahoo-sports-mma-schedule` | Yahoo Sports MMA event schedule |
| `GET` | `/yahoo-sports/more-news` | `yahoo-sports-more-news` | Yahoo Sports More News feed |
| `GET` | `/yahoo-sports/motorsports-race` | `yahoo-sports-motorsports-race` | Yahoo Sports motorsports race results |
| `GET` | `/yahoo-sports/motorsports-schedule` | `yahoo-sports-motorsports-schedule` | Yahoo Sports motorsports season schedule |
| `GET` | `/yahoo-sports/navigation` | `yahoo-sports-navigation` | Yahoo Sports section navigation |
| `GET` | `/yahoo-sports/network-catalog` | `yahoo-sports-network-catalog` | Yahoo Sports Network and Watch catalog |
| `GET` | `/yahoo-sports/news` | `yahoo-sports-news` | Yahoo Sports league news |
| `GET` | `/yahoo-sports/newsletter-archive` | `yahoo-sports-newsletter-archive` | Yahoo Sports newsletter article archive |
| `GET` | `/yahoo-sports/newsletters` | `yahoo-sports-newsletters` | Yahoo Sports newsletter catalog |
| `GET` | `/yahoo-sports/odds-featured` | `yahoo-sports-odds-featured` | Yahoo Sports featured odds games |
| `GET` | `/yahoo-sports/odds-game` | `yahoo-sports-odds-game` | Yahoo Sports game odds markets |
| `GET` | `/yahoo-sports/odds-games` | `yahoo-sports-odds-games` | Yahoo Sports current game IDs for an odds league |
| `GET` | `/yahoo-sports/odds-trending` | `yahoo-sports-odds-trending` | Yahoo Sports trending odds games |
| `GET` | `/yahoo-sports/olympics-medals` | `yahoo-sports-olympics-medals` | Yahoo Sports Olympics medal count |
| `GET` | `/yahoo-sports/player` | `yahoo-sports-player` | Yahoo Sports player detail |
| `GET` | `/yahoo-sports/player-search` | `yahoo-sports-player-search` | Yahoo Sports player search |
| `GET` | `/yahoo-sports/playoff-bracket` | `yahoo-sports-playoff-bracket` | Yahoo Sports playoff bracket data |
| `GET` | `/yahoo-sports/playoff-bracket-catalog` | `yahoo-sports-playoff-bracket-catalog` | Yahoo Sports playoff bracket season options |
| `GET` | `/yahoo-sports/rss-catalog` | `yahoo-sports-rss-catalog` | Yahoo Sports RSS feed catalog |
| `GET` | `/yahoo-sports/rss-feed` | `yahoo-sports-rss-feed` | Yahoo Sports RSS feed |
| `GET` | `/yahoo-sports/schedule-catalog` | `yahoo-sports-schedule-catalog` | Yahoo Sports league schedule filter catalog |
| `GET` | `/yahoo-sports/scoreboard` | `yahoo-sports-scoreboard` | Yahoo Sports scoreboard |
| `GET` | `/yahoo-sports/section-stream` | `yahoo-sports-section-stream` | Yahoo Sports public section article stream |
| `GET` | `/yahoo-sports/soccer-scoreboard` | `yahoo-sports-soccer-scoreboard` | Yahoo Sports all-competition soccer scoreboard |
| `GET` | `/yahoo-sports/sportsbook-catalog` | `yahoo-sports-sportsbook-catalog` | Yahoo Sports odds page filter catalog |
| `GET` | `/yahoo-sports/standings` | `yahoo-sports-standings` | Yahoo Sports standings |
| `GET` | `/yahoo-sports/stats` | `yahoo-sports-stats` | Yahoo Sports league stats table |
| `GET` | `/yahoo-sports/stats-catalog` | `yahoo-sports-stats-catalog` | Yahoo Sports stats league catalog |
| `GET` | `/yahoo-sports/stats-discovery` | `yahoo-sports-stats-discovery` | Yahoo Sports stats tabs and filters |
| `GET` | `/yahoo-sports/team` | `yahoo-sports-team` | Yahoo Sports team detail |
| `GET` | `/yahoo-sports/team-roster` | `yahoo-sports-team-roster` | Yahoo Sports team roster |
| `GET` | `/yahoo-sports/team-schedule` | `yahoo-sports-team-schedule` | Yahoo Sports team schedule |
| `GET` | `/yahoo-sports/tennis-rankings` | `yahoo-sports-tennis-rankings` | Yahoo Sports tennis rankings |
| `GET` | `/yahoo-sports/tennis-schedule` | `yahoo-sports-tennis-schedule` | Yahoo Sports tennis tournament schedule |
| `GET` | `/yahoo-sports/tennis-scoreboard` | `yahoo-sports-tennis-scoreboard` | Yahoo Sports tennis scoreboard |
| `GET` | `/yahoo-sports/topic-news` | `yahoo-sports-topic-news` | Yahoo Sports topic news |
| `GET` | `/yahoo-sports/video-headlines` | `yahoo-sports-video-headlines` | Yahoo Sports video headlines |
| `GET` | `/yahoo-sports/video-list-catalog` | `yahoo-sports-video-list-catalog` | Yahoo Sports video-list catalog |
| `GET` | `/yahoo-sports/watch-schedule` | `yahoo-sports-watch-schedule` | Yahoo Sports TV schedule |

## Configuration

Pass your key through `api_key` or read `CRAWLORA_API_KEY` from the environment.
Keep credentials out of source control and logs. Requests go to Crawlora's
hosted API.
