Hi,
I’m struggling with the Airtable API, I’d like to download the content of one table, all 3k+ records and save them as a csv file using python (I can’t code JS).
My issue is that while trying to connect to Airtable Base and trying to get the first 100 records, I get blocked by a user authentication challenge page and get returned a 403 response saying.
Our systems have detected unusual traffic from your computer network.
Please help us with a quick security check to validate it’s you sending this request.
This may be happening because:
Javascript is disabled or blocked by an extension (ad blockers for example)
Your browser does not support cookies
Please check your settings to ensure Javascript and cookies are enabled that are not from loading in your browser.
It’s actually referring to this user authentication page: Airtable User Authentication Challenge Page | Airtable Support
Here’s my code:
import requests
import pandas as pd
# Environment Variables
AIRTABLE_BASE_ID = "appxxxx..."
AIRTABLE_TABLE_ID = "tblxxxx..."
AIRTABLE_TABLE_NAME = "Cashflow-Forecast"
AIRTABLE_VIEW_ID = "viwxxxx..."
AIRTABLE_API_KEY = "keyxxxx..."
endpoint = f"https://airtable.com/{AIRTABLE_BASE_ID}/{AIRTABLE_TABLE_ID}"
headers = {"Authorization": "Bearer " + AIRTABLE_API_KEY}
# params = {
#
# }
r = requests.get(endpoint, params=(), headers=headers)
print(r.status_code, r.text)
# df = pd.DataFrame(r)
Thank you for your pointers & help!