Skip to main content
Contributor I
December 29, 2022
Solved

How to get all profiles with just one call API?

  • December 29, 2022
  • 2 replies
  • 704 views

I just learned about Klaviyo API and know that currently Klaviyo only returns up to 20 profiles per call.

Is it possible to get all profiles in one call? (don’t using lists or segments).

Thanks for help.

    This topic has been closed for replies.
    Best answer by KeviSunshine

    Hi @tungnk,

    I’ve never used the Get Profiles endpoint, but looking at the documentation, it’s clear that it can’t return all profiles in a single API call. You’ll need to use the pagination parameter to fetch more profiles after the first 20. They document how pagination works here: https://developers.klaviyo.com/en/reference/api_overview#pagination.

    So my advice would be to run your calls in a loop–fetch 20 profiles, then each subsequent call asks for 20 more profiles until there are no pages left.

    Not as convenient, but it’s pretty standard to limit the number of response records so nothing out of the ordinary.

     

    Cheers,

    Kevin.

    2 replies

    KeviSunshine
    Expert Problem Solver III
    Expert Problem Solver III
    December 29, 2022

    Hi @tungnk,

    I’ve never used the Get Profiles endpoint, but looking at the documentation, it’s clear that it can’t return all profiles in a single API call. You’ll need to use the pagination parameter to fetch more profiles after the first 20. They document how pagination works here: https://developers.klaviyo.com/en/reference/api_overview#pagination.

    So my advice would be to run your calls in a loop–fetch 20 profiles, then each subsequent call asks for 20 more profiles until there are no pages left.

    Not as convenient, but it’s pretty standard to limit the number of response records so nothing out of the ordinary.

     

    Cheers,

    Kevin.

    tungnkAuthor
    Contributor I
    December 29, 2022

    Hi @KeviSunshine!

    Thanks  for your help.