Skip to main content

Hi,

Im having an issue pulling the whole segment profiles to Python using the API.

url = "https://a.klaviyo.com/api/v2/group/SEGMENT_ID/members/all"

querystring = {"api_key":"PRIVATE_KEY"}

headers = {"Accept": "application/json"}

response = requests.request("GET", url, headers=headers, params=querystring)

r = requests.get(url, params=querystring)

rtext = response.text

r.json()['records']

jsonrecords = r.json()['records']

df = json_normalize(jsonrecords)

This manages to pull the profiles but it only brings 1,000 instead of the 5000 I have in that particular segment.

Is there any API limitation? How can I increase the limits to bring all of the 5000 in one request?

Thanks,

Hi @YallaBaby,

Thanks for sharing this question with the Klaviyo community.

When you export these segments via the API, you are correct, we can only pull them in batches of 1000. There isn't a way to increase this number, however in the response when you make the API call you should also receive a marker.  Using that marker and running the API call again, you should be able to pull the next batch of 1000 profiles along with another marker.  You'll need to continue looping these requests until you've pulled all of the segment members.  

 


Reply