Skip to main content
Solved

API Limit of 1000 Profiles

  • November 12, 2021
  • 1 reply
  • 552 views

Forum|alt.badge.img+2

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,

Best answer by Dov

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.  

 

View original
Did this topic or the replies in the thread help you find an answer to your question?

1 reply

Dov
Forum|alt.badge.img+61
  • Klaviyo Alum
  • 1493 replies
  • Answer
  • November 12, 2021

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.