CrowdStrike FalconPy is the official Python SDK for interacting with CrowdStrike Falcon APIs. It provides a standardized way to access various CrowdStrike services, enabling automation and integration. The library is currently at version 1.6.1 and receives frequent updates, typically focusing on new API operations, bug fixes, and minor enhancements.
pip install crowdstrike-falconpyVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the FalconPy APIHarness client using environment variables for authentication and retrieve the CrowdStrike Customer ID (CID). It highlights the recommended practice of externalizing credentials and includes basic error handling for API responses.
Upgrade your Python environment to version 3.8 or newer before upgrading to FalconPy v1.6.0+.
Always refer to the official CrowdStrike API documentation for the latest operation names and best practices. Monitor release notes for deprecated operations and update your code accordingly.
Explicitly pass the `base_url` argument to your `APIHarness` or service class initializer, e.g., `APIHarness(..., base_url='https://api.eu-1.crowdstrike.com')`.
After any API call, inspect `response['status_code']` and `response.get('body', {}).get('errors')` to ensure both HTTP and application-level success.Consult the `falconpy` release notes and the CrowdStrike API documentation when upgrading to ensure you are using the correct service class and operation names for your version.
Ensure the library is installed in the active Python environment using pip: `python3 -m pip install crowdstrike-falconpy` or `pip install crowdstrike-falconpy`. If using a virtual environment (e.g., venv, pipenv, poetry), activate it before installing and running the script.
Verify the exact class name and its casing in the `falconpy` documentation for the specific API service you are trying to access. For example, `SensorUpdatePolicies` might need to be `SensorUpdatePolicy` or imported from `from falconpy import SensorUpdatePolicy`. For versions v0.7.1 and later, both singular and plural aliases might be supported, but checking the documentation for the specific version is best.
Review the required API scopes for the specific CrowdStrike API endpoint you are calling within the CrowdStrike API documentation. Then, update your API client in the CrowdStrike Falcon console to include all necessary read/write/admin permissions. Ensure the correct `client_id` and `client_secret` are being passed to your FalconPy class instance.
Double-check your `client_id` and `client_secret` for typos. Ensure the API keys are active in your CrowdStrike Falcon console. FalconPy handles token renewal automatically, so if this error occurs, it's usually an initial credential issue or a fundamental misconfiguration rather than an expired token during a long-running session.
No dependency data recorded yet.