Integrating GoldAPI.io with IFTTT
IFTTT is useful when you want simple automation around live precious metals prices, such as alerts, notifications, or lightweight data routing.
The practical approach is to call GoldAPI.io from a small backend or serverless endpoint, then connect that endpoint to IFTTT Webhooks. This keeps your GoldAPI.io key private.
What you need
- An IFTTT account.
- A GoldAPI.io API key.
- An IFTTT applet that uses Webhooks.
- A backend endpoint or serverless function that calls GoldAPI.io.
Step 1: Create a backend price endpoint
Create an endpoint on your backend, for example:
https://example.com/api/gold-priceThat endpoint should call GoldAPI.io server-side:
app.get('/api/gold-price', async (req, res) => {
const response = await fetch('https://www.goldapi.io/api/price/XAU/USD?melt_price=false¤cy_info=false', {
headers: {
'x-access-token': process.env.GOLDAPI_API_KEY,
'Content-Type': 'application/json'
}
});
if (!response.ok) {
res.status(response.status).json({ error: 'Price unavailable' });
return;
}
const data = await response.json();
res.json({
value1: data.price,
value2: data.bid,
value3: data.ask
});
});IFTTT Webhooks commonly use value1, value2, and value3, so this shape is convenient for later applet actions.
Step 2: Create an IFTTT Webhooks trigger
In IFTTT, create an applet and choose:
Webhooks -> Receive a web requestUse an event name such as:
gold_price_updateStep 3: Send data to IFTTT
From your backend or scheduled job, call the IFTTT Webhooks endpoint:
const iftttKey = process.env.IFTTT_WEBHOOK_KEY;
const priceResponse = await fetch('https://example.com/api/gold-price');
const priceData = await priceResponse.json();
await fetch(`https://maker.ifttt.com/trigger/gold_price_update/with/key/${iftttKey}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(priceData)
});Step 4: Configure the IFTTT action
After the Webhooks trigger, choose an action such as:
- send an email
- send a mobile notification
- add a row to Google Sheets
- post to Slack or Discord through another connected service
In the action message, use:
Gold price: {{Value1}}
Bid: {{Value2}}
Ask: {{Value3}}Example workflow
- A scheduled job runs every hour.
- Your backend calls GoldAPI.io for
XAU/USD. - Your backend sends
value1,value2, andvalue3to IFTTT Webhooks. - IFTTT sends a notification, email, or spreadsheet update.
Price threshold alerts
If you only want alerts above or below a target price, add the condition before calling IFTTT:
if (priceData.value1 > 2400) {
await fetch(`https://maker.ifttt.com/trigger/gold_price_update/with/key/${iftttKey}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(priceData)
});
}Security note
Do not put your GoldAPI.io key in an IFTTT public webhook URL, browser script, or shared applet documentation. Keep it on your backend and rotate the key if it is exposed.
Conclusion
IFTTT works well for simple GoldAPI.io automations. A small backend endpoint and one Webhooks applet are enough to turn real-time gold and silver prices into alerts, messages, or spreadsheet updates.
