Metadata-Version: 2.4
Name: crawlora-yahoo-finance
Version: 0.1.0
Summary: Crawlora Yahoo Finance API client with 39 endpoints for quotes, market data, company information, financial statements, calendars, and chart history
Author: Crawlora
License-Expression: MIT
Project-URL: Homepage, https://crawlora.net/?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=yahoo-finance-python-homepage
Project-URL: Documentation, https://crawlora.net/docs?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=yahoo-finance-python-api-docs
Project-URL: Repository, https://github.com/Crawlora-org/crawlora-yahoo-finance
Keywords: crawlora,api-client,sdk,web-scraping,scraping-api,yahoo-finance,yahoo-finance-api,yahoo-finance-scraper,yahoo-finance-data,yahoo-finance-quotes,yahoo-finance-market-data,yahoo-finance-company-information,yahoo-finance-financial-statements,yahoo-finance-calendars,yahoo-finance-chart-history
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-finance — Yahoo Finance API client for Python

Python client for Crawlora's hosted Yahoo Finance API. It exposes 39 API endpoints covering quotes, market data, company information, financial statements, calendars, and chart history. Requests go to [Crawlora](https://crawlora.net/?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=yahoo-finance-python-homepage); the package does not run a browser or scrape
Yahoo Finance 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 Finance or its owners.

## Install

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

## 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-finance-python-signup), then open the [Crawlora console](https://crawlora.net/app?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=yahoo-finance-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_finance import YahooFinanceClient

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

with YahooFinanceClient(api_key=api_key) as client:
    result_1 = client.calendars()
    print(result_1)
    result_2 = client.industries()
    print(result_2)
```

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

### Async usage

The package also exports `AsyncClient` for asynchronous requests:

```python
import asyncio
import os

from crawlora_yahoo_finance 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.calendars()
        print(result_1)

asyncio.run(main())
```

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

## Supported Yahoo Finance API endpoints

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

| Method | Endpoint | API operation | Description |
| --- | --- | --- | --- |
| `GET` | `/yahoo-finance/calendars` | `yahoo-finance-calendars` | Yahoo Finance calendar types |
| `GET` | `/yahoo-finance/calendars/{type}` | `yahoo-finance-calendar` | Yahoo Finance calendar results |
| `POST` | `/yahoo-finance/download` | `yahoo-finance-download` | Yahoo Finance batch historical prices |
| `GET` | `/yahoo-finance/industries` | `yahoo-finance-industries` | Yahoo Finance industries |
| `GET` | `/yahoo-finance/industries/{key}` | `yahoo-finance-industry` | Yahoo Finance industry detail |
| `GET` | `/yahoo-finance/lookup` | `yahoo-finance-lookup` | Yahoo Finance lookup |
| `GET` | `/yahoo-finance/market/{market}/status` | `yahoo-finance-market-status` | Yahoo Finance market status |
| `GET` | `/yahoo-finance/market/{market}/summary` | `yahoo-finance-market-summary` | Yahoo Finance market summary |
| `POST` | `/yahoo-finance/screener` | `yahoo-finance-screener-custom` | Yahoo Finance custom screener |
| `GET` | `/yahoo-finance/screener/{id}` | `yahoo-finance-screener` | Yahoo Finance predefined screener results |
| `GET` | `/yahoo-finance/screeners` | `yahoo-finance-screeners` | Yahoo Finance predefined screeners |
| `GET` | `/yahoo-finance/search` | `yahoo-finance-search` | Yahoo Finance search |
| `GET` | `/yahoo-finance/sectors` | `yahoo-finance-sectors` | Yahoo Finance sectors |
| `GET` | `/yahoo-finance/sectors/{key}` | `yahoo-finance-sector` | Yahoo Finance sector detail |
| `GET` | `/yahoo-finance/ticker/{symbol}/actions` | `yahoo-finance-ticker-actions` | Yahoo Finance corporate actions |
| `GET` | `/yahoo-finance/ticker/{symbol}/analysts` | `yahoo-finance-ticker-analysts` | Yahoo Finance analyst data |
| `GET` | `/yahoo-finance/ticker/{symbol}/calendar` | `yahoo-finance-ticker-calendar` | Yahoo Finance calendar |
| `GET` | `/yahoo-finance/ticker/{symbol}/capital-gains` | `yahoo-finance-ticker-capital-gains` | Yahoo Finance capital gains |
| `GET` | `/yahoo-finance/ticker/{symbol}/dividends` | `yahoo-finance-ticker-dividends` | Yahoo Finance dividends |
| `GET` | `/yahoo-finance/ticker/{symbol}/earnings` | `yahoo-finance-ticker-earnings` | Yahoo Finance earnings |
| `GET` | `/yahoo-finance/ticker/{symbol}/earnings-dates` | `yahoo-finance-ticker-earnings-dates` | Yahoo Finance earnings dates |
| `GET` | `/yahoo-finance/ticker/{symbol}/financials` | `yahoo-finance-ticker-financials` | Yahoo Finance financial statements |
| `GET` | `/yahoo-finance/ticker/{symbol}/funds` | `yahoo-finance-ticker-funds` | Yahoo Finance fund data |
| `GET` | `/yahoo-finance/ticker/{symbol}/history` | `yahoo-finance-ticker-history` | Yahoo Finance historical prices |
| `GET` | `/yahoo-finance/ticker/{symbol}/history-metadata` | `yahoo-finance-ticker-history-metadata` | Yahoo Finance history metadata |
| `GET` | `/yahoo-finance/ticker/{symbol}/holders` | `yahoo-finance-ticker-holders` | Yahoo Finance holders |
| `GET` | `/yahoo-finance/ticker/{symbol}/info` | `yahoo-finance-ticker-info` | Yahoo Finance ticker info |
| `GET` | `/yahoo-finance/ticker/{symbol}/isin` | `yahoo-finance-ticker-isin` | Yahoo Finance ticker ISIN |
| `GET` | `/yahoo-finance/ticker/{symbol}/news` | `yahoo-finance-ticker-news` | Yahoo Finance ticker news |
| `GET` | `/yahoo-finance/ticker/{symbol}/options` | `yahoo-finance-ticker-options` | Yahoo Finance options chain |
| `GET` | `/yahoo-finance/ticker/{symbol}/options/{expiration}` | `yahoo-finance-ticker-options-expiration` | Yahoo Finance options chain by expiration |
| `GET` | `/yahoo-finance/ticker/{symbol}/quote` | `yahoo-finance-ticker-quote` | Yahoo Finance ticker quote |
| `GET` | `/yahoo-finance/ticker/{symbol}/sec-filings` | `yahoo-finance-ticker-sec-filings` | Yahoo Finance SEC filings |
| `GET` | `/yahoo-finance/ticker/{symbol}/shares` | `yahoo-finance-ticker-shares` | Yahoo Finance share counts |
| `GET` | `/yahoo-finance/ticker/{symbol}/shares-full` | `yahoo-finance-ticker-shares-full` | Yahoo Finance historical share counts |
| `GET` | `/yahoo-finance/ticker/{symbol}/splits` | `yahoo-finance-ticker-splits` | Yahoo Finance splits |
| `GET` | `/yahoo-finance/ticker/{symbol}/sustainability` | `yahoo-finance-ticker-sustainability` | Yahoo Finance sustainability |
| `GET` | `/yahoo-finance/ticker/{symbol}/valuation` | `yahoo-finance-ticker-valuation` | Yahoo Finance valuation measures |
| `GET` | `/yahoo-finance/trending/{region}` | `yahoo-finance-trending` | Yahoo Finance trending symbols |

## 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.
