Sand AISand AI MAGI-2MAGI-2 現已登上 SandBase:支援原生音訊的 1080p 影片立即試用

Yahoo Finance Historical Data

API 文件
https://api.sandbase.ai/v1/api/yahoo-finance/historical-data

Extract historical OHLCV price data for a single ticker over a configurable date range and interval. Returns timestamped records suitable for charting and technical analysis.

價格
$0.05美元/次呼叫
方法
POST
回應
非同步 JSON
參數
1 個必填 · 2 個選填

Playground

輸入
Stock ticker symbol (e.g., AAPL).
Date range for historical data.
Data interval granularity.
輸出就緒

您的輸出會顯示在這裡

完成輸入後,點擊執行。

API README

Yahoo Finance Historical Data

Returns historical price records for one stock ticker on Yahoo Finance. Each record has open, high, low, close and volume values with a timestamp. The only required input is symbol, and you can set range and interval to change the window and spacing.

Use cases

  • Plot a candlestick chart for AAPL from the returned open, high, low and close values.
  • Compute moving averages or other technical indicators over the closing price series.
  • Compare trading volume across days to spot unusually active sessions.
  • Export daily price history for a ticker into a spreadsheet or backtesting tool.

Request

curl -X POST "https://api.sandbase.ai/v1/api/yahoo-finance/historical-data" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"symbol": "AAPL"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
symbolstringYesStock ticker symbol (e.g., AAPL).
intervalstringNoData interval granularity.
rangestringNoDate range for historical data.

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "data": {
    "currency": "USD",
    "history": [
      {
        "close": 269.04998779296875,
        "high": 270.8500061035156,
        "low": 266.25,
        "open": 270.4200134277344,
        "timestamp": 1762180200,
        "volume": 50194600
      }
    ],
    "symbol": "AAPL"
  },
  "status": "success"
}

Response fields

FieldMeaning
data.symbolThe ticker symbol the history belongs to, such as AAPL.
data.currencyThe currency code of the price values, such as USD.
data.history[]One price record per interval, listed in order from oldest to newest.
data.history[].timestampThe start time of the record as a Unix timestamp in seconds.
data.history[].open / data.history[].closeThe first and last price of the interval.
data.history[].high / data.history[].lowThe highest and lowest price reached during the interval.
data.history[].volumeThe number of shares traded during the interval.
statusShows success when the request worked.

Notes

  • symbol is the stock ticker. If you do not know it, use Yahoo Finance Search Tickers to find it.
  • timestamp values are Unix seconds. Convert them to dates before charting.
  • Price values are floats with many decimal places. Round them for display.
  • For the latest price instead of a series, call Yahoo Finance Quote.

Pricing

$0.05 per successful call. Failed calls are not charged.

探索更多

相關 APIs

所有 APIs
API價格回應
Yahoo Finance每次呼叫 $0.05非同步 JSON
Yahoo Finance每次呼叫 $0.00099 起JSON
Yahoo Finance每次呼叫 $0.05非同步 JSON
Yahoo Finance每次呼叫 $0.00099 起JSON
Yahoo Finance每次呼叫 $0.05非同步 JSON
Yahoo Finance每次呼叫 $0.05非同步 JSON

問題

常見問題

我要如何使用 Yahoo Finance Historical Data API?

使用 POST 請求將您的 SandBase API 金鑰放在 Authorization 標頭(Bearer)中,並以 JSON 主體傳入參數,即可呼叫 https://api.sandbase.ai/v1/api/yahoo-finance/historical-data。您也可以直接在本頁的 Playground 試用,不必撰寫程式碼。

Yahoo Finance Historical Data API 的費用是多少?

每次 $0.05,並從您的 SandBase 餘額中扣款。您只會為實際發出的呼叫付費;沒有訂閱方案。

Yahoo Finance Historical Data API 接受哪些參數?

必要:symbol (string)。 選填:range (string) 和 interval (string)。 本頁的 Parameters 表格與 Playground 會列出每個欄位。

Yahoo Finance Historical Data API 會回傳什麼?

JSON 結果。此端點為非同步執行,因此回應會告訴您如何取得完成的結果。 本頁的 README 包含範例回應。

我需要 Yahoo Finance 開發者帳號或 API 金鑰嗎?

不需要。Yahoo Finance Historical Data 是透過 SandBase 運作,因此一組 SandBase API 金鑰即可使用此端點以及目錄中的其他所有 API 和模型。您不需要另外申請 Yahoo Finance API 存取權。