symbolstringobligatoire
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.
Votre sortie apparaîtra ici
Complétez les entrées, puis cliquez sur Exécuter.
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.
Commencer à construire
Point de terminaison de l'API de la plateforme avec authentification unifiée et suivi de l'utilisation.
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"
}'Définissez votre clé API SandBase dans l'environnement de votre serveur. Les requêtes utilisent l'authentification Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Conservez votre clé côté serveur. Ne l'exposez pas dans le code du navigateur.
symbolstringobligatoireStock ticker symbol (e.g., AAPL).
rangestringDate range for historical data.
intervalstringData interval granularity.
Exemple de réponse enregistré pour cette API ; aucune requête en direct n'est effectuée lors de l'affichage.
Aucune réponse enregistrée n'a été publiée. Exécutez l'API dans Playground pour inspecter sa réponse.
Explorer plus
| API | Prix | Réponse |
|---|---|---|
Yahoo Finance Historical DataCette API Yahoo Finance | $0.05 par appel | JSON asynchrone |
Yahoo Finance | À partir de $0.00099 par appel | JSON |
Yahoo Finance | $0.05 par appel | JSON asynchrone |
Yahoo Finance | À partir de $0.00099 par appel | JSON |
Yahoo Finance | $0.05 par appel | JSON asynchrone |
Yahoo Finance | $0.05 par appel | JSON asynchrone |
Questions
Envoyez une requête POST à https://api.sandbase.ai/v1/api/yahoo-finance/historical-data avec votre clé API SandBase dans l’en-tête Authorization (Bearer) et les paramètres dans un corps JSON. Vous pouvez aussi l’essayer dans le Playground sur cette page sans écrire de code.
$0.05 par appel, facturé depuis votre solde SandBase. Vous ne payez que les appels que vous effectuez ; aucun abonnement.
Obligatoire : symbol (string). Facultatif : range (string) et interval (string). Le tableau des paramètres et le Playground sur cette page listent tous les champs.
Un résultat JSON. Ce point de terminaison s’exécute de manière asynchrone, donc la réponse vous indique comment récupérer le résultat final. Le README sur cette page inclut un exemple de réponse.
Non. Yahoo Finance Historical Data fonctionne via SandBase, donc une seule clé API SandBase couvre ce point de terminaison ainsi que toutes les autres API et tous les modèles du catalogue. Vous n’avez pas besoin de demander un accès API Yahoo Finance séparément.