
On the next page, you will see the ID of your Airtable Base. Select the base you want to work with from the list. Make sure you are logged into your Airtable account and go to the API docs. env to avoid accidentally exposing this information! Make sure you keep this token private and do not share it with anyone! If you're committing files to a GitHub repo (or any other source control system), make sure you exclude the. Scroll down to the API section of your account page, and you will see your token.Ĭopy the token value and paste it into your. You can find your API token by going to your account page. Submitting a request to the Airtable REST API requires three pieces of information:Īirtable uses a bearer token to authenticate each API request, which should be saved in a. There is also a Jupyer notebook, AirtablePractice.ipynb in the repo you can use to follow along.įirst, let's look at the authentication for submitting a request. In the repo you will find a file airtable.py with example functions you'll build here.
AIRTABLE API SORT CODE
You will need to create a table in Airtable with the following four columns and data types:Īll the code referenced here is available in a GitHub repo.

AIRTABLE API SORT HOW TO
You'll learn how to add, retrieve, update, and delete records in Airtable through the Airtable REST API and also talk about some of the common gotchas and limitations.įor this tutorial, we will be using scores from a round of golf as a toy dataset. The API documentation only contains curl and Javascript examples, so this tutorial will look at how you can interact with Airtable using Python complete with examples. Airtable has a REST API that can be used to perform common operations on your Airtable. We'll cover the general steps for this below.Airtable is a cloud-based relational database that simplifies data storage without having to write SQL.

You can now test the request in a tool like Postman. Now, let’s say we only want to return flavors with 5-star ratings using the filterByFormula parameter: Including a list records scope in an API request to this table without any parameters will return all the flavors. To help demonstrate this, let’s say you have a table of ice cream flavors: This formula will need to be included in the table of the base where the API call is being requested. When filtering an API response using the filterByFormula parameter, a valid formula must be used which will evaluate each record. An alternative way to filter records in a call containing a list records scope is to use the filterByFormula parameter which we will outline in more detail below.One way to filter records is to pass a view parameter in an API request containing the list records scope, yielding only the records as they appear in a specific table view.There are two different ways to filter records in API requests: Token-based access - In order to make API requests, you'll need to authenticate using one of the methods outlined here. Learn how to filter or sort the results of an API response.
