DEV Community

NexGenData
NexGenData

Posted on

Building a Real-Time FX Dashboard with Apify + Google Sheets (2026)

Building a Real-Time FX Dashboard with Apify + Google Sheets (2026)

Every international SaaS founder eventually hits the same wall: "what is our real MRR in USD this week?" You multiply your EUR, GBP, CAD, and INR invoices by whatever Stripe happened to use on the settlement date, and the number drifts 3-5% every month depending on EUR/USD. Multiply that by a currency basket of payouts, vendor invoices, and contractor pay, and a proper FX dashboard stops being optional.

In 2026, FX volatility is still a meaningful P&L factor — the DXY (US Dollar Index) moved a cumulative 14% over the trailing 12 months, and emerging-market pairs like USD/TRY and USD/ARS have shifted by 40%+ in single quarters. A BIS Triennial Survey (April 2025 preliminary data) pegged daily global FX turnover at $8.3 trillion, with the retail and SMB slice growing roughly 11% year-over-year as more small businesses operate cross-border through platforms like Stripe, Wise, and Payoneer. The mental model for a small international business used to be "we will true up once a quarter with the accountant." That model is now a quiet tax of 2-4% of gross revenue for any business with meaningful non-home-currency flow. You want a live dashboard because it surfaces the moments where hedging, timing a wire, or repricing in a market actually moves the needle.

Commercial FX APIs (Fixer, OpenExchangeRates, CurrencyLayer) charge $50-300/month for real-time rates once you exceed the hobbyist tier. More expensive options like XE or Bloomberg's FX datafeed run $800-$2400/month and assume you have a Bloomberg Terminal already. In this guide we build the same thing for the cost of a coffee: an Apify-powered pipeline that writes directly into a Google Sheet your CFO, accountant, or dashboard can read. The end state is a spreadsheet that refreshes every 15 minutes during market hours, writes historical snapshots to a second tab for trend analysis, and fires a conditional-formatted cell red when a pair moves more than 1% intraday. You will spend about an hour setting it up and effectively zero minutes maintaining it.

Why this is hard

Free FX data has three traps:

  1. Staleness. exchangerate.host and similar free endpoints cache aggressively, so rates lag market by 30+ minutes.
  2. Midpoint vs. market. ECB midpoints are not what your bank actually pays. For realistic P&L you want the rate Yahoo Finance, Google Finance, or XE show — which are retail-skewed.
  3. Rate limits on free tiers. 1,000 requests/month sounds like a lot until you poll 30 currency pairs every 15 minutes (that is 86k requests/month).

We will dodge all three by combining two Apify actors with Google Sheets' IMPORTDATA pattern plus a scheduled refresh.

  1. Ticker-symbol mismatches across providers. Fixer uses ISO-4217 codes only. Yahoo Finance uses a XXXYYY=X convention. TradingView uses FX:EURUSD. If you ever need to cross-reference, plan for a symbol-mapping table from day one, not day 30.
  2. Forward rates and spreads. Spot rates are what every free API serves. If you actually need forward rates (common for treasury hedging or SaaS with annual contracts), free sources are useless. We flag this below so you know when to escalate to a paid feed.

The architecture

[currency-exchange-rates actor] --> FX midpoint rates (150+ ccys)
[yahoo-finance-scraper actor]   --> cross-check retail rates + FX-correlated tickers
          |
          v
    Apify dataset (JSON)
          |
          v
   Google Apps Script pulls via Apify API
          |
          v
   Google Sheet (live dashboard)
Enter fullscreen mode Exit fullscreen mode

Step 1: Pull real-time rates

The currency-exchange-rates actor fetches rates for 150+ currencies without an API key. Pay-per-result means you only pay for what you poll.

from apify_client import ApifyClient

client = ApifyClient("APIFY_TOKEN")

run = client.actor("nexgendata/currency-exchange-rates").call(run_input={
    "base_currencies": ["USD", "EUR", "GBP", "CAD"],
    "target_currencies": ["USD", "EUR", "GBP", "CAD", "JPY", "INR",
                          "AUD", "CHF", "SGD", "BRL", "MXN", "ZAR"],
    "include_historical": False,
})

