Sand AISand AI MAGI-2MAGI-2 hiện đã có trên SandBase: video 1080p với âm thanh gốcDùng thử ngay

Yahoo Finance Historical Data

Tài liệu 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.

Giá
$0.05USD / lượt gọi
Phương thức
POST
Phản hồi
JSON bất đồng bộ
Tham số
1 bắt buộc · 2 tùy chọn

Phòng thử nghiệm

Đầu vào
Stock ticker symbol (e.g., AAPL).
Date range for historical data.
Data interval granularity.
Đầu raSẵn sàng

Đầu ra của bạn sẽ xuất hiện ở đây

Hoàn tất đầu vào, rồi nhấp Run.

README API

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.

Khám phá thêm

APIs liên quan

Tất cả APIs
APIGiáPhản hồi
Yahoo Finance$0.05 mỗi lần gọiJSON bất đồng bộ
Yahoo FinanceTừ $0.00099 mỗi lần gọiJSON
Yahoo Finance$0.05 mỗi lần gọiJSON bất đồng bộ
Yahoo FinanceTừ $0.00099 mỗi lần gọiJSON
Yahoo Finance$0.05 mỗi lần gọiJSON bất đồng bộ
Yahoo Finance$0.05 mỗi lần gọiJSON bất đồng bộ

Câu hỏi

FAQ

Làm thế nào để dùng API Yahoo Finance Historical Data?

Gửi yêu cầu POST đến https://api.sandbase.ai/v1/api/yahoo-finance/historical-data với khóa API SandBase của bạn trong tiêu đề Authorization (Bearer) và các tham số trong phần thân JSON. Bạn cũng có thể thử trực tiếp trong Playground trên trang này mà không cần viết code.

API Yahoo Finance Historical Data có giá bao nhiêu?

$0.05 mỗi lần gọi, được tính từ số dư SandBase của bạn. Bạn chỉ bị tính phí cho các lần gọi bạn thực hiện; không có gói đăng ký.

API Yahoo Finance Historical Data chấp nhận những tham số nào?

Bắt buộc: symbol (string). Tùy chọn: range (string) và interval (string). Bảng Parameters và Playground trên trang này liệt kê mọi trường.

API Yahoo Finance Historical Data trả về gì?

Kết quả JSON. Endpoint này chạy bất đồng bộ, nên phản hồi sẽ cho bạn biết cách lấy kết quả hoàn tất. README trên trang này có ví dụ phản hồi.

Tôi có cần tài khoản nhà phát triển hoặc API key của Yahoo Finance không?

Không. Yahoo Finance Historical Data chạy thông qua SandBase, nên chỉ cần một API key SandBase là đủ cho endpoint này và mọi API cùng model khác trong danh mục. Bạn không cần đăng ký riêng để có quyền truy cập API của Yahoo Finance.