Batch query API endpoint, feed cURL from loop with range and step, gzip decompress
#!/bin/bash
for offset in `seq 0 50 5000`; do
curl -H 'accept-encoding: br, gzip, deflate' "${API_ENDPOINT}/?offset=${offset}&limit=50" | gunzip - > "outputs/${offset}.json"
done