Eodhd free plan API (registered to free plane) to get the live price (or close price) for some ETFs

I’m trying to use I’m trying to use eodhd free plan API (registered to free plane) to get the live price (or close price) for some ETFs.

  1. This apps-script code return “data.close” = “NA”

  2. I’ve installed your google-sheet extension, but can it fill the price in one of my specific cells?

ETFs are: ZRPX, ZPRV, AVWS

  1. This apps-script code return “data.close” = “NA”
  symbol = "AVWS";
  var apiKey = 'MY_API_KEY'; // I put it when I run!
  var apiUrl = 'https://eodhistoricaldata.com/api/real-time/' + symbol + '.US?api_token=' + apiKey + '&fmt=json';

  try {
    var response = UrlFetchApp.fetch(apiUrl, {muteHttpExceptions: true});
    if (response.getResponseCode() === 401) {
      throw new Error('Unauthorized: Please check your API key and permissions.');
    }
    var data = JSON.parse(response.getContentText());

    if (!data || !data.close) {
      throw new Error('Invalid symbol or data not available.');
    }

    var price = parseFloat(data.close);

    if (isNaN(price)) {
      throw new Error('Price data not available.');
    }

    return price;
  } catch (error) {
    return 'Error: ' + error.message;
  }
}
  1. I’ve installed your google-sheet extension, but can it fill the price in one of my specific cells?

ETFs are: ZRPX.F, ZPRV.F, AVWS.DE

Fixed:

I removed the “US” in the url

We’re glad you were able to resolve this issue. For similar questions in the future, we recommend reaching out to our technical support team via the chat on our website or by emailing support@eodhistoricaldata.com. As you’ve experienced firsthand, our support team responds promptly and provides effective assistance in resolving any concerns.