symbolstringจำเป็น
Stock ticker symbol (e.g., AAPL).
https://api.sandbase.ai/v1/api/yahoo-finance/historical-dataExtract historical OHLCV price data for a single ticker over a configurable date range and interval. Returns timestamped records suitable for charting and technical analysis.
เอาต์พุตของคุณจะแสดงที่นี่
กรอกอินพุตให้ครบ แล้วคลิก Run
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.
open, high, low and close values.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.
| Name | Type | Required | Description |
|---|---|---|---|
symbol | string | Yes | Stock ticker symbol (e.g., AAPL). |
interval | string | No | Data interval granularity. |
range | string | No | Date range for historical data. |
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"
}
| Field | Meaning |
|---|---|
data.symbol | The ticker symbol the history belongs to, such as AAPL. |
data.currency | The 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[].timestamp | The start time of the record as a Unix timestamp in seconds. |
data.history[].open / data.history[].close | The first and last price of the interval. |
data.history[].high / data.history[].low | The highest and lowest price reached during the interval. |
data.history[].volume | The number of shares traded during the interval. |
status | Shows success when the request worked. |
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.$0.05 per successful call. Failed calls are not charged.
เริ่มสร้าง
เอ็นด์พอยต์ของ Platform API ที่มีการยืนยันตัวตนและการติดตามการใช้งานแบบรวมศูนย์
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"
}'ตั้งค่า SandBase API key ของคุณในสภาพแวดล้อมฝั่งเซิร์ฟเวอร์ คำขอจะใช้การยืนยันตัวตนแบบ Bearer
export SANDBASE_API_KEY="YOUR_API_KEY"เก็บ key ไว้บนเซิร์ฟเวอร์ อย่าเปิดเผยในโค้ดฝั่งเบราว์เซอร์
symbolstringจำเป็นStock ticker symbol (e.g., AAPL).
rangestringDate range for historical data.
intervalstringData interval granularity.
บันทึกตัวอย่างการตอบกลับสำหรับ API นี้; จะไม่มีการส่งคำขอจริงเมื่อเปิดดู
ยังไม่มีการเผยแพร่การตอบกลับที่บันทึกไว้ ให้รัน API ใน Playground เพื่อดูการตอบกลับ
สำรวจเพิ่มเติม
| API | ราคา | การตอบกลับ |
|---|---|---|
Yahoo Finance | $0.05 ต่อการเรียก | Async JSON |
Yahoo Finance | เริ่มต้นที่ $0.00099 ต่อครั้ง | JSON |
Yahoo Finance | $0.05 ต่อการเรียก | Async JSON |
Yahoo Finance | เริ่มต้นที่ $0.00099 ต่อครั้ง | JSON |
Yahoo Finance | $0.05 ต่อการเรียก | Async JSON |
Yahoo Finance | $0.05 ต่อการเรียก | Async JSON |
คำถาม
ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/yahoo-finance/historical-data โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด
$0.05 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน
ที่ต้องระบุ: symbol (string). ตัวเลือก: range (string) และ interval (string). ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์
ผลลัพธ์ JSON จุดเชื่อมต่อนี้ทำงานแบบอะซิงโครนัส ดังนั้นการตอบกลับจะบอกวิธีดึงผลลัพธ์ที่เสร็จแล้ว README บนหน้านี้มีตัวอย่างการตอบกลับ
ไม่จำเป็น Yahoo Finance Historical Data ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง Yahoo Finance API แยกต่างหาก