List endpoints return items, next_cursor and total. Request a page with limit, up to 100. Treat cursors as opaque strings.
curl --get "$CHARTEROPS_API_URL/v1/aircraft" \
--header "Authorization: Bearer $CHARTEROPS_API_KEY" \
--data-urlencode "limit=25" \
--data-urlencode "cursor=$NEXT_CURSOR"
Set NEXT_CURSOR to the previous response’s next_cursor value. Omit the cursor on the first request. Keep the same filters and sorting while walking a result set.
Stop when next_cursor is null. Do not derive cursors from record IDs, increment them or interpret them as page numbers. Records can change while you read successive pages, so use record IDs when reconciling results.
Read every page
This Bash loop uses jq to read the response. It stops on a failed request rather than treating an error as the end of the list.
cursor=''
while :; do
args=(--get "$CHARTEROPS_API_URL/v1/aircraft"
--header "Authorization: Bearer $CHARTEROPS_API_KEY"
--data-urlencode 'limit=100')
if [ -n "$cursor" ]; then args+=(--data-urlencode "cursor=$cursor"); fi
page=$(curl --fail-with-body --silent --show-error "${args[@]}") || exit 1
printf '%s\n' "$page" | jq '.items[]'
cursor=$(printf '%s\n' "$page" | jq -r '.next_cursor // empty')
[ -n "$cursor" ] || break
done