helldive.py
A Python client library for the Helldivers 2 API.
Note: Some parts of the API have been reverse-engineered and may not reflect the current state of the game.
Installation
pip install helldivepy
Requires Python 3.11+.
Quick Start
from helldivepy import HelldiveAPIClient
# api.helldivers2.dev requires a contact and a client ID in the X-Super-Contact and X-Super-Client headers for rate-limiting purposes. This is required by the API and can be any contact (e.g. aj@ajxd2.dev,github/ajxd2,discord/ajxd2, etc).
client = HelldiveAPIClient(
client="my-app", # X-Super-Client header
contact="me@example.com", # X-Super-Contact header (required by the API)
)
# Get global war status
war = client.war.get()
print(war.now) # datetime
print(war.statistics.player_count) # int
# Get recent dispatches
dispatches = client.dispatches.get_all()
for d in dispatches[:3]:
print(d.message.to_md()) # converts HDML markup to HTML spans
Modules
| Module | Status | Methods |
|---|---|---|
client.war |
✅ Done | get() -> War |
client.dispatches |
✅ Done | get_all() -> list[Dispatch], get(index) -> Dispatch | None |
client.planets |
✅ Done | get_all() -> list[Planet], get(index) -> Planet |
client.campaigns |
✅ Done | get_all() -> list[Campaign], get(index) -> Campaign |
client.assignments |
✅ Done | get_all() -> list[Assignment], get(index) -> Assignment |
client.space_stations |
✅ Done | get_all() -> list[SpaceStation], get(index) -> SpaceStation |
client.steam |
✅ Done | get_all() -> list[SteamNews], get(gid) -> SteamNews |
Models
All models use automatic camelCase ↔ snake_case aliasing, so API responses deserialize transparently.
Key models
Planet — full planet state including health, owner, biome, hazards, regions, and an optional active Event.
planet = client.planets.get(42) # coming soon
print(planet.name)
print(planet.current_owner) # Factions.Terminids
print(planet.health / planet.max_health)
if planet.event:
print(planet.event.faction, planet.event.end_time)
Assignment (Major Orders) — tasks with parsed progress.
assignments = client.assignments.get_all() # coming soon
for assignment in assignments:
print(assignment.title, assignment.expiration)
for task in assignment.tasks:
if not task.is_liberation_task:
print(f" {task.progress_perc:.1f}% of {task.goal:,}")
Dispatch — in-game broadcasts with HDML (HellDivers Markup Language) markup.
dispatches = client.dispatches.get_all()
latest = dispatches[0]
print(latest.message.to_md()) # inline styles
print(latest.message.to_md(use_classes=True)) # CSS classes
Development
# Install dependencies
uv sync
# Run tests
uv run pytest
# Lint + format
uv run ruff check .
uv run ruff format .
# Type check
uv run pyright
Thanks
Thanks to the devs of the Community API for keeping a well maintained and easy to use API.
License
MIT
Metadata
Release files for helldivepy 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| helldivepy-1.0.0.tar.gz | 9.4 kB | With provenance | Details for helldivepy-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| helldivepy-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for helldivepy-1.0.0-py3-none-any.whl |
Total release size: 23.4 kB
Release files / helldivepy-1.0.0.tar.gz
| Download URL | helldivepy-1.0.0.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f22d0d53274e293f00ad88cfa16ce3091a21c34a5cf096b9cd2a345532202ddb
|
|
BLAKE2b-256 checksum How to use checksums |
0ef6a742543af4ebc11cb3d155b5421c774af9b3fca20b0f038e74b31de04674
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 19, 2026.
Transparency logRelease files / helldivepy-1.0.0-py3-none-any.whl
| Download URL | helldivepy-1.0.0-py3-none-any.whl |
|---|---|
| Size | 14.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2cd1987c7fae6a4b451d6402ba50a2f35473453bf53e0f682e9ddd2591406ef5
|
|
BLAKE2b-256 checksum How to use checksums |
5e19e8effe480eeeea07c18449be57b68a5910dc43ba86cee6e86dcfcdbe9159
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 19, 2026.
Transparency logSecurity for helldivepy 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for helldivepy-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.