How can I retrieve more than 100 records from Airtable using Axios?

I am building an application that requires fetching every single record from an Airtable base, but my current setup returns only 100 entries. I am using Axios to call the Airtable API with the necessary authentication, yet I still face a limitation in the number of records retrieved. I would appreciate any insights on modifying my implementation, possibly through pagination or other methods, to get the complete dataset.

function fetchAllData() {
  const baseIdentifier = 'YOUR_BASE_ID';
  const secretToken = 'YOUR_API_KEY';
  axios.get(`https://api.airtable.com/v0/${baseIdentifier}/RecordsList?view=Default`, {
    headers: { Authorization: `Bearer ${secretToken}` }
  })
  .then(response => {
    console.log(response.data.records);
    // Additional processing can be done here
  })
  .catch(err => console.error('Fetch error:', err));
}

hey try using the offset token returned by airtable. after each request, use that token in the next axios call until no offset is present. this way u iterate all records correctly.

In a recent project, I faced the same challenge with Airtable’s 100-record limit. I solved it by making recursive Axios calls that pass the offset token provided by Airtable. After retrieving each set of records, I check if an offset exists and then append the data to a global array or process it as needed. This approach not only allowed me to handle more than 100 records but also ensured the code remained modular and easy to trace. A thorough read of the Airtable API documentation also helped refine the implementation for better error handling in concurrent calls.

In my experience, handling Airtable’s 100-record limit requires integrating an iterative fetching mechanism into your code. I solved this by implementing an asynchronous function that sends repeated Axios requests. With every response, I checked for a returned offset token and, if present, followed it with another call while aggregating the data. This method not only fetched all records seamlessly but also provided flexibility in processing data while handling potential errors or rate limits. The key was to structure the code in a way that respects both Airtable’s pagination model and its API usage guidelines.

hey, you can use async/await with a loop that checks for the offset token till it’s missing. i used a while loop to repeatedly call axios. it worked fine for me, just be careful of any rate limit errors and add a slight delay if needed.

In my experience, overcoming the 100-record limitation in Airtable using Axios is best achieved by a robust asynchronous approach that incorporates both pagination and error management. I solved this by creating a helper function that recursively calls Axios, passing the offset token from each response to retrieve subsequent sets of records. Initially, I faced issues with potential rate limits, which I mitigated by implementing a small delay between calls using setTimeout. This method not only retrieves the complete dataset without duplicating records but also allows tracking API call status clearly, making debugging easier when unexpected errors occur.