No "offset" value returned in JSON for >100 records


#1

I’m trying to retrieve all the records in a table with curl over HTTPS.

I checked the table I’m targeting, and it has 283 records. I imagine I’ll need to issue three requests, since each request returns a maximum of 100 records.

I piped the results of my first curl command into a new file called output.txt and then tried to find the offset value from within the curl output file.

However, when I search through this file, I can’t find an offset value anywhere within the JSON like I expected, based on this line in the documentation:

If there are more records, the response will contain an offset.

Is there something obvious that I’m missing… I feel like there has to be. If anyone knows how I can get this offset value so that I can use it to request the next page of records (and the one after that), I’d be super grateful. :slight_smile:


#2

Can you paste the curl URL you’re using here, with your API key, base ID, table name, etc changed to random values? You can also email support@airtable.com.


#3

Sure! Thanks for your help, Kasra!

Here’s the full command I’m using, with random values for the API key, app name, field names, etc. Turns out I’m piping to items.json, which makes more sense than output.txt. :slight_smile:

curl "https://api.airtable.com/v0/appmwKq8r6WDyWnKS1/Items?maxRecords=100&sort%5B0%5D%5Bfield%5D=sequence_number&sort%5B0%5D%5Bdirection%5D=asc&fields=fk_order_number&fields=remarks" -H "Authorization: Bearer keymwKq8r6WDyWnKS1" > items.json


#4

maxRecords=100 will limit the total number of records returned to 100, across all pages. If you want to get all records, omit maxRecords.


#5

If you want to get all records, omit maxRecords.

Ah ha! That worked perfectly. Thanks for your help–I was pretty sure that it was something obvious!

All the best :smile:


#6

Hi!
How do you set no limit.
Trying to set maxRecords to 500 and it still return max 100.


#7

100 is the upper limit.