Can someone help me with this stock quote script?

I’m trying to get a stock quote script to work for me. I’m not someone that understands scripts, but I think I have it right. Although something is wrong and not sure what.

The API is from, which I found mentioned in this forum.

When I run it I get this result:

Blockquote Updating stock prices

Updating price of aapl…
Can’t update the price of stock with no name
Can’t update the price of stock with no name
aapl’s price right now is: $undefined


Here is the script I have, with the field names changed to my field names (Symbol, Price, Price Date)

(Sorry for the way the code looks below, not sure how to paste in code)

output.markdown ("# Updating stock prices");

let table = base.getTable (“Holdings”),
records = await table.selectRecordsAsync ();

await Promise.all ( (async record => {

    let stock = record.getCellValue ("Symbol");

    if (! stock) {

        output.text ("Can't update the price of stock with no name");


    output.text (`Updating price of ${stock}...`);

    // make request
    var requestResult = await fetch (
    ).then (r => r.json ());

    // print fetched data
    output.markdown (`${stock}'s price right now is: **$${requestResult.price}**`)

    // update record in table
    return await table.updateRecordAsync (record, {
        "Price": requestResult.price,
        "Price Date": new Date ()

output.markdown ("# Done!");


I hope you’re doing great!

I would be happy to work with you. Please give me a suitable time to discuss your requirements. looking forward to hearing from you
Thanks and regards

This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.