Solved

API Limit of 1000 Profiles

  • 12 November 2021
  • 1 reply
  • 499 views

Badge +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,

icon

Best answer by Dov 12 November 2021, 20:32

View original

1 reply

Userlevel 7
Badge +61

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