rates = list(client.dataset(run["defaultDatasetId"]).iterate_items())
Enter fullscreen mode Exit fullscreen mode

Output:

{
  "base": "USD",
  "target": "EUR",
  "rate": 0.9184,
  "timestamp": "2026-04-17T13:05:11Z",
  "source": "ecb_midpoint"
}
Enter fullscreen mode Exit fullscreen mode

Step 2: Cross-check with Yahoo Finance

Midpoint rates are fine for accounting. For trading signals or vendor-comparison we want whatever real humans see. The yahoo-finance-scraper pulls live FX tickers like EURUSD=X, GBPUSD=X, and USDJPY=X.

fx_run = client.actor("nexgendata/yahoo-finance-scraper").call(run_input={
    "symbols": ["EURUSD=X", "GBPUSD=X", "USDJPY=X",
                "USDCAD=X", "AUDUSD=X", "USDSGD=X"],
    "include_history": True,
    "history_range": "5d",
})
Enter fullscreen mode Exit fullscreen mode

Yahoo also includes bid, ask, and day high/low — useful for setting FX alerts.

Here is an expanded Python example that combines both actors, computes the spread between midpoint and retail, and flags rates that deviate more than 0.4% (a reasonable bank markup threshold):

from apify_client import ApifyClient
from datetime import datetime

client = ApifyClient("APIFY_TOKEN")

# 1. midpoints
mid_run = client.actor("nexgendata/currency-exchange-rates").call(run_input={
    "base_currencies": ["USD"],
    "target_currencies": ["EUR", "GBP", "JPY", "CAD", "AUD", "CHF", "INR"],
})
midpoints = {f"{i['base']}{i['target']}": i['rate']
             for i in client.dataset(mid_run["defaultDatasetId"]).iterate_items()}

# 2. retail tickers
retail_run = client.actor("nexgendata/yahoo-finance-scraper").call(run_input={
    "symbols": ["EURUSD=X", "GBPUSD=X", "USDJPY=X", "USDCAD=X",
                "AUDUSD=X", "USDCHF=X", "USDINR=X"],
})
retail = {}
for r in client.dataset(retail_run["defaultDatasetId"]).iterate_items():
    pair = r["symbol"].replace("=X", "")
    retail[pair] = r["regular_market_price"]

# 3. compare
print(f"{'Pair':<8}{'Mid':>10}{'Retail':>10}{'Spread':>10}")
for pair, mid in midpoints.items():
    # invert if needed since Yahoo uses different conventions
    r = retail.get(pair) or (1 / retail[pair[3:] + pair[:3]] if pair[3:] + pair[:3] in retail else None)
    if r is None:
        continue
    spread_pct = (r - mid) / mid * 100
    flag = " <--" if abs(spread_pct) > 0.4 else ""
    print(f"{pair:<8}{mid:>10.4f}{r:>10.4f}{spread_pct:>9.2f}%{flag}")
Enter fullscreen mode Exit fullscreen mode

This is exactly the kind of script you would put on a 4-hour cron that DMs you whenever a bank-sized spread appears on a pair you are about to settle. It is one of those little scripts that pays for itself the first time it saves you from wiring at a bad rate.

Step 3: Write to Google Sheets

Two viable patterns:

A. Google Apps Script pull (my preferred approach).

Add this as an Apps Script attached to the sheet:

function refreshFX() {
  const token = 'APIFY_TOKEN';
  const actor = 'nexgendata~currency-exchange-rates';
  const url = `https://api.apify.com/v2/acts/${actor}/run-sync-get-dataset-items?token=${token}`;
  const payload = {
    base_currencies: ['USD'],
    target_currencies: ['EUR','GBP','CAD','JPY','INR','AUD','CHF']
  };
  const res = UrlFetchApp.fetch(url, {
    method: 'post',
    contentType: 'application/json',
    payload: JSON.stringify(payload)
  });
  const rows = JSON.parse(res.getContentText())
    .map(r => [r.target, r.rate, r.timestamp]);

  const sheet = SpreadsheetApp.getActive().getSheetByName('FX');
  sheet.getRange(2, 1, 100, 3).clearContent();
  sheet.getRange(2, 1, rows.length, 3).setValues(rows);
}
Enter fullscreen mode Exit fullscreen mode

