Skip to main content

Historical Charts

Use historical prices for charting, return calculations, and technical analysis.

Python

import yfin as yf

aapl = yf.Ticker("AAPL", contact="you@example.com")
history = aapl.history(period="6mo", interval="1d", auto_adjust=True)

print(history.tail())

Download multiple symbols:

import yfin as yf

prices = yf.download(["AAPL", "MSFT", "NVDA"], period="1mo", interval="1d")

TypeScript

import { Client } from "@yfin/sdk";

const client = new Client({ contact: "you@example.com" });

const history = await client.history("AAPL", {
period: "6mo",
interval: "1d",
});

REST

curl "https://api.yfin.dev/v1/history?symbol=AAPL&period=6mo&interval=1d" \
-H "X-Yfin-Contact: you@example.com"

Exact Date Windows

Use start and end when your app needs a reproducible date window.

curl "https://api.yfin.dev/v1/history?symbol=AAPL&start=2025-01-01&end=2025-12-31&interval=1d"

Chart UI Checklist

  • Show the selected interval and range near the chart.
  • Use exchange timezone metadata when grouping intraday candles.
  • Treat missing bars as unavailable data, not zero-volume bars unless the response explicitly returns zero volume.
  • Use adjusted prices for long-horizon return charts when that is the metric users expect.

For deeper behavior, see Historical Prices and Adjusted Prices.