skillfed

klaviyo-api

Klaviyo Python SDK

klaviyo-api v24.0.0 284.5K downloads/30d#8,062 on PyPI48
Permissive license Active released

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 on this page — 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

klaviyo-api on PyPI

pip

pip install klaviyo-api

uv

uv add klaviyo-api

poetry

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 the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 5 — python_dateutil, setuptools, urllib3, pydantic, aenum
Maintenance actively maintained — 30 days since the last release
Last repo commit
First released
Downloads 284,536/month — #8,062 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: klaviyo_api-24.0.0-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

klaviyo api client pythonemail marketing automation sdkcustomer data platform apimarketing campaign management pythonklaviyo integration libraryprofile and segment managementevent tracking api client
marketing-automationapi-clientsaas-integration

More WWW/HTTP packages