# pyhuntress - An API library for Huntress SIEM and Huntress Managed SAT, written in Python
pyHuntress is a full-featured, type annotated API client written in Python for the Huntress APIs.
This library has been developed with the intention of making the Huntress APIs simple and accessible to non-coders while allowing experienced coders to utilize all features the API has to offer without the boilerplate.
pyHuntress currently supports both Huntress SIEM and Huntress Managed SAT products.
Features:
=========
- **100% API Coverage.** All endpoints and response models.
- **Non-coder friendly.** 100% annotated for full IDE auto-completion. Clients handle requests and authentication - just plug the right details in and go!
- **Fully annotated.** This library has a strong focus on type safety and type hinting. Models are declared and parsed using [Pydantic](https://github.com/pydantic/pydantic)
pyHuntress is currently in **development**.
Known Issues:
=============
- As this project is still a WIP, documentation or code commentary may not always align.
- Huntress Managed SAT post not built
Road Map:
=============
- Add support for post
- Add required parameters when calling completion_certificat endpoint
How-to:
=============
- [Install](#install)
- [Initializing the API Clients](#initializing-the-api-clients)
- [Huntress Managed SAT](#huntress-managed-sat)
- [Huntress SIEM](#huntress-siem)
- [Working with Endpoints](#working-with-endpoints)
- [Get many](#get-many)
- [Get one](#get-one)
- [Get with params](#get-with-params)
- [Pagination](#pagination)
- [Contributing](#contributing)
- [Supporting the project](#supporting-the-project)
# Install
Open a terminal and run ```pip install pyhuntress```
# Initializing the API Clients
### Huntress Managed SAT
```python
from pyhuntress import HuntressSATAPIClient
# init client
sat_api_client = HuntressSATAPIClient(
mycurricula.com,
# your api public key,
# your api private key,
)
```
### Huntress SIEM
```python
from pyhuntress import HuntressSIEMAPIClient
# init client
siem_api_client = HuntressSIEMAPIClient(
# huntress siem url
# your api public key,
# your api private key,
)
```
# Working with Endpoints
Endpoints are 1:1 to what's available for both the Huntress Managed SAT and Huntress SIEM.
For more information, check out the following resources:
- [Huntress Managed SAT REST API Docs](https://curricula.stoplight.io/docs/curricula-api/00fkcnpgk5vnn-getting-started)
- [Huntress SIEM REST API Docs](https://api.huntress.io/docs)
### Get many
```python
### Managed SAT ###
# sends GET request to /company/companies endpoint
companies = manage_api_client.company.companies.get()
### SIEM ###
# sends GET request to /agents endpoint
agents = siem_api_client.agents.get()
```
### Get one
```python
### Managed SAT ###
# sends GET request to /company/companies/{id} endpoint
accounts = sat_api_client.accounts.id("abc123").get()
### SIEM ###
# sends GET request to /agents/{id} endpoint
agent = siem_api_client.agents.id(250).get()
```
### Get with params
```python
### Managed SAT ###
# sends GET request to /company/companies with a conditions query string
conditional_company = sat_api_client.company.companies.get(params={
'conditions': 'company/id=250'
})
### SIEM ###
# sends GET request to /agents endpoint with a condition query string
conditional_agent = siem_api_client.clients.get(params={
'platform': 'windows'
})
```
# Pagination
The Huntress SIEM API paginates data for performance reasons through the ```page``` and ```limit``` query parameters. ```limit``` is limited to a maximum of 500.
To make working with paginated data easy, Endpoints that implement a GET response with an array also supply a ```paginated()``` method. Under the hood this wraps a GET request, but does a lot of neat stuff to make working with pages easier.
Working with pagination
```python
# initialize a PaginatedResponse instance for /agents, starting on page 1 with a pageSize of 100
paginated_agents = siem_api_client.agents.paginated(1,100)
# access the data from the current page using the .data field
page_one_data = paginated_agents.data
# if there's a next page, retrieve the next page worth of data
paginated_agents.get_next_page()
# if there's a previous page, retrieve the previous page worth of data
paginated_agents.get_previous_page()
# iterate over all companies on the current page
for agent in paginated_agents:
# ... do things ...
# iterate over all companies in all pages
# this works by yielding every item on the page, then fetching the next page and continuing until there's no data left
for agent in paginated_agents.all():
# ... do things ...
```
# Contributing
Contributions to the project are welcome. If you find any issues or have suggestions for improvement, please feel free to open an issue or submit a pull request.
# Supporting the project
:heart:
# Inspiration and Stolen Code
The premise behind this came from the [pyConnectWise](https://github.com/HealthITAU/pyconnectwise) package and I stole **most** of the code and adapted it to the Huntress API endpoints.
Raw data
{
"_id": null,
"home_page": null,
"name": "pyhuntress",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "API, Annotated, Client, Huntress, MSP, Manages SAT, Python, SIEM, Typed",
"author": null,
"author_email": "Peter Annabel <peter.annabel@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/a1/13/ad1f6c56695e243d16233b7a38360f6166f67f15326b53c2a74576e18537/pyhuntress-0.2.13.tar.gz",
"platform": null,
"description": "# pyhuntress - An API library for Huntress SIEM and Huntress Managed SAT, written in Python\n\npyHuntress is a full-featured, type annotated API client written in Python for the Huntress APIs.\n\nThis library has been developed with the intention of making the Huntress APIs simple and accessible to non-coders while allowing experienced coders to utilize all features the API has to offer without the boilerplate.\n\npyHuntress currently supports both Huntress SIEM and Huntress Managed SAT products.\n\nFeatures:\n=========\n- **100% API Coverage.** All endpoints and response models.\n- **Non-coder friendly.** 100% annotated for full IDE auto-completion. Clients handle requests and authentication - just plug the right details in and go!\n- **Fully annotated.** This library has a strong focus on type safety and type hinting. Models are declared and parsed using [Pydantic](https://github.com/pydantic/pydantic)\n\npyHuntress is currently in **development**.\n\nKnown Issues:\n=============\n- As this project is still a WIP, documentation or code commentary may not always align.\n- Huntress Managed SAT post not built\n\nRoad Map:\n=============\n- Add support for post\n- Add required parameters when calling completion_certificat endpoint\n\nHow-to:\n=============\n- [Install](#install)\n- [Initializing the API Clients](#initializing-the-api-clients)\n - [Huntress Managed SAT](#huntress-managed-sat)\n - [Huntress SIEM](#huntress-siem)\n- [Working with Endpoints](#working-with-endpoints)\n - [Get many](#get-many)\n - [Get one](#get-one)\n - [Get with params](#get-with-params)\n- [Pagination](#pagination)\n- [Contributing](#contributing)\n- [Supporting the project](#supporting-the-project)\n\n# Install\nOpen a terminal and run ```pip install pyhuntress```\n\n# Initializing the API Clients\n\n### Huntress Managed SAT\n```python\nfrom pyhuntress import HuntressSATAPIClient\n\n# init client\nsat_api_client = HuntressSATAPIClient(\n mycurricula.com,\n # your api public key,\n # your api private key,\n)\n```\n\n### Huntress SIEM\n```python\nfrom pyhuntress import HuntressSIEMAPIClient\n\n# init client\nsiem_api_client = HuntressSIEMAPIClient(\n # huntress siem url\n # your api public key,\n # your api private key,\n)\n```\n\n\n# Working with Endpoints\nEndpoints are 1:1 to what's available for both the Huntress Managed SAT and Huntress SIEM.\n\nFor more information, check out the following resources:\n- [Huntress Managed SAT REST API Docs](https://curricula.stoplight.io/docs/curricula-api/00fkcnpgk5vnn-getting-started)\n- [Huntress SIEM REST API Docs](https://api.huntress.io/docs)\n\n### Get many\n```python\n### Managed SAT ###\n\n# sends GET request to /company/companies endpoint\ncompanies = manage_api_client.company.companies.get()\n\n### SIEM ###\n\n# sends GET request to /agents endpoint\nagents = siem_api_client.agents.get()\n```\n\n### Get one\n```python\n### Managed SAT ###\n\n# sends GET request to /company/companies/{id} endpoint\naccounts = sat_api_client.accounts.id(\"abc123\").get()\n\n### SIEM ###\n\n# sends GET request to /agents/{id} endpoint\nagent = siem_api_client.agents.id(250).get()\n```\n\n### Get with params\n```python\n### Managed SAT ###\n\n# sends GET request to /company/companies with a conditions query string\nconditional_company = sat_api_client.company.companies.get(params={\n 'conditions': 'company/id=250'\n})\n\n### SIEM ###\n# sends GET request to /agents endpoint with a condition query string\nconditional_agent = siem_api_client.clients.get(params={\n 'platform': 'windows'\n})\n```\n\n# Pagination\nThe Huntress SIEM API paginates data for performance reasons through the ```page``` and ```limit``` query parameters. ```limit``` is limited to a maximum of 500.\n\nTo make working with paginated data easy, Endpoints that implement a GET response with an array also supply a ```paginated()``` method. Under the hood this wraps a GET request, but does a lot of neat stuff to make working with pages easier.\n\nWorking with pagination\n```python\n# initialize a PaginatedResponse instance for /agents, starting on page 1 with a pageSize of 100\npaginated_agents = siem_api_client.agents.paginated(1,100)\n\n# access the data from the current page using the .data field\npage_one_data = paginated_agents.data\n\n# if there's a next page, retrieve the next page worth of data\npaginated_agents.get_next_page()\n\n# if there's a previous page, retrieve the previous page worth of data\npaginated_agents.get_previous_page()\n\n# iterate over all companies on the current page\nfor agent in paginated_agents:\n # ... do things ...\n\n# iterate over all companies in all pages\n# this works by yielding every item on the page, then fetching the next page and continuing until there's no data left\nfor agent in paginated_agents.all():\n # ... do things ...\n```\n\n# Contributing\nContributions to the project are welcome. If you find any issues or have suggestions for improvement, please feel free to open an issue or submit a pull request.\n\n# Supporting the project\n:heart:\n\n# Inspiration and Stolen Code\nThe premise behind this came from the [pyConnectWise](https://github.com/HealthITAU/pyconnectwise) package and I stole **most** of the code and adapted it to the Huntress API endpoints.",
"bugtrack_url": null,
"license": null,
"summary": "A full-featured Python client for the Huntress APIs",
"version": "0.2.13",
"project_urls": {
"Homepage": "https://github.com/brygphilomena/pyhuntress",
"Issues": "https://github.com/brygphilomena/pyhuntress/issues"
},
"split_keywords": [
"api",
" annotated",
" client",
" huntress",
" msp",
" manages sat",
" python",
" siem",
" typed"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "d6facb7c28c7073ce7c31a504505225fbd47b64b3c08ced0aa5f466abb80e178",
"md5": "d2ce54d2960fe2aa317eda7547b523c1",
"sha256": "36ee4cb09c6790a2f19928988da8de36e73c928ca2ce2e063866593239ae48bb"
},
"downloads": -1,
"filename": "pyhuntress-0.2.13-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d2ce54d2960fe2aa317eda7547b523c1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 88964,
"upload_time": "2025-07-29T17:46:26",
"upload_time_iso_8601": "2025-07-29T17:46:26.691938Z",
"url": "https://files.pythonhosted.org/packages/d6/fa/cb7c28c7073ce7c31a504505225fbd47b64b3c08ced0aa5f466abb80e178/pyhuntress-0.2.13-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "a113ad1f6c56695e243d16233b7a38360f6166f67f15326b53c2a74576e18537",
"md5": "82511881b3ef9556cbda9d89b460feff",
"sha256": "e5af95eb38d4cd2af72ba05e76867d3dd5f51007b96f69a50a559d7ee5de42e5"
},
"downloads": -1,
"filename": "pyhuntress-0.2.13.tar.gz",
"has_sig": false,
"md5_digest": "82511881b3ef9556cbda9d89b460feff",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 38449,
"upload_time": "2025-07-29T17:46:30",
"upload_time_iso_8601": "2025-07-29T17:46:30.319632Z",
"url": "https://files.pythonhosted.org/packages/a1/13/ad1f6c56695e243d16233b7a38360f6166f67f15326b53c2a74576e18537/pyhuntress-0.2.13.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-29 17:46:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "brygphilomena",
"github_project": "pyhuntress",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "requests",
"specs": [
[
"==",
"2.32.4"
]
]
},
{
"name": "pydantic",
"specs": [
[
"==",
"2.11.7"
]
]
},
{
"name": "typing_extensions",
"specs": [
[
"==",
"4.14.1"
]
]
}
],
"lcname": "pyhuntress"
}