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?

向 https://api.sandbase.ai/v1/api/yahoo-finance/historical-data 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 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 key 吗?

不需要。Yahoo Finance Historical Data 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 Yahoo Finance API 访问权限。