How to add multiple filters through API URL?

I was wondering if it’s possible to add multiple filters in the Airtable API URL - I have figured out the way for one filter, but I am struggling to apply multiple filters. Here’s the URL I made, which has a single filter applied :

api.airtable.com/v0/<BASE_ID>/<TABLE_NAME>?api_key=<API_KEY>&filterByFormula={City}="MUMBAI"

The above URL works perfectly, but if I try to add another filter (using &), it shows errors.

I am looking for a way to add these 3 filters :

  • {City} = “MUMBAI” (field type = single line text)
  • {Age} > 25 (field type = number)
  • {Calculation} = “Ok” (field type = formula, result would be either “Ok” or “NA”)

What is the recommended/correct way to add multiple filters? Your guidance would be very appreciated. Thanks!

Hi Kartik,

yes, that’s possible.

You can have only one filterByFormula parameter.
But you can treat filterByFormula just like a regular Airtable formula field.

You could try it like this:

&filterByFormula=AND({City}="MUMBAI",{Age}>25,{Calculation}="Ok")

Quick tip: if you are unsure about whether your formula will work, just create a new Airtable formula field and test it there. I often find this a quicker way to spot errors in a formula than debugging it with API calls.

This is also a good tool to automatically create properly encoded urls with the correct parameters.

4 Likes

This topic was solved and automatically closed 3 days after the last reply. New replies are no longer allowed.