Hello Community!
How do I use the filter functions in the Klaviyo Python SDK? I want to filter the 'created' field by date. Let's say I want to pull all profiles that have a 'created' date after 2023-01-01. Here is the code I use without the filter. What would the filter need to look like so that I can integrate it into this query? The documentation is not very helpful in this respect.from klaviyo_api import KlaviyoAPI
import pandas as pd
klaviyo = KlaviyoAPI("API Key", max_delay=60, max_retries=3, test_host=None)
fields_profile = ['email', 'created', 'external_id', 'subscriptions', 'properties', 'subscriptions.email']
page_size = 100
profiles = klaviyo.Profiles.get_profiles(
fields_profile=fields_profile,
page_size=page_size
)
Also how can I pull all profiles via the Klaviyo Python SDK?
Unfortunately, I can only extract the first 100 profiles via the page_size. However, I would like to obtain all profiles via the API. I have already tried many variants, but have not yet found a solution. I already have the following code. How would I have to extend it?
from klaviyo_api import KlaviyoAPI
import pandas as pd
klaviyo = KlaviyoAPI("API Key", max_delay=60, max_retries=3, test_host=None)
fields_profile = ['email', 'created', 'external_id', 'subscriptions', 'properties', 'subscriptions.email']
page_size = 100
profiles = klaviyo.Profiles.get_profiles(
fields_profile=fields_profile,
page_size=page_size
)
Is there also a way to obtain profiles with the metric 'subscribed to list' via the Klaviyo Python SDK? I've tried different ways but haven't found out yet if there is a way to extract the metric 'subscribed to list' via the profiles. Through which field would this be possible? Does anyone here have any experience? I would be happy to hear from you!
Best,
Emanuel