--- id: klaviyo-api version: "24.0.0" license: unclear license_treatment: permissive maintenance: active --- # klaviyo-api — Klaviyo Python SDK License: permissive · Maintenance: active · Downloads: 284.5K/mo ## What it is and what it does This is the official Python SDK for Klaviyo's marketing API, providing a thin wrapper around Klaviyo's REST endpoints. It mirrors the API's resource organization (Accounts, Campaigns, Catalogs, Events, Flows, Profiles, Segments, Tags, Templates, and others) and handles common concerns like automatic retries on rate limits and server errors, pagination via cursor-based navigation, and filtering/sorting via JSON API conventions. The SDK is designed for developers integrating Klaviyo into Python applications—sending events, managing customer profiles, querying metrics, creating campaigns, and accessing related resources. It supports advanced features like datetime filtering, sparse fieldsets, relationship endpoints, and image uploads. Error handling is explicit via ApiException, which exposes status, reason, body, and headers for debugging. Use it for: - Track customer events (purchases, page views, form submissions) to Klaviyo for segmentation and campaign targeting. - Query and update customer profiles in bulk, including predictive analytics fields and list memberships. - Retrieve campaign performance metrics and reporting data for analytics dashboards. - Build segments based on filtered profile data and datetime ranges, then manage associated tags and campaigns. - Upload images and manage marketing assets programmatically within Klaviyo. - Automate flow and template management, including creating and publishing campaigns at scale. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Python client library for the Klaviyo marketing API, providing access to campaigns, profiles, events, segments, and other marketing automation resources. Yes. The SDK is actively maintained, has no known vulnerabilities, and low install friction. It is the canonical way to integrate Klaviyo's API into Python applications. Use it if you are building Klaviyo integrations, automating marketing workflows, or syncing customer data. The permissive MIT license poses no compliance risk. ## Install pip install klaviyo-api uv add klaviyo-api poetry add klaviyo-api ## Installing klaviyo-api Before you install: Low friction installation with stable maintenance. Released 30 days ago with active repository status and no known vulnerabilities. Depends on common, well-maintained packages: python_dateutil, urllib3, pydantic, and aenum. License in practice: Licensed under MIT (permissive), allowing free use, modification, and distribution with minimal restrictions—suitable for commercial and open-source projects alike. Quickstart: pip install klaviyo-api from klaviyo_api import KlaviyoAPI klaviyo = KlaviyoAPI("YOUR_API_KEY_HERE", max_delay=60, max_retries=3) klaviyo.Metrics.get_metrics() Requires a valid Klaviyo API key; SDK retries on rate limits and server errors with configurable max_delay and max_retries. Verify before relying: - Whether the SDK's automatic revision header injection matches all current Klaviyo API versions - Performance characteristics under high-volume event tracking or large profile queries - Completeness of typed response support across all resource endpoints ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 284.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags klaviyo api client python, email marketing automation sdk, customer data platform api, marketing campaign management python, klaviyo integration library, profile and segment management, event tracking api client, marketing-automation, api-client, saas-integration [View on SkillFed](https://skillfed.io/packages/klaviyo-api) · [View on PyPI](https://pypi.org/project/klaviyo-api/)