This is a for-fun project with the ultimate goal of a simple web app that scrapes the helldivers REST APIs. In the short term, I'm hoping to have a simple node script that hits the endpoints and parses them.
This API provides/will provide certain features and cover different use cases:
- Open Source
- Per Planet info and endpoints
- Updates + Orders recognition [TODO]
- Cache data from the Helldivers API to limit load
- Data collection and tracking of campaigns/wars over time [TODO]
- Custom node exporter that exposes war metrics
- prometheus scraping of the exporter
- custom grafana dashboards showing war status + change over time
- time series DB of all metrics
- Endpoint testing using Jest []
- github actions to test new pushes []
- host API on AWS []
- move to open source []
- openapi/swagger docs []
- node exporter for prometheus to scrape war metrics []
- storage of data in TSDB []
Typescript is required to run the server.
To run the server, you must first build the code:
tsc
Then, run the built code:
node dist/index.js
Or, to capture logs in a file:
node dist/index.js > serverlogs.txt
/info
returns the entire info json, raw- warId:
/warId
- dates:
/dates
- minClientVersion:
/minimumClientVersion
- planetInfo:
/planetInfos
- homeWorlds:
/homeWorlds
- warId:
/status
returns the entire status json, raw- warId:
/status/warId
- time:
/status/time
- impactMultiplier:
/status/impactMultiplier
- planetStatus:
/status/planetStatus
- planetAttacks:
/status/planetAttacks
- campaigns:
/status/campaigns
- communityTargets:
/status/communityTargets
- jointOperations:
/status/jointOperations
- planetEvents:
/status/planetEvents
- planetActiveEffects:
${statusbase}/planetActiveEffects
- activeElectionPolicyEffects:
/status/activeElectionPolicyEffects
- globalEvents:
/status/globalEvents
- warId:
/planets
returns all of the planets with their names- individual planets:
/planets/:{planet}
- individual planets:
Base URL: localhost:13131
curl localhost:13131/info
curl localhost:13131/status
https://helldivers-2.fly.dev/api/swaggerui#/default/Helldivers2Web.Api.WarSeasonController.index
In order to allow humans to use and understand the API, the planet names must be included in the API (not just the index, as it is raw). In order to do this, the planets must be plotted with their ID and sector ID and then manually mapped to the planet name from the in-game map (see /scripts/plotRadial.js
and rect_coordinates_plot_with_labels.png
). However, this is tedious and requires more effort than it's worth. So I am cheating and using a prebuilt API from @dealloc on github. This API already did this work, and includes index and planet name in the data package. So I will be using that to generate a json object with planet index mapped to planet name.
Find that script in scripts/cheating.js