{"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":"python","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,"search_vec":"'0.19.0':49 'administr':44 'alert':40 'api':15,33,64,74 'api-cli':73 'bug':67 'client':4,10,75 'cloud':72 'current':46 'develop':55 'easi':23 'easy-to-us':22 'extract':39 'featur':65 'fix':68 'follow':53 'general':52 'interact':28 'interfac':26 'manag':41 'metric':38 'monitor':16,70 'new':63 'offici':8 'platform':2,14,59 'provid':20 'python':3,9 'releas':51 'rest':32 'sdcclient':5 'secur':18,71 'sysdig':1,13,30,58,69 'task':35 'updat':61 'use':25 'user/team':43 'version':47","created_at":"2026-04-16T17:03:10.376544+00:00","updated_at":"2026-04-16T17:03:10.376544+00:00","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', ...)"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.19.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://sysdig.com","github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/sdcclient/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["observability","devops","http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":null}}