How to get live gold prices in n8n

Pull live gold prices into n8n via the HTTP Request node v4, with scheduled cadence and downstream branches for Slack, Postgres, or Sheets.

Updated

To get live gold prices in n8n, add an HTTP Request node v4 that GETs api.goldprice.dev/v1/spot/XAU-USD-SPOT with your API key in the X-API-Key header via Header Auth credentials. Trigger it on a Schedule node — hourly is the safe default. The free tier covers 1,000 calls/month, no credit card. Tested April 2026 against n8n 1.71+ (Cloud and self-hosted).

  1. 1.Get your goldprice.dev API key

    Sign up for a free account at goldprice.dev/onboarding. Your dashboard shows a key starting with goldprice_live_. You will store it in n8n credentials in the next step — never paste it inline into a node.

    The free tier includes 1,000 calls/month and 13 supported currencies. No credit card required.

    Get your free API key1,000 calls/mo, no credit card
    Sign up free →
  2. 2.Create a Header Auth credential

    In n8n, click Credentials → New → Header Auth. Set Name to X-API-Key and Value to your goldprice.dev key. Save. This credential will attach to the HTTP Request node so the key never appears in the workflow JSON when you export or share it.

  3. 3.Build the workflow — Schedule + HTTP Request v4

    Create a new workflow with two nodes. (1) Schedule Trigger — set Mode to Every Hour at minute 0 (hourly is the safe free-tier default; every-5-min would burn through 8,640 calls/month). (2) HTTP Request (pin to v4) — Method GET, URL as below, Authentication = Generic Credential Type → Header Auth, pick the credential you just created. Wire Schedule → HTTP Request.

    JSON · n8n · HTTP Request v4 node parameters
    // n8n: HTTP Request v4 node — paste-ready parameters
    // curl-equivalent: https://api.goldprice.dev/v1/spot/XAU-USD-SPOT
    {
      "method": "GET",
      "url": "https://api.goldprice.dev/v1/spot/={{ $json.symbol || 'XAU-USD-SPOT' }}",
      "authentication": "genericCredentialType",
      "genericAuthType": "httpHeaderAuth",
      "options": {
        "response": {
          "response": {
            "neverError": false,
            "responseFormat": "autodetect"
          }
        },
        "retry": {
          "enabled": true,
          "maxTries": 3,
          "waitBetweenTries": 2000
        },
        "timeout": 5000
      },
      "onError": "continueErrorOutput"
    }
  4. 4.Run it once and inspect the output

    Click Execute Workflow in the canvas. The HTTP Request node returns the live JSON (price, bid, ask, sources, gram-karat fields). Pass it downstream — typical patterns: write to Postgres via the Postgres node, post a Slack alert when price > threshold, or append a row to a Google Sheet for an audit log.

  5. 5.Switch currency or metal

    Symbols are METAL-CURRENCY-SPOT. The simplest pattern: a SplitInBatches node feeding the HTTP Request, with one item per symbol you want to track. Each iteration substitutes ={{ $json.symbol }} in the URL.

    JSON · n8n · multi-currency input items
    // SplitInBatches input — one item per currency
    [
      { "symbol": "XAU-USD-SPOT" },
      { "symbol": "XAU-INR-SPOT" },
      { "symbol": "XAU-EUR-SPOT" },
      { "symbol": "XAG-USD-SPOT" }
    ]
    
    // INR — Indian gold market (largest retail gold-search globally)
    // EUR — European pricing surfaces

Expected output

The API returns this shape:

