Stocks and ETF lookup -
This is a simple stock lookup script.
import "@johnlindquist/kit";// Menu: Stock Quotes// Description: Get realtime stock or etf quotes// Author: Sunil Taneja// Twitter: @suniltanejalet stocks_array = ['AAPL', 'GOOG', 'MSFT', 'TSM', 'NVDA']let stocks_data = []const transformSymbol = (response) => {let stock = {}stock.latestPrice = response.data.latestPricestock.change = response.data.changestock.symbol = response.data.symbolstock.high = response.data.high ? response.data.high : `NA`stock.peRatio = response.data.peRatio ? response.data.peRatio : `NA`return stock}for await (let stock of stocks_array){// free api provided by finaza.iolet query_url = `https://www.finaza.io/api/v1/quote?symbol=${stock.toUpperCase()}&key=scriptkit`let response = await get(query_url);stocks_data.push(transformSymbol(response))}let url = await arg(`Select Stock:`,stocks_data.map((e) => {return {name: `${e.symbol} ($${e.latestPrice})`,description: `Change: ${e.change} High: ${e.high} PE Ratio: ${e.peRatio}`,value: `${e.symbol}`}}))await $`open https://www.finaza.io/stocks/${url}`;