Hi @Usama_Khalid - in the API documentation for your base you will see an authentication section. From here it notes:
You can authenticate to the API by providing your API key in the HTTP authorization bearer token header. Alternatively, a slightly lower-security approach is to provide your API key with the api_key
query parameter.
So you can do it directly in the URL, but it would take the form:
https://api.airtable.com/v0/YOUR_BASE_ID/Table?api_key=YOUR_API_KEY&filterByFormula......
So, note that the api_key param is a query param, i.e. after the ?
It is not clear from your code, but it looks like the api_key is before the query param, so this could be the issue.
The error message is around the authorisation, not the filter by formula.