{"id":19054209,"url":"https://github.com/datadog/datadog-api-client-python","last_synced_at":"2025-05-14T21:07:12.698Z","repository":{"id":36957031,"uuid":"193793657","full_name":"DataDog/datadog-api-client-python","owner":"DataDog","description":"Python client for the Datadog API","archived":false,"fork":false,"pushed_at":"2025-05-12T10:14:33.000Z","size":106686,"stargazers_count":145,"open_issues_count":56,"forks_count":47,"subscribers_count":522,"default_branch":"master","last_synced_at":"2025-05-12T10:48:00.463Z","etag":null,"topics":["datadog","datadog-api","openapi","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/datadog-api-client/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DataDog.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-06-25T22:52:04.000Z","updated_at":"2025-05-09T21:05:28.000Z","dependencies_parsed_at":"2024-01-22T09:00:27.908Z","dependency_job_id":"80a22031-598e-46d3-9b0d-db77ec515e67","html_url":"https://github.com/DataDog/datadog-api-client-python","commit_stats":{"total_commits":2056,"total_committers":76,"mean_commits":27.05263157894737,"dds":"0.22908560311284043","last_synced_commit":"5332aa3eb13c4b3b1183f4ea4a40c77368f18037"},"previous_names":[],"tags_count":60,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fdatadog-api-client-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fdatadog-api-client-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fdatadog-api-client-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fdatadog-api-client-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DataDog","download_url":"https://codeload.github.com/DataDog/datadog-api-client-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254227612,"owners_count":22035669,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["datadog","datadog-api","openapi","python"],"created_at":"2024-11-08T23:37:06.689Z","updated_at":"2025-05-14T21:07:07.677Z","avatar_url":"https://github.com/DataDog.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# datadog-api-client-python\n\nThis repository contains a Python API client for the [Datadog API](https://docs.datadoghq.com/api/).\n\n## Requirements\n\nBuilding and using the API client library requires [Python 3.7+](https://www.python.org/downloads/).\n\n## Installation\n\nTo install the API client library, simply execute:\n\n```shell\npip install datadog-api-client\n```\n\n## Getting Started\n\nPlease follow the [installation](#installation) instruction and execute the following Python code:\n\n```python\nfrom datadog_api_client import ApiClient, Configuration\nfrom datadog_api_client.v1.api.monitors_api import MonitorsApi\nfrom datadog_api_client.v1.model.monitor import Monitor\nfrom datadog_api_client.v1.model.monitor_type import MonitorType\n\nbody = Monitor(\n    name=\"example\",\n    type=MonitorType(\"log alert\"),\n    query='logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") \u003e 2',\n    message=\"some message Notify: @hipchat-channel\",\n    tags=[\"test:example\", \"env:ci\"],\n    priority=3,\n)\n\nconfiguration = Configuration()\nwith ApiClient(configuration) as api_client:\n    api_instance = MonitorsApi(api_client)\n    response = api_instance.create_monitor(body=body)\n    print(response)\n```\n\n### Authentication\n\nBy default the library will use the `DD_API_KEY` and `DD_APP_KEY` environment variables to authenticate against the Datadog API.\nTo provide your own set of credentials, you need to set some keys on the configuration:\n\n```python\nconfiguration.api_key[\"apiKeyAuth\"] = \"\u003cAPI KEY\u003e\"\nconfiguration.api_key[\"appKeyAuth\"] = \"\u003cAPPLICATION KEY\u003e\"\n```\n\n### Unstable Endpoints\n\nThis client includes access to Datadog API endpoints while they are in an unstable state and may undergo breaking changes. An extra configuration step is required to enable these endpoints:\n\n```python\nconfiguration.unstable_operations[\"\u003cOperationName\u003e\"] = True\n```\n\nwhere `\u003cOperationName\u003e` is the name of the method used to interact with that endpoint. For example: `list_log_indexes`, or `get_logs_index`\n\n### Changing Server\n\nWhen talking to a different server, like the `eu` instance, change the `server_variables` on your configuration object:\n\n```python\nconfiguration.server_variables[\"site\"] = \"datadoghq.eu\"\n```\n\n### Disable compressed payloads\n\nIf you want to disable GZIP compressed responses, set the `compress` flag\non your configuration object:\n\n```python\nconfiguration.compress = False\n```\n\n### Enable requests logging\n\nIf you want to enable requests logging, set the `debug` flag on your configuration object:\n\n```python\nconfiguration.debug = True\n```\n\n### Enable retry\n\nIf you want to enable retry when getting status code `429` rate-limited, set `enable_retry` to `True`\n\n```python\n    configuration.enable_retry = True\n```\n\nThe default max retry is `3`, you can change it with `max_retries`\n\n```python\n    configuration.max_retries = 5\n```\n\n### Configure proxy\n\nYou can configure the client to use proxy by setting the `proxy` key on configuration object:\n\n```python\nconfiguration.proxy = \"http://127.0.0.1:80\"\n```\n\n### Threads support\n\nYou can run API calls in a thread by using `ThreadedApiClient` in place of `ApiClient`. API calls will then\nreturn a `AsyncResult` instance on which you can call get to retrieve the result:\n\n```python\nfrom datadog_api_client import Configuration, ThreadedApiClient\nfrom datadog_api_client.v1.api.dashboards_api import DashboardsApi\n\nconfiguration = Configuration()\nwith ThreadedApiClient(configuration) as api_client:\n    api_instance = DashboardsApi(api_client)\n    result = api_instance.list_dashboards()\n    dashboards = result.get()\n    print(dashboards)\n```\n\n### Asyncio support\n\nThe library supports asynchronous operations when using `AsyncApiClient` for the transport. When that client is used,\nthe API methods will then return coroutines that you can wait for.\n\nTo make async support available, you need to install the extra `async` qualifiers during installation: `pip install datadog-api-client[async]`.\n\n```python\nimport asyncio\n\nfrom datadog_api_client import Configuration, AsyncApiClient\nfrom datadog_api_client.v1.api.dashboards_api import DashboardsApi\n\nasync def main():\n    configuration = Configuration()\n    async with AsyncApiClient(configuration) as api_client:\n        api_instance = DashboardsApi(api_client)\n        dashboards = await api_instance.list_dashboards()\n        print(dashboards)\n\nasyncio.run(main())\n```\n\n### Pagination\n\nSeveral listing operations have a pagination method to help consume all the items available.\nFor example, to retrieve all your incidents:\n\n```python\nfrom datadog_api_client import ApiClient, Configuration\nfrom datadog_api_client.v2.api.incidents_api import IncidentsApi\n\nconfiguration = Configuration()\nconfiguration.unstable_operations[\"list_incidents\"] = True\nwith ApiClient(configuration) as api_client:\n    api_instance = IncidentsApi(api_client)\n    for incident in api_instance.list_incidents_with_pagination():\n        print(incident.id)\n```\n\n## Documentation for API Endpoints and Models\n\nDocumentation for API endpoints and models is available in the [API Client docs](https://datadoghq.dev/datadog-api-client-python/).\n\n## Documentation for Authorization\n\nAuthenticate with the API by providing your API and Application keys in the configuration:\n\n```python\nconfiguration.api_key[\"apiKeyAuth\"] = \"YOUR_API_KEY\"\nconfiguration.api_key[\"appKeyAuth\"] = \"YOUR_APPLICATION_KEY\"\n```\n\n## Author\n\nsupport@datadoghq.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadog%2Fdatadog-api-client-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatadog%2Fdatadog-api-client-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadog%2Fdatadog-api-client-python/lists"}