Public
Edited
Jan 10, 2023
Insert cell
Insert cell
symbols = ['AAPL', 'NFLX', 'GOOG']
Insert cell
moment = require("moment")
Insert cell
date = {
return moment().add(-1, 'days').format("YYYY-MM-DD")
}
Insert cell
tickers = {
let throwAwayApiKey = '9NBjQYS1g9QPfbyZUa4siHerA8hAqPnf'
let responses = []
for (let i = 0; i < symbols.length; i++) {
await Promises.delay(1000)
await fetch(`https://api.polygon.io/v1/open-close/${symbols[i]}/${date}?adjusted=true&apiKey=${throwAwayApiKey}`)
.then(x => x.json())
.then(x => responses.push(x))

yield responses
}
}
Insert cell
viewof table = Inputs.table(tickers)
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more