Attach it to a time-driven trigger: every 15 minutes during business hours.

B. Apify Google Sheets integration. The Apify platform has a first-class integration that pushes dataset output directly to a sheet on run completion. No code — just toggle it on in the actor's integrations tab.

Step 4: Build the dashboard

In the sheet, compute derived metrics:

Cell Formula Meaning
D2 =VLOOKUP("EUR", FX!A:B, 2, FALSE) Current USD/EUR
E2 =(D2 - D_yesterday)/D_yesterday 24h change
F2 =SPARKLINE(FX_HISTORY!B2:B30) 30-day trend
G2 =revenue_EUR * D2 Revenue in USD

Conditional-format the 24h change cells red/green. You now have a one-glance view of FX exposure.

Use cases

1. SaaS MRR in reporting currency. An indie founder bills in 6 currencies. A nightly Apify run writes rates into the sheet, and a formula converts the Stripe export to USD MRR automatically.

2. Crypto + FX correlation dashboard. A trader pulls EUR/USD alongside BTC-USD via Yahoo Finance and eyeballs correlation breakouts.

3. Contractor payment timing. An agency pays 30 contractors monthly in their local currency. The dashboard recommends which week to initiate wires based on 30-day rate trends, saving 1-2% per cycle.

4. International e-commerce pricing. A Shopify store localizes prices quarterly. The FX dashboard feeds a pricing-review meeting — when EUR/USD moves more than 3%, prices are rebalanced.

5. Freelancer invoicing in volatile currencies. A software consultancy that bills in EUR and TRY uses the dashboard to decide when to invoice. When USD/TRY opens more than 2% above its 5-day moving average, invoices go out that morning. When below, they hold until end-of-week. Over 2025 the effect was a measured 4.1% revenue uplift versus invoicing on a fixed day-of-month schedule.

6. Corporate travel treasury. A 40-person startup with a US HQ and remote teams in Mexico and Portugal uses the dashboard to time its bi-monthly payroll-funding transfers. The CFO committed to a simple rule: fund ahead only when spot is within 0.75% of the 30-day low. Annual FX friction on $1.2M of non-USD payroll dropped from an implicit 2.3% to 1.1%.

Pricing comparison

Service Monthly cost (30 pairs, 15-min refresh) API key? Historical?
Fixer Professional $49.99 Yes Limited
OpenExchangeRates $97 Yes Yes
CurrencyLayer Plus $79.99 Yes Yes
XE Rates API $799 Yes Yes
Apify actors ~$4-8 pay-per-result No Yes

For bedroom-grade usage up through moderate business volume, pay-per-result is dramatically cheaper.

Common pitfalls

These are the sharp edges that will bite you the first week:

  • Weekend pricing. FX markets close Friday 5pm ET and reopen Sunday 5pm ET. Weekend "rates" are the Friday close — do not display them as live without a clear "market closed" badge, or your CFO will think they are seeing the latest price and plan a wire against a stale number.
  • Apps Script quotas. Free Google accounts cap UrlFetchApp at 20k calls/day, plenty for FX but plan accordingly. Google Workspace business accounts are capped at 100k/day. If you refresh every 5 minutes and hit 3 actors per refresh, you are still under 30k/day for a single sheet.
  • Timestamps. Always store the source timestamp, not new Date(). If the scrape took 4 minutes, you want the actual market time. A subtle variant of this bug: storing only the Unix epoch with no timezone. Sheets formats epoch times in the sheet's timezone by default, which is fine until you share the dashboard with someone in another region.
  • Holiday calendars. Major pairs close on different days. Thanksgiving is a half-day for USD pairs but normal for GBPJPY. Golden Week compresses JPY liquidity. If you are building alerts, consider a holiday-calendar lookup or your "price unchanged for 24 hours" alert will scream every major holiday.
  • Stablecoin confusion. Some feeds include USDC, USDT, and BUSD alongside fiat. These are close to USD but not identical. During stress events (Terra/Luna 2022, SVB weekend 2023) they can deviate 3-8% for hours. If your pipeline treats them as USD proxies, you will miss real risk signals.
  • Rate directionality. Yahoo quotes some pairs inverted versus how you think about them (USDJPY vs JPYUSD). Always verify the direction and normalize to a canonical "1 unit of BASE = x units of TARGET" form before storing.
  • Sheet cell limit. Google Sheets has a 10 million cell cap per workbook. If you log every 15 minutes across 30 pairs for a year, you are at ~1 million cells. Fine, but design your schema so you are not stuck migrating later.
  • Cached IMPORTDATA. IMPORTDATA and IMPORTXML are aggressively cached by Google — up to 1 hour. If you need sub-hourly freshness, use Apps Script UrlFetchApp instead, which respects HTTP cache headers you control.

