Some checks failed
Tick / tick (push) Failing after 1s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 lines
939 B
TypeScript
20 lines
939 B
TypeScript
// Vérifie que les sources de cours gratuites répondent (US, Europe, ETF PEA, taux EUR/USD).
|
|
// Usage : pnpm tsx scripts/check-data.mts
|
|
import YahooFinance from "yahoo-finance2";
|
|
|
|
const yf = new YahooFinance({ suppressNotices: ["yahooSurvey"] });
|
|
|
|
const quotes = await yf.quote(["AAPL", "ASML.AS", "ESE.PA", "EURUSD=X", "MC.PA"]);
|
|
for (const q of quotes) {
|
|
console.log(q.symbol, q.regularMarketPrice, q.currency, q.marketState, q.longName);
|
|
}
|
|
|
|
const chart = await yf.chart("ESE.PA", { period1: "2026-09-01", interval: "1d" });
|
|
console.log("barres ESE.PA :", chart.quotes.length, chart.quotes.at(-1));
|
|
|
|
const search = await yf.search("ASML", { newsCount: 3, quotesCount: 1 });
|
|
console.log(search.news.map((n) => [n.title, n.publisher, n.providerPublishTime]));
|
|
|
|
const summary = await yf.quoteSummary("AAPL", { modules: ["calendarEvents"] });
|
|
console.log("prochains résultats AAPL :", JSON.stringify(summary.calendarEvents?.earnings));
|