Help

Re: How do I use REST API to retrieve data from linked tables in one API call?

7884 1
cancel
Showing results for 
Search instead for 
Did you mean: 
GabyTango
4 - Data Explorer
4 - Data Explorer

Hi, I am trying to use REST API to retrieve data from a base that includes both the records from a primary table and the linked records from a related table in a single request.  Is there a way to obtain this data in just one API call?

Know that in SQL, a single query can fetch data from multiple tables in one request, but Airtable has me stumped. 

Any guidance is much appreciated. Thanks in advance. 

4 Replies 4

This is not possible with the current Airtable REST API. A single query can only retrieve data from a single table.

If you have access to the base schema, you may be able to bring info from other tables into the current table using lookup and rollup fields.

Although Airtable is a relational database, it is not an SQL database and you cannot perform SQL queries.

Thanks very much, Kuovonne. Will try to modify the base schema as you suggest. 

 

GavinA
8 - Airtable Astronomer
8 - Airtable Astronomer

Hey @GabyTango - we are working on this feature for our app CSV Getter . I demo the feature in this video. What do you think? Would it help you?

https://www.youtube.com/watch?v=o0xIbXe8k_M

With CSV Getter, you can create CSV exports from Airtable using dynamic export URLs. In this video, I'll demonstrate how to use inline SQL to customize your exports and perform actions like summing unit costs. I'd love to hear your thoughts on this new feature and how it can benefit your ...
djseeds
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi GabyTango (and anyone else who might be tackling this now),

I know this post is from back in February, but for anyone else running into the same problem, I thought I’d add some extra info.

As kuovonne explained, the Airtable REST API limits you to retrieving data from one table at a time, so you’d need to make multiple requests and manually combine the data from linked records.

For anyone still looking for a more efficient solution, a GraphQL API like BaseQL might be useful. It allows you to query across multiple tables in a single request—similar to SQL joins—making it much easier to work with linked records.

Here’s a guide I wrote on handling cross-table joins with Airtable that could be helpful: Cross-Table Joins with Airtable API.

Hopefully this helps anyone else facing this issue!

DJ, Lead Developer at BaseQL