I’m working on building an automated workflow in Airtable for one of my database tables. The automation needs to calculate some financial totals, and for this calculation I need to fetch the current exchange rate for EUR currency from an external API service.
I’ve been trying to figure out how to make HTTP requests from within the Airtable automation script, but I’m not sure what’s the proper way to do this. Can someone guide me on how to perform REST API calls inside Airtable automation? What functions or methods should I use to send HTTP requests and handle the response data?
quick heads up - airtable automation times out if u make too many api calls at once. I’ve used currencylayer api for eur rates and it’s solid. just store your api key in script settings instead of hardcoding it directly.
Indeed, fetch() is the method you will need for making HTTP requests in Airtable’s automation workflows. A basic implementation could look like this:
let response = await fetch('https://api.exchangerate-api.com/v4/latest/EUR');
let data = await response.json();
let eurRate = data.rates.USD; // Adjust based on your target currency
A crucial tip is to check response.ok before you proceed with parsing the JSON. This will help you avoid unexpected errors when the API might return error statuses. Storing the fetched rate in your Airtable record right after a successful API call is also advisable, as it ensures you have a clear audit trail of the rates used in your calculations.
I ran into this same issue building a financial tracker a few months back. You’ll need fetch() for the API calls in Airtable automation. Wrap it in a try-catch block to handle network problems. Most exchange rate APIs return JSON, so use .json() after checking the response worked. Watch out for rate limits on free APIs - if your automation runs frequently, cache the rates in a separate table. Also plan for API downtime by logging errors or adding fallback options to your script.