Skip to main content

ticker-price-data

Unified ticker price data from Yahoo Finance (stocks/indices/forex/futures), CoinGecko (crypto), and TradingView (universal fallback).

One normalized quote shape for every asset, with sensible fallbacks and built-in caching.

Key Features 🔑

  • get_price(ticker, asset_type) — single entry point; asset_type="auto" uses ticker-classifier to decide stock vs crypto vs forex automatically.
  • get_ticker(ticker) — everything known about a symbol in one call: classification metadata (sector, industry, market cap, company profile, fundamentals, ...) plus the live quote, classifying only once.
  • get_stock_info(ticker) — Yahoo Finance, with a TradingView fallback.
  • get_price_history(ticker, range_, interval) — raw Yahoo Finance chart series (any range/interval Yahoo supports, e.g. a full trading day at 1-minute resolution) for drawing detailed price lines/sparklines. Works for crypto too via "BTC-USD"-style symbols.
  • get_crypto_info(ticker) — CoinGecko via the website search_v2 endpoint (avoids the public API's free-tier rate limits), with Yahoo → TradingView fallbacks.
  • get_tradingview_quote(symbol, asset_hint) — realtime websocket pool + scraper fallback.
  • In-memory caching, stale/negative caching, and concurrency limits built in.
  • Pre-market and after-hours data where available.

All helpers return Optional[dict]:

{
    "price": float,
    "change_percent": float,
    "volume": float,
    "website": str,
    "source": str,                      # "yahoo" | "coingecko" | "tradingview"
    # stocks only:
    "last_close": float | None,         # previous day's regular-session close
    "session": str,                     # "regular" | "pre-market" | "after-hours" | "closed"
    "extended_price": float,            # pre/after-hours price (omitted when session == "regular")
    "extended_change_percent": float,   # (extended_price − price) / price × 100 (omitted when session == "regular")
}

extended_price and extended_change_percent persist from the end of after-hours (8 pm ET) through weekends and holidays until pre-market opens (4 am ET) on the next trading day.

Installation ⚙️

pip install ticker-price-data

or, for local development:

pip install -e .

Usage ⌨️

import asyncio
from ticker_price_data import (
    get_price,
    get_ticker,
    get_stock_info,
    get_crypto_info,
    get_price_history,
)

async def main():
    print(await get_stock_info("AAPL"))     # Yahoo
    print(await get_crypto_info("BTC"))     # CoinGecko
    print(await get_price("BTC", "auto"))   # classified automatically
    print(await get_ticker("AAPL"))         # metadata (sector, industry, ...) + quote
    print(await get_price_history("BTC-USD", range_="1d", interval="1m"))  # intraday series

asyncio.run(main())

License 📜

This project is licensed under the MIT License. See the LICENSE file for details.

Release files for ticker-price-data 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ticker-price-data 0.1.5
File Size Uploaded
ticker_price_data-0.1.5.tar.gz 34.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ticker-price-data 0.1.5
File Interpreter ABI Platform
ticker_price_data-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 57.5 kB

Release files / ticker_price_data-0.1.5.tar.gz

Download URL ticker_price_data-0.1.5.tar.gz
Size 34.3 kB
Tags Source
SHA-256 checksum
How to use checksums
fbcf2a3e52de1463f94ca8c9ddd737f9627c29f8ffa977eafda616df0adc96ff
BLAKE2b-256 checksum
How to use checksums
62598e59d4bca67512b625831f4905a71d72c7a45372f1ca8fe63f06e82d1f3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / ticker_price_data-0.1.5-py3-none-any.whl

Download URL ticker_price_data-0.1.5-py3-none-any.whl
Size 23.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e110f3e612132414ad139b537ae47b5ca03a1fe0c85f5c0ec97e03340f38fa1
BLAKE2b-256 checksum
How to use checksums
f115d0319e1df986234b5ebe81f76e9b95f3a008ba5ad39137776a568f28ce9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page