I’m trying to fetch all records from my Airtable base using their API, but I’m getting fewer results than expected.
const database = airtable.base(config.baseId);
let allRecords = [];
database("Products")
.select({})
.eachPage(
function handlePage(recordBatch, getNextPage) {
allRecords.push(...recordBatch);
getNextPage();
},
function complete(error) {
if (error) {
console.error(error);
return;
}
console.log("Total fetched:", allRecords.length);
}
);
The API returns 2202 records, but when I check the table directly in Airtable’s web interface, I can see 2271 records. The CSV export also shows 2271 records, confirming the UI count is correct.
I’ve removed any view filters to make sure it’s not a display issue. I compared both datasets and found the missing records, but they don’t seem to have any special properties that would explain why the API skips them.
Has anyone encountered this discrepancy between API results and the actual table content? What could be causing this difference?
This usually happens when your records have formula fields throwing errors or circular references. The API automatically skips these problematic records, but the web interface still shows them. You might also have corrupted data or invalid field types that the API can’t serialize properly. Add some error handling to your handlePage function to catch records causing issues during processing. Try fetching smaller batches with the maxRecords parameter to pinpoint where the gap happens. I’ve found that checking for formula errors or linked fields pointing to deleted entries usually reveals what’s missing.
I faced something similar too! Some of my records were actually marked as deleted in Airtable even tho they showed up in the UI. It might help to tweak your select options - like adding {cellFormat: 'string', userLocale: 'en-us'}. Also, check for any empty required fields; that could be it.
Those 69 missing records? It’s almost definitely a permissions issue. I’ve hit this exact problem before when records have restricted visibility.
Here’s what’s happening - Airtable’s web interface shows you records that your API key can’t actually access:
- Records shared from another base with limited permissions
- Your API key is from a collaborator account, not the owner
- Field-level permissions blocking API access
Grab a different API key from the base owner if you can. If not, dig into the sharing settings and hunt for records with weird permission levels.
Also double-check you’re hitting the same view in both places. Even without filters, the API might be pulling from a different view than what you’re looking at.
I had a client lose 50+ records because they used a collaborator key instead of the workspace owner’s. Swapped keys and boom - problem solved.
This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.