JSON · GET /v1/spot/XAU-USD-SPOT
{
  "symbol": "XAU",
  "quote_currency": "USD",
  "unit": "troy_ounce",
  "contract_type": "spot",
  "price": "4726.01",
  "bid": "4726.68",
  "ask": "4725.33",
  "is_stale": false,
  "divergence_flag": false,
  "computed_at": "2026-04-27T04:49:01.706844+00:00",
  "sources": [
    {
      "source": "wgc.fsapi.usd",
      "display_name": "World Gold Council (live spot)",
      "price": "4726.01",
      "is_stale": false,
      "timestamp": "2026-04-27T04:47:24+00:00"
    }
    /* + cmc.paxg + cmc.xaut entries — full sources[] in live response */
  ],
  "value_stale": false,
  "price_gram_24k": "151.9447",
  "open_price": "4681.305",
  "high_price": "4729.56",
  "low_price": "4672.927",
  "prev_close_price": "4681.302",
  "ch": "44.6260",
  "chp": "0.9533",
  "open_time": 1777248000
}

The HTTP Request node output panel shows the full JSON. Downstream nodes reference any field via expressions like <code>{{ $json.price }}</code> or <code>{{ $json.sources[0].display_name }}</code>.

Common errors

CodeSymptomFix
401HTTP Request node fails with 401 UnauthorizedAPI key missing or invalid. Open Credentials → X-API-Key, paste a fresh key from your dashboard. Verify the credential is selected in the HTTP Request node's Authentication dropdown — Generic Credential Type → Header Auth.
429Sporadic 429 Too Many Requests on the error output branchSchedule cadence too aggressive for your tier. Hourly = 720 calls/month (inside free tier). Every-5-min = 8,640/month (well over). Reduce the Schedule Trigger interval or upgrade — see /pricing for Basic and Pro tiers. The node's built-in retry (3 tries, 2s wait) handles transient bursts.
N/AWorkflow JSON contains the API key in plaintext after exportYou pasted the key into the URL or a header field instead of using a credential. Delete it, create a Header Auth credential as in step 2, and reference it via Authentication dropdown. n8n redacts credentials on export; inline values get exported verbatim.

FAQ

How often does the price update?

The spot endpoint refreshes every 60 seconds (Pyth + WGC + CME aggregation). n8n has no native cache, so each Schedule trigger fires a fresh HTTP call. Match the trigger cadence to your downstream needs and the free-tier quota.

Will this fit the free tier with auto-refresh?

Yes at hourly cadence — 720 calls/month, inside the 1,000-call free tier. Every-15-min = 2,880/month (over). If you need higher cadence, use a Cache node (community) or a Postgres-backed staleness check, or upgrade — see /pricing for Basic and Pro tiers.

Can I use this commercially?

The Free tier is for personal use. For commercial automation (production workflows for clients, services you sell), upgrade to Basic or Pro — see /pricing.

Why pin to HTTP Request v4?

v3 had a different UI for credential attachment and was deprecated for new workflows. v4 added native error-output branches (the onError: continueErrorOutput setting). Pin to v4 explicitly so future n8n upgrades do not silently swap node versions.

What metals are supported?

Gold (XAU), silver (XAG), copper (HG), platinum (XPT), palladium (XPD). Substitute the metal code in the symbol, e.g. XAG-USD-SPOT.

Is the free tier really free?

Yes — 1,000 calls/month, no credit card, no expiration. Get the key at /onboarding.

Can I have Claude write this for me?

Yes. Open Claude Desktop with the goldprice.dev MCP server installed and ask: Build an n8n workflow that GETs goldprice.dev /v1/spot/XAU-USD-SPOT hourly via the HTTP Request v4 node. Use Header Auth credentials for the X-API-Key. Add an error output branch for 429. The MCP server gives Claude the live schema, so generated workflow JSON uses correct field names on first try.

Going further

  • Add a Postgres node after HTTP Request to insert {symbol, price, computed_at} rows for time-series analytics
  • Branch on price > threshold via an IF node and trigger a Slack/Discord alert when the alert fires
  • Loop over a SplitInBatches with multiple symbols to track gold + silver + copper in one workflow
  • Wire the error output to a Slack channel so 429s become visible alerts instead of silent failures
  • Use n8n's built-in Cache node (community) to cap API calls at 60s granularity even if Schedule runs more often

Next steps

Try the same setup in a different platform:

Browse all 6 tutorials →