Skip to main content
Question

API get for "Primary Fields" (instead of useless RECORD_ID() )


Forum|alt.badge.img+4

I was looking at the API reference... why is there no method to retrieve an element by a field that is defined as PK? That … is basic DB functionality. 

Currently the only way to use GET (HTTP) to retrieve a record, is with a value no one knows and that can only be calculated via the RECORD_ID() function (... after you already have the record!)

To me this .. is so weird haha :-)

Is it me? 
What I would expect is that Airtable allows via the API to query the table with AT LEAST the PK values. 

2 replies

Forum|alt.badge.img+1
  • Participating Frequently
  • 5 replies
  • April 2, 2025

You’re not alone in thinking that this is an odd design choice! Airtable’s API is structured more like a spreadsheet interface rather than a traditional relational database, which is why it doesn’t allow direct retrieval of records by a custom primary key (PK). Instead, it requires using the record_id, which is an internal unique identifier that Airtable assigns to each record.

 

Workarounds:

 

If you want to retrieve a record using a custom primary key field, you can use the filterByFormula parameter in the API. For example:
 

GET https://api.airtable.com/v0/{base_id}/{table_name}?filterByFormula={PrimaryKeyField}='your_value'


Airtable is designed more as a user-friendly, flexible no-code/low-code platform rather than a strict relational database. Their API reflects that philosophy by prioritizing simplicity over traditional DB querying methods.


Forum|alt.badge.img+4

Thx Sannit. While that worked… it’s very odd to me to require such (more complex!) workaround under the flag of “no code / less complex”. For users touching APIs (→ tech savvy ppl anyway), being able to use a PK field makes absolutely most sense.  (IMHO).
This would in no way hurt the no-coders.


Reply