ZI API Auth Client

raw JSON →
2.0.3 verified Sat May 09 auth: no python

A Python library supporting username-password and PKI authentication methods for ZoomInfo enterprise APIs. Current version 2.0.3, released under an MIT-like license. Release cadence is irregular.

pip install zi-api-auth-client
error ImportError: No module named 'zi_api_auth_client'
cause Installed version <2.0.0 where package name was 'ziapi_auth_client'.
fix
Install latest version: pip install --upgrade zi-api-auth-client
error AttributeError: 'AuthClient' object has no attribute 'get_token'
cause Using deprecated method name. get_token() was removed in version 2.0.0.
fix
Use 'get_access_token()' instead.
breaking Version 2.0.0+ changed the package name from 'ziapi_auth_client' to 'zi_api_auth_client'. Existing imports will break.
fix Update imports to 'from zi_api_auth_client import AuthClient' and reinstall package.
deprecated The method 'get_token()' is deprecated in favor of 'get_access_token()' since version 1.5.0.
fix Replace 'client.get_token()' with 'client.get_access_token()'.
gotcha Environment variables are not automatically loaded. You must explicitly pass credentials or set them via os.environ.
fix Ensure you call load_dotenv() if using .env files, or pass credentials directly.

Initialize AuthClient with credentials and obtain an access token.

from zi_api_auth_client import AuthClient

client = AuthClient(
    username=os.environ.get('ZI_USERNAME', ''),
    password=os.environ.get('ZI_PASSWORD', ''),
)
token = client.get_access_token()
print(token)