Help

Re: Basic GET Request to 3rd Party API

Solved
Jump to Solution
3479 0
cancel
Showing results for 
Search instead for 
Did you mean: 
aaron_bell
5 - Automation Enthusiast
5 - Automation Enthusiast

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!

1 Solution

Accepted Solutions
JonathanBowen
13 - Mars
13 - Mars

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

Screenshot 2020-11-27 at 15.51.41

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.

See Solution in Thread

7 Replies 7
JonathanBowen
13 - Mars
13 - Mars

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

Screenshot 2020-11-27 at 15.51.41

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.

francisco_silv1
4 - Data Explorer
4 - Data Explorer

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

Airtable Blocks SDK

Screen Shot 2020-11-29 at 10.50.23

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.

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π

Hi,
I can not upload a record in Airtable using W5100S-EVB-Pico. Its support ethernet connectivity and uses micropython-urequests library to ‘get’ and ‘post’ data

Welcome to the Airtable community!

What code are you using to access the Airtable REST api? Are you able to read data from Airtable? Are you able to read/write data from Airtable using a traditional computer?