May 27, 2020 03:22 AM
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
May 27, 2020 09:18 AM
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?
Jan 18, 2021 02:06 PM
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
Jun 11, 2021 12:26 AM
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);
Jun 11, 2021 01:51 AM
Have you been approved for the meta api beta?
Sep 15, 2021 07:24 AM
This is not working . I have “{“error”:{“type”:“NOT_FOUND”}}” in responce instead list of tables.
Oct 08, 2021 01:10 AM
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…
Aug 24, 2022 09:59 AM
Very sad you cannot just use the meta API… :frowning:
Aug 24, 2022 10:15 AM
If you need access to your Airtable metadata, check out On2Air Schemas
Aug 24, 2022 11:39 AM
Wow that looks expensive just to fetch the tables in my base lol