Help

What are the specific steps in using the Airtable API?

Topic Labels: API
11600 8
cancel
Showing results for 
Search instead for 
Did you mean: 
Christoff
7 - App Architect
7 - App Architect

The API documentation implies that all that’s needed is the official node.js client

I have downloaded the files and the page says to “install airtable.js in a node project: npm install airtable”. Where is “a node project” and where do I type “npm install airtable”? Do I need other software?

Also, I have looked at the API code. For example, here’s the node.js code for retrieving a record:

var Airtable = require(‘airtable’);
var base = new Airtable({apiKey: ‘YOUR_API_KEY’}).base(‘app1234567’);

base(‘SampleTables’).find(‘rec1234567890NRXLGMAK’, function(err, record) {
if (err) { console.error(err); return; }
console.log(record);
});

  1. How do I get the record number?
  2. Where do I store the code so that I can reuse it with different records?
  3. How specifically do I submit the code request to the Airtable website?

Thanks.

8 Replies 8
Jonathan_Godney
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi Christoff
This is the same thing I have found. I am saddened that there has not been a response to your question from Airtable support!
If anyone can help that would be great.
Thanks
Jonathan

Christoff
7 - App Architect
7 - App Architect

@Jonathan_Godney1
Yeah, no response from Airtable support and no response from anyone else, even after 332 views.
Anyway, thanks for bumping this up.

Stephan_Strittm
6 - Interface Innovator
6 - Interface Innovator

Maybe it is a to common question. It is difficult to start to answer.

I will try to answer some parts:

if you are logged in your account at airtable, you could open the API documentation by the (?) in the upper right of the window.
The documentation will be adjusted to your currently selected base. There are all methods described basically.

About storing the code:
This is up to you: locally or on your webserver - it depends on your requirements. This is just a seperate project of yourselve. It is not stored on airtable.com.

To get an idea, you could have a look at our project (it uses Java, not JavaScript!) to get an idea how to create such project: R750Explorer: Gaming App based on Airtable

I hope I was able to answer some of your questions.

Martin_Kopischk
7 - App Architect
7 - App Architect

To expand on what Stephan said:

  1. querying the API can be done in any environment that supports getting data through HTTP calls, and processing the returned data can be done with any JSON library or tool; node.js / JavaScript is the examplary case, as it is, historically and by design, an excellent fit for this kind of tasks, but it is not the only way. Which is exactly why the API docs offer the syntax for command line curl calls besides it. Other environments work too – I, for instance, am querying the API via the PowerQuery module in MS Excel (with a custom rate limiting API call function written in its M Query Language).

  2. setting up a software project that makes use of these capabilities is entirely up to you – none of it is part of Airtable’s functionality. For starters, I would suggest trying out the curl examples provided in the API documentation to get a feeling for how this works (you will need to use your platform’s command line / terminal and, depending on the platform, may need to install curl first). Later, set up a project in whatever programming language you feel comfortable with or find someone to do it for you, if you are not comfortable wirth programming yourself.

Jonathan_Godney
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi Paul and Martin
I discovered after a more investigation that I could run an HTTP GET, so I wrapped it up in a python code snippet that I used in Zapier.

Here is what I did: (Maybe it is useful for others)
url = "https://api.airtable.com/v0/appI99pTdQ65gXGFr/tblNzlhxuKCo39dTgd0"
querystring = {“fields[]”:[“short_property”,“unit”,“ref”,“short_name_unique_id”]}
headers = {‘authorization’: “Bearer [you need to add your own key here]” }
response = requests.request(“GET”, url, headers=headers, params=querystring)
return {‘Test’: 1234, ‘JsonString’: response.text}

Also, a great tool to test your HTTP GET is https://www.getpostman.com/
Regards
Jonathan

Okay, I’ll try again:

I have a computer running Windows 10.
I’ve gone to the web page at https://github.com/airtable/airtable.js
The page says:

To install airtable.js in a node project:
npm install airtable

Where do I enter the command? What additional software do I need?

I’ve clicked on the green “Clone or Download” button and I downloaded and unzipped the files, which are now in a folder called airtable.js-master.
What is the next step?

Kim_Prisk
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi
This may be of help: https://www.npmjs.com/package/airtable/tutorial
Kim
ps I downloaded the windows binaries, installed and there was a command window to run from.

Katherine_Duh
Airtable Alumni (Retired)

For anyone reading—we’ve answered the OP’s question in a private support ticket. Just a reminder that this community forum is primarily designed for users to have conversations with each other—not for users to contact the staff. We cannot guarantee that every question in the community forums will get answered by an Airtable staff member. If you would like to speak to Airtable staff directly, please open a support ticket.

For posterity, the general answer to the question is that the environment you set up depends entirely on what you’re trying to do with the API. Given this broad scope, we generally consider this requisite setup to be beyond the level of support our team can provide.

That said, if you tell us (by opening a support ticket!) what you’re trying to do, we may be able to point you in the right direction, or help you out directly if there’s a non-API solution.