datadog-api-client

The official Python client for the Datadog API, with typed models for every endpoint.

SDK
PyPI
v2.59.0
166stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
90/100Excellent
Development Activity100
Maintenance96
Community84
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
81/100Excellent
Architecture82
Code Quality84
Innovation78
Learning Curve72

datadog-api-client is Datadog’s official Python SDK for its REST API. It gives you a fully typed, auto-generated client covering both the v1 and v2 API surfaces — monitors, dashboards, logs, metrics, events, incidents, SLOs, and much more — so you can automate and manage your Datadog account programmatically instead of clicking through the UI.

Because it is generated from Datadog’s OpenAPI specification, the client stays in lockstep with the API: every resource has a corresponding typed model and every endpoint a typed method, complete with request/response validation. It supports synchronous and asynchronous usage, request retries, and pagination helpers, making it the reliable foundation for infrastructure-as-code, custom tooling, and CI automation around Datadog.

What You Get

  • Typed API classes and model objects for the full Datadog v1 and v2 API surface
  • Auto-generated code kept in sync with Datadog’s OpenAPI specification
  • Synchronous and asynchronous (asyncio) client variants
  • Built-in request/response validation, retries, and pagination helpers
  • Complete type hints (py.typed) for editor and type-checker support

Common Use Cases

  • Managing monitors, dashboards, and SLOs as code
  • Querying metrics, logs, and events from scripts or services
  • Automating Datadog configuration in CI/CD pipelines
  • Building custom internal tooling on top of Datadog data

Under The Hood

Architecture — The package under src/datadog_api_client centers on a shared runtime — api_client.py (transport, serialization, auth), configuration.py (keys, servers, retries), rest.py (HTTP layer), model_utils.py (typed-model machinery), and exceptions.py — with per-version trees (v1/, v2/) each holding an api/ package of endpoint classes and a model/ package of typed request/response objects. The bulk of the code is generated from Datadog’s OpenAPI spec via generate.sh, so the runtime is hand-maintained while the surface is regenerated.

Tech Stack — Pure Python (3.8+), packaged with setuptools (setup.py/setup.cfg), linted with Ruff, and using urllib3-style transport with optional async support. Auth (including AWS and delegated auth) lives in dedicated modules.

Code Quality — A professionally maintained, high-health project: extensive tests/ (BDD-style, run via run-tests.sh/pytest), example checks (check-examples.sh), thorough docs, py.typed, and clear CONTRIBUTING/DEVELOPMENT/TESTING guides. Generation keeps the large model layer consistent.

API Design — Consistent and predictable because it is generated: every resource follows the same XxxApi + typed-model pattern. That uniformity is easy to learn per-endpoint, though the sheer size of the surface and verbose typed models mean more boilerplate than a hand-tuned client.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search