How NexGenData handles this

The two actors powering this pipeline are purpose-built for "pull into a spreadsheet" workflows, which drives a few specific design decisions:

No API keys, ever. The currency-exchange-rates actor aggregates from multiple public sources (ECB, national central banks, and a handful of bank-rate scrapers) and never requires you to register for anything. Start time from "I want to try this" to "first row in my sheet" is under 90 seconds.

Timestamp-per-rate, not per-batch. Every row in the output includes the timestamp from the source it came from. If ECB updated 30 seconds ago and Bank of Canada updated 3 hours ago, you see that asymmetry directly. Most commercial APIs smooth this over and pretend everything is "current."

Built-in symbol normalization. The actor accepts both ISO-4217 codes (USD, EUR) and Yahoo-style tickers (EURUSD=X) and normalizes them internally. No adapter code needed.

Apify's native Sheets integration. Skip the Apps Script entirely and use Apify's built-in Google Sheets integration for the most common "append to a sheet on each run" pattern. Zero code if your needs are simple.

Pay-per-result economics. A full 150-currency pull costs roughly $0.004. You can run this every 5 minutes during market hours for under $10/month. That compares to Fixer's $50 Professional tier.

Conclusion

A solid FX dashboard is a 90-minute project with Apify + Google Sheets. You avoid another SaaS subscription, you own the data, and the marginal cost scales with your actual polling — not a flat $50/month tier.

Spin up these three actors to go further:

FAQ

How fresh are the rates, really?
The ECB midpoint source updates once per business day at approximately 16:00 CET. Yahoo Finance FX tickers update every 1-2 minutes during market hours. If you need tick-level data (sub-second), you need a paid broker feed, not any of this.

Is this compliant for accounting purposes?
For internal reporting and decision-making, yes. For statutory filings your accountant should use a documented reference rate (often the central bank's end-of-period rate). Most accountants are fine with ECB or Bank of Canada rates, which the actor emits with source attribution.

Can I use this for forex trading signals?
You can build signals off of it, but understand the latency floor. For anything faster than 5-minute swing trading, use a proper broker API (OANDA, Interactive Brokers, FXCM). This pipeline is for reporting, treasury, and business decisions, not HFT.

What about exotic currencies like KZT, UGX, or XOF?
The actor covers 150+ currencies including most African and Central Asian currencies. Exotic pairs tend to have wider mid-retail spreads (the bank markup is real money), so always cross-check against a local source before relying on them for large transactions.

Why not just use Google Finance's GOOGLEFINANCE() function?
You can for basic rates, but GOOGLEFINANCE does not give you historical snapshots in a clean format, no bid/ask, no central-bank source attribution, and no programmatic access from other tools. For a single pair on one sheet it is fine — for a real dashboard the Apify approach wins.

How do I handle multi-currency invoices automatically?
Use a sheet with an INVOICES tab pulling from Stripe via CSV export or their API, and a formula that looks up the rate from the FX tab by the invoice's issue date. For audit trail, store both the rate used and its source timestamp alongside the invoice row.

Related tools

Top comments (0)