API endpoint that provides Schema for Base


#1

Hello

I’ve not been able to find documentation on whether it is possible to obtain the schema of an existing base, other than the one that is autogenerated in the form of online documentation.

I intend to use this Schema to auto generate language bindings for specific bases; while code changes may still be required in the case of statically type languages one has to deal with updating the data
structs that allow use to enforce type-safety and the specific code that use the endpoints.

It’d be ideal if the API for each base conformed to something like Swagger 2.0

Best, Tristian


#2

It’s not possible yet…


#3

Yes please to this!!! --> It’d be ideal if the API for each base conformed to something like Swagger 2.0


#4

Hey Tristan,
I know this is a really late reply…
But in any case you can construct the “schmea” dynamically with the help of the Airtable API and some native language like PHP, JAVA etc…
Zapier does it as it dynamically picks up all your fields and bases when you create a Zap for Airtable


#5

After logging in to the Airtable website I’ve been pasting the following into the browser console of the API documentation page. I then paste the result into a new json text file. I haven’t bothered with automating or finding a better way.

console.log(JSON.stringify(_.mapValues(application.tablesById, table => _.set(
  _.omit(table, ['sampleRows']),
  'columns',
  _.map(table.columns, item => _.set(item, 'foreignTable', _.get(item, 'foreignTable.id')))
))))

Python script to retrieve schema from an Airtable base
#6

@Andrew_Johnson1, how are you retrieving the Schema via the API? All the programmatic solutions I’ve seen in this forum appear to be doing something like scraping the API documentation page. If you have any code (in any language) I’d love to see it!

Thanks in advance.

-Mark