Fetching Specific Column Data via Airtable API

How can I use the Airtable API to retrieve solely the ‘Name’ field and verify if a designated name exists?

let apiBase = 'https://api.airtable.com/v0/';
let tokenKey = 'Bearer ABCDEFGHIJ';
let recordBase = 'ABCDEFGHIJ';
let tablePath = '/MyRecords';
let endpointURL = apiBase + recordBase + tablePath;

console.log(endpointURL);

let apiRequest = new Request(endpointURL);
apiRequest.method = 'GET';
apiRequest.headers = {
  'Authorization': tokenKey,
  'Accept': 'application/json',
  'fields': 'Name'
};

let resultData = await apiRequest.loadString();
console.log(resultData);

Based on my experience, the Airtable API is more consistent when query parameters are used for field restrictions. Instead of setting the fields in the headers, I found it more reliable to include them in the URL, for example by adding ?fields=Name. Combining this with a filterByFormula parameter to check for a designated name (e.g. &filterByFormula=({Name}=‘designated_name’)) simplifies the process. This approach avoids complications from header settings and streamlines the verification process when retrieving records.