Skip to main content

Overview

The Chart API provides historical OHLCV data, real-time quotes, and charting configuration.

Methods

get_historical_bars(symbol, from_date, to_date, resolution)

bars = client.chart.get_historical_bars(
    symbol="AAPL",
    from_date="2025-01-01",
    to_date="2025-01-15",
    resolution="1D"
)

for bar in bars:
    print(f"{bar.timestamp}: O:{bar.open} H:{bar.high} L:{bar.low} C:{bar.close} V:{bar.volume}")

get_quotes(symbols)

quotes = client.chart.get_quotes(["AAPL", "GOOGL"])
for quote in quotes:
    print(f"{quote.symbol}: ${quote.price}")

get_symbol_info(symbol)

info = client.chart.get_symbol_info("AAPL")

get_config()

config = client.chart.get_config()
print(f"Supported resolutions: {config.supported_resolutions}")

get_server_time()

timestamp = client.chart.get_server_time()

Examples

Plot Price History

import matplotlib.pyplot as plt

bars = client.chart.get_historical_bars(
    symbol="AAPL",
    from_date="2024-01-01",
    to_date="2025-01-01",
    resolution="1D"
)

dates = [bar.timestamp for bar in bars]
closes = [bar.close for bar in bars]

plt.plot(dates, closes)
plt.title("AAPL Price History")
plt.show()