Airtable API
api.airtable.com · Company
Read and write Airtable bases — query records, create rows, update fields, and delete entries. Every base gets its own auto-generated REST API. Free tier available.
Authentication
Bearer Token
Personal access token at airtable.com/create/tokens. Pass as Authorization: Bearer YOUR_TOKEN.
Sample Requests
GET
List records
Get records from an Airtable table.
https://api.airtable.com/v0/{baseId}/{tableName}?maxRecords=5
Hover any highlighted part to learn what it does
Headers — extra info sent with the request
| Authorization | Bearer YOUR_TOKEN |
curl -X GET "https://api.airtable.com/v0/{baseId}/{tableName}?maxRecords=5" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"import requests
params = {
"maxRecords": "5"
}
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
response = requests.get(
"https://api.airtable.com/v0/{baseId}/{tableName}",
params=params,
headers=headers,
)
print(response.json())const url = new URL('https://api.airtable.com/v0/{baseId}/{tableName}');
url.searchParams.set('maxRecords', '5');
const response = await fetch(url, {
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
},
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.airtable.com/v0/{baseId}/{tableName}")
q := baseURL.Query()
q.Set("maxRecords", "5")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.airtable.com/v0/{baseId}/{tableName}")
uri.query = URI.encode_www_form({
"maxRecords" => "5"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer YOUR_ACCESS_TOKEN"
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.airtable.com/v0/{baseId}/{tableName}?" . http_build_query([
"maxRecords" => "5"
]);
$opts = ["http" => [
"method" => "GET",
"header" => implode("\r\n", [
"Authorization: Bearer YOUR_ACCESS_TOKEN"
]),
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
POST
Create a record
Create a new record in a table.
https://api.airtable.com/v0/{baseId}/{tableName}
Hover any highlighted part to learn what it does
Headers — extra info sent with the request
| Content-Type | application/json |
| Authorization | Bearer YOUR_TOKEN |
Request Body — data you're sending
{
"fields": {
"Name": "New Record",
"Status": "Active"
}
}
curl -X POST "https://api.airtable.com/v0/{baseId}/{tableName}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"fields":{"Name":"New Record","Status":"Active"}}'import requests
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
data = {
"fields": {
"Name": "New Record",
"Status": "Active"
}
}
response = requests.post(
"https://api.airtable.com/v0/{baseId}/{tableName}",
headers=headers,
json=data,
)
print(response.json())const url = 'https://api.airtable.com/v0/{baseId}/{tableName}';
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
},
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"fields": {
"Name": "New Record",
"Status": "Active"
}
}),
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"bytes"
"encoding/json"
)
func main() {
targetURL := "https://api.airtable.com/v0/{baseId}/{tableName}"
jsonData, _ := json.Marshal({"fields":{"Name":"New Record","Status":"Active"}})
req, _ := http.NewRequest("POST", targetURL, bytes.NewBuffer(jsonData))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.airtable.com/v0/{baseId}/{tableName}")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Post.new(uri)
req["Content-Type"] = "application/json"
req["Authorization"] = "Bearer YOUR_ACCESS_TOKEN"
req["Content-Type"] = "application/json"
req.body = "{\"fields\":{\"Name\":\"New Record\",\"Status\":\"Active\"}}"
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.airtable.com/v0/{baseId}/{tableName}";
$opts = ["http" => [
"method" => "POST",
"header" => implode("\r\n", [
"Content-Type: application/json",
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Content-Type: application/json"
]),
"content" => json_encode({"fields":{"Name":"New Record","Status":"Active"}}),
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- Create a personal access token at airtable.com/create/tokens
- Find your Base ID in the URL when viewing your base: airtable.com/{baseId}/{tableId}
- Set Authorization: Bearer YOUR_TOKEN
- GET /BASE_ID/TABLE_NAME?maxRecords=10 to list records
- Filter: ?filterByFormula=Status%3D%22Active%22