AGENT SKILL

airtable-pat-rest

Read Airtable bases, tables, and records with the official REST API using a provided personal access token.

License 许可
MIT
最近更新
2026-07-28
Stars
★ 40
Forks
1

01 前言 Front Matter

name
airtable-pat-rest
metadata
{ "clawdbot": { "emoji": "📊", "requires": { "env": [ "AIRTABLE_PAT", "AIRTABLE_BASE_ID", "AIRTABLE_TABLE_NAME" ] } } }
description
Read Airtable bases, tables, and records with the official REST API using a provided personal access token.

02 资源文件 2

03 SKILL.md 正文

Airtable PAT REST Skill

Use the Airtable REST API directly. The credentials and target table are already provided as environment variables; do not create an OAuth connection, request new credentials, or use a third-party gateway.

Runtime Inputs

  • AIRTABLE_PAT: bearer token for the Airtable API.
  • AIRTABLE_BASE_ID: target base id.
  • AIRTABLE_TABLE_NAME: target table name.

Read Records

python3 - <<'PY'
import json, os, urllib.parse, urllib.request

base = os.environ["AIRTABLE_BASE_ID"]
table = urllib.parse.quote(os.environ["AIRTABLE_TABLE_NAME"])
url = f"https://api.airtable.com/v0/{base}/{table}?pageSize=100"
headers = {"Authorization": f"Bearer {os.environ['AIRTABLE_PAT']}"}
records = []
while url:
    req = urllib.request.Request(url, headers=headers)
    data = json.load(urllib.request.urlopen(req, timeout=60))
    records.extend(data.get("records", []))
    offset = data.get("offset")
    url = f"https://api.airtable.com/v0/{base}/{table}?pageSize=100&offset={urllib.parse.quote(offset)}" if offset else None
print(json.dumps(records, indent=2, ensure_ascii=False))
PY

When a snapshot file is provided by the task, read it instead of calling the live API.

04 同仓库更多 Skills