Use the Narwhal API in Looker Studio

You can chart Narwhal holidays, release dates, economics, commodities, FX and predictions in Looker Studio through Google Sheets. Apps Script pulls the data into the sheet with your API key, and Looker Studio uses that sheet as a data source. A daily trigger adds rows for Brent, exchange rates and prediction-market odds.

What you'll set up

Looker Studio connects to a Google Sheet that holds your Narwhal data. You will use one tab per area, with Apps Script to pull the API responses into those tabs. The daily script uses tabs named Brent, FX and Fed; holidays, release dates and CPI use their own tabs through the Google Sheets tutorial. Narwhal’s economics data includes CPI, inflation, GDP and yields; the CPI request here is the economics sample for the sheet.

Set your API key

  1. Create a free key Create your account at narwhalapi.com/signup and get your API key. Narwhal uses one account and one key across its data APIs, and REST and MCP share that key.
  2. Store the key in Apps Script In the Apps Script project for your Google Sheet, store the key in Script Properties under NARWHAL_API_KEY. The script reads that property when it makes a request; keep the key out of the code you paste.
  3. Prepare the sheet tabs Create the Brent, FX and Fed tabs used by appendDaily, plus a separate tab for each remaining area you want to pull. Use the same tab names as the script so each row goes into its intended tab.

Connect the sheet to Looker Studio

  1. Fill the sheet Use the Apps Script setup in the Google Sheets tutorial to load your data. Its pullAll() function fills the holidays, release dates and CPI tabs; use appendDaily here for the daily rows.
  2. Connect the sheet as a data source In Looker Studio, connect to the Google Sheet as a data source. Use the tab for the area you want to chart, with each area kept in its own tab.
  3. Build the chart from the sheet Use the data in that tab for your chart. For a time series, keep the rows from earlier pulls and append a row on each scheduled pull instead of clearing the tab.

Pull data with code

Add this Apps Script to the Google Sheet that has your data tabs. It reads NARWHAL_API_KEY from Script Properties and sends it as an Authorization: Bearer YOUR_KEY header to https://api.narwhalapi.com. Each appended row includes the pull date; the remaining columns hold the values from that area. Brent rows contain the spot price. FX rows contain a currency and rate, while Fed rows contain a meeting resolution date and hold probability.

Apps Script, append one row per day
function appendDaily() {
  const key = PropertiesService.getScriptProperties().getProperty("NARWHAL_API_KEY");
  const get = (path) => JSON.parse(UrlFetchApp.fetch("https://api.narwhalapi.com" + path, {
    headers: { Authorization: "Bearer " + key },
  }).getContentText());
  const book = SpreadsheetApp.getActiveSpreadsheet();
  const brent = get("/v1/commodities/spot/BRENT/USD");
  book.getSheetByName("Brent").appendRow([new Date(), Number(brent.price)]);
  const fx = get("/v1/fx/rates/USD?currencies=EUR,IDR").rates;
  fx.forEach((rate) => book.getSheetByName("FX").appendRow([new Date(), rate.currency, Number(rate.rate)]));
  const hold = get("/v1/predictions/policy-paths/federal-reserve").meetings[0];
  book.getSheetByName("Fed").appendRow([new Date(), hold.resolves_at, Number(hold.p_hold)]);
}
// Holidays, releases and CPI change rarely: fill their tabs with pullAll() from the Google Sheets tutorial.

Run it on a schedule

Set a daily time-driven trigger in Apps Script to run appendDaily. The function appends Brent prices to Brent, currency rates to FX, and the first meeting’s hold probability to Fed. Looker Studio reads the sheet for the chart.

Keep the earlier rows when you want a time series. Clearing the tab would remove the previous pulls that the chart uses for its history. Holidays, release dates and CPI change rarely, so fill those tabs with pullAll() from the Google Sheets tutorial.

Holidays in Looker Studio

Pull USA holidays for 2026 into the holidays tab. The request returns holidays, with a date and name for each entry. In the Google Sheets setup, use pullAll() to fill this tab. Connect Looker Studio to the holidays tab when you want the chart to read holiday dates and names from the sheet.

