Show more than 100 records with API calls using JavaScript (ajax)

I create a basic javascript web app with some ajax javascript call using the api.
I try to get all the records from a table but the response show me only 100 records.
Can someone give me an example for solving this problem?
I use maxRecords and the offset functions but i’m not understand how i have to use that.
Thank you.

Welcome to the Airtable community.

You can only retrieve a maximum of 100 records per call with the REST API.
In order to get more records, you must use additional api calls with pagination. If you want to get all the records, you should not set maxRecords, because that limits the total number of records you will get (even with pagination).

Are you using the official js client, or forming your requests manually? What does your code currently look like? How are you submitting the offset in your requests?

From the api documentation:

Actually i create this code using the ajax calls into a javascript file. I give you this example:

function test(){
    var event = $('#getEventID').val();
    $.ajax({
        url: "https://api.airtable.com/v0/"+baseid+"/"+tablename+"?filterByFormula=idevento="+event+"&api_key="+apikey,
        success: function(response){
            var total = response['records'][0]['fields']['totale'];
            nextFunction(idevento, total);
        }
    });
}

Can you help me and show how do you see all the records from the tables with this type of code?!
Thank you

Your current call includes two query parameters: filterByFormula and api_key.

If you get an offset from the first call, you need to make another call that also includes the offset from the previous call.

By the way, I find that fetch is much easier to use than ajax.

Can you make an example with my source code for using the offset parameter? which date i have to pass into the second call. How i can use the fetch method? Thank you.

If you would like to hire me to write code for you, feel free to book a meeting.

You do not pass a date. You pass the offset received from the previous call.

Google JavaScript fetch to see examples.

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