Skip to main content
Contributor I
Dec 29, 2022 3:18 PM UTC
Solved

How to get all profiles with just one call API?

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.
    KeviSunshine
    Expert Problem Solver III
    Dec 29, 2022 3:29 PM UTC

    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
    Dec 29, 2022 3:29 PM UTC

    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
    Dec 29, 2022 4:26 PM UTC

    Hi @KeviSunshine!

    Thanks  for your help.