Read holidays
const key = PropertiesService.getScriptProperties().getProperty("NARWHAL_API_KEY");
const get = (path) => JSON.parse(UrlFetchApp.fetch("https://api.narwhalapi.com" + path, {
  headers: { Authorization: "Bearer " + key },
}).getContentText());
const holidays = get("/v1/calendars/holidays/USA/2026").holidays;

Release dates in Looker Studio

Pull USA release dates for November 2026 into the release dates tab. Set countries=USA and use start_date and end_date for the requested range, with limit=100 as in this request. Read releases; each entry has at, period, topic and status. Use pullAll() from the Google Sheets tutorial to fill this tab with the release data.

Read release dates
const key = PropertiesService.getScriptProperties().getProperty("NARWHAL_API_KEY");
const get = (path) => JSON.parse(UrlFetchApp.fetch("https://api.narwhalapi.com" + path, {
  headers: { Authorization: "Bearer " + key },
}).getContentText());
const releases = get("/v1/economics/calendar?countries=USA&start_date=2026-11-01&end_date=2026-11-30&limit=100").releases;

Economics in Looker Studio

Use the USA CPI observations request with a start of September 2025. Read observations, then use each observation’s period and value for the CPI tab. The Google Sheets tutorial’s pullAll() function is the route for filling this tab alongside holidays and release dates. Use the observation’s period for the CPI series rather than the date that Apps Script pulls the response into the sheet.

Read CPI observations
const key = PropertiesService.getScriptProperties().getProperty("NARWHAL_API_KEY");
const get = (path) => JSON.parse(UrlFetchApp.fetch("https://api.narwhalapi.com" + path, {
  headers: { Authorization: "Bearer " + key },
}).getContentText());
const observations = get("/v1/economics/USA/cpi/observations?start=2025-09").observations;

Commodities in Looker Studio

Pull the Brent spot price in USD and read price from the response. The daily script appends the pull date and that price to Brent. Spot codes include, for example, XAU, XAG, XPT, XPD, XCU, BRENT and WTI.

Read the Brent price
const key = PropertiesService.getScriptProperties().getProperty("NARWHAL_API_KEY");
const get = (path) => JSON.parse(UrlFetchApp.fetch("https://api.narwhalapi.com" + path, {
  headers: { Authorization: "Bearer " + key },
}).getContentText());
const brent = get("/v1/commodities/spot/BRENT/USD");
brent.price;

FX in Looker Studio

Pull USD exchange rates for EUR and IDR into the FX tab. Read the response’s rates array, then currency and rate for each entry. The daily script appends each currency’s rate with the pull date, so the tab holds the rows for your time series.

Read exchange rates
const key = PropertiesService.getScriptProperties().getProperty("NARWHAL_API_KEY");
const get = (path) => JSON.parse(UrlFetchApp.fetch("https://api.narwhalapi.com" + path, {
  headers: { Authorization: "Bearer " + key },
}).getContentText());
const rates = get("/v1/fx/rates/USD?currencies=EUR,IDR").rates;

Predictions in Looker Studio

Pull the Federal Reserve policy-path response and read meetings. Each meeting has resolves_at, p_cut, p_hold and p_hike. The daily script uses the first meeting and appends its resolution date and hold probability, alongside the pull date, to Fed. To chart cut or hike probabilities, read p_cut or p_hike from the same meeting response when you fill the predictions tab.

Read prediction meetings
const key = PropertiesService.getScriptProperties().getProperty("NARWHAL_API_KEY");
const get = (path) => JSON.parse(UrlFetchApp.fetch("https://api.narwhalapi.com" + path, {
  headers: { Authorization: "Bearer " + key },
}).getContentText());
const meetings = get("/v1/predictions/policy-paths/federal-reserve").meetings;

Why go through Google Sheets?

Looker Studio’s built-in connectors have no field for a request header. Narwhal requests use the Authorization header, so Apps Script handles the request and puts the response data into Google Sheets. Looker Studio then connects to the sheet as its data source.

How fresh is the chart?

The chart is as fresh as the last trigger run plus Looker Studio’s own data cache. The daily trigger determines when Apps Script pulls data into the sheet. Looker Studio’s cache also affects when those sheet values appear in the chart.

Published .