Genesys Cloud Analytics API 429s killing my Python S3 export job

Trying to write a daily analytics dump to S3 using Python and boto3. The flow is straightforward: fetch interaction data, paginate, then push to bucket. But the Genesys API is hammering me with 429s after about 15 calls. I’ve got time.sleep(1) in the loop, but it’s not enough. Is there a specific rate limit header I should be parsing to back off dynamically? Here’s the loop structure:

while url:
 resp = requests.get(url, headers=headers)
 if resp.status_code == 429:
 time.sleep(5)
 continue
 upload_to_s3(resp.json())

It’s just timing out.

3 Likes