Mutual fund NAV in Google Sheets

Add one small function and type =FUNDNAV(122639) in any cell to get that scheme's latest NAV. Spreadsheets cannot send an API key in a header on their own, so this uses Google Apps Script.

Faster way: the Sheets Lab in the Explorer builds all of this for you. Add your funds there, copy one script, and it adds the formulas, an EJI API menu for your key, and a ready portfolio sheet with XIRR. The steps below are the manual version.

You need an API key: request a free beta key. Keep it in an environment variable, never in code you publish.

Steps

  1. Open your sheet, then Extensions → Apps Script.
  2. In the Apps Script editor open Project Settings (gear icon), find Script properties, and add a property named EJI_KEY with your key as the value. This keeps the key out of the sheet itself, so people you share the sheet with cannot read it from a cell.
  3. Go back to the code editor, delete what is there, paste the function below and save.
function FUNDNAV(code) {
  const key = PropertiesService.getScriptProperties().getProperty("EJI_KEY");
  const res = UrlFetchApp.fetch("https://fin.ejiapi.com/api/mf/scheme-code/" + code, {
    headers: { "x-api-key": key }
  });
  return JSON.parse(res.getContentText()).data.latestNav;
}
// In a cell: =FUNDNAV(122639)
  1. In a cell type =FUNDNAV(122639). The first time, Google asks you to authorise the script to connect to an external service. Allow it.

Good to know

Get a free API key All guides

Data comes from public disclosures and is for information, not investment advice. Sample outputs were produced on 2026-11-08 and change as new data is published.