Yahoo Finance API Documentation

A powerful API for accessing real-time stock data, historical prices, and market information

⚡ USD/IDR Exchange Rate

Loading...

Real-time Data

Access live stock quotes and market data with millisecond precision

📈

Historical Data

Get detailed historical price data with customizable date ranges

🔍

Smart Search

Find stocks by symbol or company name across global markets

Stock History API

This API endpoint fetches historical stock data from Yahoo Finance.

Endpoint

/api/stock/history

Query Parameters

ParameterRequiredDescription
symbolStock symbol (e.g., BBRI.JK, TSLA)
period1optionalStart date (YYYY-MM-DD)
period2optionalEnd date (YYYY-MM-DD, defaults to today)
intervaloptionalData interval (1d, 1wk, 1mo), default is 1d
limitoptionalLimit number of results

Example Request

GET /api/stock/history?symbol=AAPL&period1=2023-01-01&period2=2023-04-01&interval=1d&limit=10

Example Response

[
  {
    "date": "2023-01-01",
    "open": 150.0,
    "high": 155.0,
    "low": 149.0,
    "close": 154.0,
    "volume": 1000000,
    "adjClose": 154.0
  },
  ...
]

This API uses yahoo-finance2 under the hood.

Stock Quote API

This API endpoint fetches real-time stock quote data from Yahoo Finance.

Endpoint

/api/stock/quote

Query Parameters

ParameterRequiredDescription
symbolStock symbol (e.g., BBRI.JK, AAPL, TSLA)

Example Request

GET /api/stock/quote?symbol=BBRI.JK

Example Response

{
  "symbol": "BBRI.JK",
  "regularMarketPrice": 3850,
  "regularMarketChange": 0,
  "regularMarketChangePercent": 0,
  "regularMarketVolume": 226832200,
  "regularMarketOpen": 3810,
  "marketCap": 579998624776192,
  "shortName": "Bank Rakyat Indonesia (Persero)",
  "longName": "PT Bank Rakyat Indonesia (Persero) Tbk",
  "currency": "IDR",
  "regularMarketTime": "2025-04-30T09:14:53.000Z",
  "firstTradeDateMilliseconds": "2003-11-10T02:00:00.000Z",
  "trailingAnnualDividendYield": 0.089194804,
  "trailingAnnualDividendRate": 343.4,
  "trailingPE": 9.65251,
  "forwardPE": 8.746223,
  "fiftyTwoWeekHigh": 5575,
  "fiftyTwoWeekLow": 3360,
  "priceToBook": 1.8963267,
  "epsTrailingTwelveMonths": 398.86,
  "epsForward": 440.19,
  "epsCurrentYear": 385.72382,
  "priceEpsCurrentYear": 9.981235,
  "sharesOutstanding": 150648995840,
  "previousClose": 3850,
  "dayHigh": 3850,
  "dayLow": 3770,
  "averageDailyVolume3Month": 322963767,
  "averageDailyVolume10Day": 205188250,
  "bookValue": 2030.241,
  "customPriceAlertConfidence": "LOW",
  "fiftyTwoWeekHighChangePercent": -0.30941704,
  "fiftyTwoWeekHighChange": -1725,
  "fiftyTwoWeekLowChangePercent": 0.14583333,
  "fiftyTwoWeekLowChange": 490,
  "ask": 3850,
  "bid": 3840
}

This API uses yahoo-finance2 under the hood.