Skip to main content

Wazuh API Kit

The Wazuh API kit Project equips you with the necessary tools for a flexible and reliable interaction with the Wazuh API.

The library’s core component, the WazuhApiConnection class, enables you to seamlessly file requests against the Wazuh API. Redundant tasks, such as authentication and refreshing authorization tokens, as well as common pitfalls, namely expired authorization tokens and rate limitations, are being taken care of.

Build on top of the WazuhApiConnection, the WazuhApiClient class provides methods, which abstracts API endpoints and translates their responses to well documented python objects.

Key Features

  • Automated authentication and authorization token renewal
  • Customizable rate limitation
  • Translated responses that allow you to work on Python objects rather than plain JSON dictionaries
  • Comprehensive error logging and deprecation warnings

Documentation

For more information and examples take a look at our Documentation.

Installation

pip install wazuh-api-kit

Usage Examples

Request the GET / endpoint (Get API Info) via the WazuhApiConnection class.

from http import HTTPMethod

from wazuh_api_kit import WazuhApiConnection
from wazuh_api_kit.model import WazuhResponse

connection: WazuhApiConnection = WazuhApiConnection(
    wazuh_api_url="https://localhost:55000",
    wazuh_api_username="wazuh",
    wazuh_api_password="wazuh",
    wazuh_api_insecure=True,
)

api_info: WazuhResponse = connection.request(
    method=HTTPMethod.GET,
    path="/"
)

print(api_info.data["api_version"])

Request the GET / endpoint (Get API Info) via the WazuhApiClient class.

from wazuh_api_kit import WazuhApiConnection, WazuhApiClient
from wazuh_api_kit.model import WazuhApiInfo

connection: WazuhApiConnection = WazuhApiConnection(
    wazuh_api_url="https://localhost:55000",
    wazuh_api_username="wazuh",
    wazuh_api_password="wazuh",
    wazuh_api_insecure=True,
)

api_client: WazuhApiClient = WazuhApiClient(
    wazuh_api_connection=connection
)

api_info: WazuhApiInfo = api_client.api_info_get()

print(api_info.version)

Contribute

Please read the Contribution guidelines before making contributions or submitting an issue.

License

The project is licensed under the MIT License.

Third party notices

Metadata

Release files for wazuh-api-kit 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wazuh-api-kit 1.1.0
File Size Uploaded
wazuh_api_kit-1.1.0.tar.gz 52.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wazuh-api-kit 1.1.0
File Interpreter ABI Platform
wazuh_api_kit-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 161.4 kB

Release files / wazuh_api_kit-1.1.0.tar.gz

Download URL wazuh_api_kit-1.1.0.tar.gz
Size 52.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c6541c038068172ab0e55ded7c3687d86c419e7b958f1764cba1d1b331e98f4b
BLAKE2b-256 checksum
How to use checksums
eab78627f1c1ffbf1e5ebfc15a22f1a2882f94b32fce1fe1398073387e5a7429
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / wazuh_api_kit-1.1.0-py3-none-any.whl

Download URL wazuh_api_kit-1.1.0-py3-none-any.whl
Size 108.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23cfacde1e5f1c8c76ca3278caef2d5f86a054c448ddc86b19189aa6407de1b1
BLAKE2b-256 checksum
How to use checksums
abd92ea11e4c40b2663009fa9637645a195bbf882d711cdbdca85fb0a7c63f39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page