klaviyo-api
Klaviyo Python SDK
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-apiuv
uv add klaviyo-apipoetry
poetry add klaviyo-apiInstalling 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
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
klaviyoA deprecated client library for integrating…
permissive · top 15,000 on PyPI
facebook-businessProvides Python bindings to Facebook's Business…
unclear · top 5,000 on PyPI
pinterest-api-sdkPython client library for the Pinterest API…
permissive · top 15,000 on PyPI
mailchimp3A Python client for MailChimp API v3 that wraps…
permissive · top 15,000 on PyPI
sib-api-v3-sdkPython SDK for the SendinBlue REST API,…
unclear · top 15,000 on PyPI
advertoolsadvertools provides data manipulation and…
permissive · top 15,000 on PyPI
Pinterest-Generated-ClientProvides auto-generated Python bindings for…
permissive · top 15,000 on PyPI
sailthru-clientA Python client library for the Sailthru REST…
permissive · top 15,000 on PyPI
linkedin-apiProvides direct HTTP access to LinkedIn's…
permissive · top 15,000 on PyPI
cybrid-api-organization-pythonA Python client library for the Cybrid…
permissive · top 15,000 on PyPI