{"id":8625,"library":"sdcclient","title":"Sysdig Platform Python Client","description":"sdcclient is the official Python client for the Sysdig Platform APIs (Monitor and Secure). It provides an easy-to-use interface to interact with Sysdig's REST APIs for tasks such as metric extraction, alert management, and user/team administration. The current version is 0.19.0, and releases generally follow the development of the Sysdig platform, with updates for new API features and bug fixes.","status":"active","version":"0.19.0","language":"en","source_language":"en","source_url":"https://github.com/sysdiglabs/sysdig-sdk-python","tags":["sysdig","monitoring","security","cloud","api-client"],"install":[{"cmd":"pip install sdcclient","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"symbol":"SdMonitorClient","correct":"from sdcclient import SdMonitorClient"},{"symbol":"SdSecureClient","correct":"from sdcclient import SdSecureClient"},{"note":"SdcClient is an alias for SdMonitorClient for backward compatibility. For new code, it is recommended to use SdMonitorClient or SdSecureClient explicitly.","symbol":"SdcClient","correct":"from sdcclient import SdcClient"}],"quickstart":{"code":"import os\nfrom sdcclient import SdMonitorClient\n\n# It's recommended to store your API token in an environment variable for security.\n# export SYSDIG_API_TOKEN='YOUR_SYSDIG_API_TOKEN'\n# export SDC_URL='https://app.sysdig.com'\n\napi_token = os.environ.get('SYSDIG_API_TOKEN', '')\nsdc_url = os.environ.get('SDC_URL', 'https://app.sysdig.com') # Default SaaS URL\n\nif not api_token:\n    print(\"Error: SYSDIG_API_TOKEN environment variable not set.\")\n    exit(1)\n\n# Instantiate the Sysdig Monitor client\nclient = SdMonitorClient(api_token, sdc_url=sdc_url)\n\n# Example: Get current user information\nok, res = client.get_user_info()\n\nif ok:\n    print(\"Successfully connected to Sysdig Monitor.\")\n    print(f\"User Info: {res}\")\nelse:\n    print(f\"Failed to get user info: {res}\")","lang":"python","description":"This quickstart demonstrates how to instantiate a Sysdig Monitor client using an API token, preferably from an environment variable, and then fetch basic user information. It also shows how to handle the common `[success_boolean, result_or_error]` return pattern."},"warnings":[{"fix":"Use `from sdcclient import SdMonitorClient` or `from sdcclient import SdSecureClient` and instantiate the respective class.","message":"The `SdcClient` class is an alias for `SdMonitorClient` for backward compatibility. While it still works, new code should explicitly use `SdMonitorClient` for Sysdig Monitor interactions and `SdSecureClient` for Sysdig Secure interactions to improve clarity and future-proof your code.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always include `if ok: ... else: ...` logic after every API call.","message":"Sysdig API methods return a tuple: `[boolean_success_status, result_data_or_error_string]`. Always check the boolean status before attempting to process the second element, as it will contain an error message on failure.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Set `SDC_URL` and `SDC_SSL_VERIFY='false'` environment variables, or pass `sdc_url='https://your-api-server'` and `ssl_verify=False` to the client constructor.","message":"For on-premises Sysdig installations, you must specify the API server URL and potentially disable SSL verification. This can be done via environment variables (`SDC_URL`, `SDC_SSL_VERIFY`) or directly in the client constructor.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Export your Sysdig API token: `export SYSDIG_API_TOKEN='YOUR_TOKEN_HERE'` or pass it directly: `client = SdMonitorClient('YOUR_TOKEN_HERE')`.","cause":"The Sysdig API token was not provided to the client constructor and the `SYSDIG_API_TOKEN` environment variable is missing.","error":"Error: SYSDIG_API_TOKEN environment variable not set."},{"fix":"Verify your Sysdig API token. Obtain a new one from the Sysdig Monitor/Secure settings page if necessary.","cause":"The provided Sysdig API token is invalid or expired, resulting in an unauthorized access error.","error":"Failed to get user info: status code 401"},{"fix":"Set `SDC_SSL_VERIFY='false'` as an environment variable or pass `ssl_verify=False` to the client constructor. Ensure you understand the security implications of disabling SSL verification.","cause":"This usually occurs in on-premises installations with self-signed SSL certificates when `ssl_verify` is set to `True` (the default).","error":"requests.exceptions.SSLError: ('CERTIFICATE_VERIFY_FAILED', ...)"}]}