Integrating GoldAPI.io with Airtable
Airtable is useful when you want to store live precious metals prices in a spreadsheet-like database, build lightweight dashboards, or trigger automations from changing market data.
The simplest approach is to use Airtable Automations with a script that calls GoldAPI.io and writes the returned price into a table.
What you need
- An Airtable base.
- A GoldAPI.io API key.
- A table for storing metal prices.
- An Airtable automation with a scripting action.
Step 1: Create a prices table
Create a table named:
Metal PricesAdd fields such as:
MetalCurrencyPriceAskBidTimestamp
Step 2: Add an automation
In Airtable, create an automation with a trigger such as:
At scheduled timeThen add a script action.
Step 3: Call GoldAPI.io from the script
Use a script like this:
const apiKey = 'YOUR_API_KEY';
const table = base.getTable('Metal Prices');
const response = await fetch('https://www.goldapi.io/api/price/XAU/USD?melt_price=false¤cy_info=false', {
method: 'GET',
headers: {
'x-access-token': apiKey,
'Content-Type': 'application/json'
}
});
if (!response.ok) {
throw new Error(`GoldAPI.io request failed: ${response.status}`);
}
const data = await response.json();
await table.createRecordAsync({
'Metal': 'XAU',
'Currency': 'USD',
'Price': data.price,
'Ask': data.ask,
'Bid': data.bid,
'Timestamp': new Date(data.timestamp * 1000).toISOString()
});Step 4: Use the stored data
After Airtable stores the record, you can:
- build filtered views for gold, silver, platinum, or palladium
- chart recent prices with Airtable Interfaces
- trigger notifications when new records match a condition
- sync the table into reporting or operations workflows
Example workflow
- Airtable scheduled automation runs every hour.
- Script calls GoldAPI.io for
XAU/USD. - Script inserts a new row in
Metal Prices. - Airtable Interface or another automation uses the latest value.
Updating the latest row instead of inserting
If you only want one current-price record, query the table first and update an existing record instead of creating a new one.
const records = await table.selectRecordsAsync();
const existing = records.records.find((record) => (
record.getCellValue('Metal') === 'XAU' &&
record.getCellValue('Currency') === 'USD'
));
if (existing) {
await table.updateRecordAsync(existing.id, {
'Price': data.price,
'Ask': data.ask,
'Bid': data.bid,
'Timestamp': new Date(data.timestamp * 1000).toISOString()
});
}Security note
Avoid sharing Airtable scripts or bases that contain your GoldAPI.io key. If multiple people manage the base, limit editor access and rotate the key if it is exposed.
Conclusion
Airtable works well as a lightweight destination for GoldAPI.io price data. A scheduled automation and one script action are enough to keep a base updated with live metals prices.
