Basic GET Request to 3rd Party API

Hi all,

I would like to retrieve data from an API and update fields to a table. I have had trouble finding a basic example of this. I have been able to update one of my tables from a python module which really simplifies things but if I could remove the python from the process and simply do it in a script that would be great.

If anyone had any links to share that would be awesome!

Hi @aaron_bell - when you install the scripting app, there are a few examples you can use to start:

The currency converter script uses fetch to get data from a 3rd party API, so this should work as a starter for what you are doing. This is a pretty simple example, so here’s some more info on fetch if you need to do something a little more complicated, e.g. Headers for authorisation.

1 Like

Hi,
to populate your Airtable with data from any API, using a custom block.

https://airtable.com/developers/apps/guides/building-a-new-app

Welcome to the Airtable community!

You posted your topic under the “Scripting” app category, which is why Jonathan suggested looking at the examples in the Scripting documentation.

However, you mention using a Python module, which implies that you are using the REST API from outside of the Airtable interface, as the REST API is the only Airtable API that can be used with Python.

Are you trying to move code that is outside the Airtable interface to a script run from a button inside the Airtable interface? If so, which parts are you having trouble with, getting the data from the 3rd party API, or making the updates to Airtable after you have received the data?

One difficulty with dealing with third party APIs in Scripting app is that you cannot use libraries without some rather involved workarounds. So, even if your third party api has a JavaScript module/library you cannot use it in Scripting app. Instead you need to build your get request from scratch using fetch as Jonathan mentioned, including finding the exact endpoint you need to use as well as dealing with authentication and parameters.

You would be able to use a node module in a custom app, but developing a custom app is much more work than writing a script.

1 Like

In addition to the excellent suggestions you’ve received above:

If you want a super-easy, no-code, no-hassle way of connecting 3rd-party apps to Airtable using their APIs, check out Integromat or Zapier.

Integromat is the vastly superior platform, because it offers 100% full Airtable support, it has more functionality than Zapier, and it’s a fraction of the cost of Zapier. Many people can even get away with the free tier forever.

In Integromat, they also give you the ability to make your own custom GET Requests, POST Requests, PATCH Requests, etc. that will communicate with 3rd Party API’s:

I’ve got most of my Airtable consulting clients setup with Integromat, and they love it.

I am a professional Airtable consultant and a Registered Integromat Partner, and the Integromat link contains my personal referral code. I am also available for hire through my website at scottworld.com.

Hi @JonathanBowen,

I didn’t yet got your link about FETCH.

Very interesting when I compare to FETCH’s articles I previously bookmarked !

Thank you,

olπ

1 Like