Help

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

8838 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Kranthi_Kiran
4 - Data Explorer
4 - Data Explorer

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 12

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?

Charley_Bodkin
4 - Data Explorer
4 - Data Explorer

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);

Have you been approved for the meta api beta?

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

Beber
4 - Data Explorer
4 - Data Explorer

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…

Mattia_Rasulo
5 - Automation Enthusiast
5 - Automation Enthusiast

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

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

Schema_Main_Overview_gif

______________________________________
Hannah - On2Air.com - Automated Backups for Airtable

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