Skip to main content

How do I get list of all the tables in a base


Hello everyone,

I’m building an app that picks data from Airtable. All the listed APIs expect the table name as an input.

I’m looking for an API to get a list of all the tables in a base. Is there any API, or any workaround for this?

Thanks

12 replies

kuovonne
Forum|alt.badge.img+17
  • Brainy
  • 5996 replies
  • May 27, 2020

The Standard REST API does not have a method for getting all of the tables in a base.

If you want to use code to get a list of tables, you can use the Scripting block to get the list of tables and have Scripting block store that info in a regular table. Then you only need to code the single table name in the code that accesses the Standard REST API. You would need to remember to click the run button for the script whenever the table names change.

Eventually, the Standard REST API might have access to metadata, but for now we have to resort to workarounds.


If this answers your question, please mark this post as the solution. Otherwise, could you please give a bit more details?


This is now possible!

Read about it here: https://airtable.com/api/meta

Simply make a GET request with the auth header, and see the tables listed:

https://api.airtable.com/v0/meta/bases/$BaseId/tables


  • New Participant
  • 3 replies
  • June 11, 2021
Charley_Bodkin wrote:

This is now possible!

Read about it here: https://airtable.com/api/meta

Simply make a GET request with the auth header, and see the tables listed:

https://api.airtable.com/v0/meta/bases/$BaseId/tables


this is not working. im getting error…"{“error”:{“type”:“NOT_FOUND”}}"

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://api.airtable.com/v0/meta/bases/appxKxxxxxxxxxmDs/tables');

$headers[] = 'Authorization: Bearer keyPxxxxxxxxxDjIK';

$headers[] = 'Content-Type: application/json';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');

$result = curl_exec($ch);

curl_close($ch);

kuovonne
Forum|alt.badge.img+17
  • Brainy
  • 5996 replies
  • June 11, 2021
MuhammadAli wrote:

this is not working. im getting error…"{“error”:{“type”:“NOT_FOUND”}}"

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://api.airtable.com/v0/meta/bases/appxKxxxxxxxxxmDs/tables');

$headers[] = 'Authorization: Bearer keyPxxxxxxxxxDjIK';

$headers[] = 'Content-Type: application/json';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');

$result = curl_exec($ch);

curl_close($ch);

Have you been approved for the meta api beta?


Charley_Bodkin wrote:

This is now possible!

Read about it here: https://airtable.com/api/meta

Simply make a GET request with the auth header, and see the tables listed:

https://api.airtable.com/v0/meta/bases/$BaseId/tables


This is not working . I have “{“error”:{“type”:“NOT_FOUND”}}” in responce instead list of tables.


  • New Participant
  • 1 reply
  • October 8, 2021

As I understand it, you have to request a specific token to use the Metadata API.

Here is the link : Airtable Metadata API Waitlist

I hope they respond quickly…


  • New Participant
  • 4 replies
  • August 24, 2022

Very sad you cannot just use the meta API… :frowning:


Hannah_Wiginton
Forum|alt.badge.img+4
Mattia_Rasulo wrote:

Very sad you cannot just use the meta API… :frowning:


If you need access to your Airtable metadata, check out On2Air Schemas


  • New Participant
  • 4 replies
  • August 24, 2022
Hannah_Wiginton wrote:

If you need access to your Airtable metadata, check out On2Air Schemas


Wow that looks expensive just to fetch the tables in my base lol


Hannah_Wiginton
Forum|alt.badge.img+4
Mattia_Rasulo wrote:

Wow that looks expensive just to fetch the tables in my base lol


yeah maybe if that’s all it did. :star_struck: It also displays formulas, shows field dependencies, shows history changes, shows field options, and creates metadata snapshots.


  • New Participant
  • 4 replies
  • August 24, 2022
Hannah_Wiginton wrote:

yeah maybe if that’s all it did. :star_struck: It also displays formulas, shows field dependencies, shows history changes, shows field options, and creates metadata snapshots.


Yeah it looks amazing but I don’t need all of that unfortunately! :frowning:


Hannah_Wiginton
Forum|alt.badge.img+4
Mattia_Rasulo wrote:

Yeah it looks amazing but I don’t need all of that unfortunately! :frowning:


Totally understand! :raised_hands:


Reply