Giter Club home page Giter Club logo

api's Introduction

helldivers-2/api

The helldivers-2/api project is a community API around the popular video game Helldivers 2 by ArrowHead studios. It provides (most) information you can also find in-game in a neat JSON format so you can build awesome applications (see Community below).

Important to note is that this is not an officially endorsed API and is in no way affiliated with ArrowHead studios, but rather a community driven effort to provide the information of Helldivers 2 to it's community.

Getting started

The API does not require authentication (unless you'd like higher rate limits than the default, see rate limits), so all you need to do is call it's publicly available endpoints.

We provide an OpenAPI specification of the community API as well as a SwaggerUI (which visualizes the OpenAPI document). We also provide an OpenAPI of the official ArrowHead studio's API we use internally, however we strongly encourage you to use the /raw endpoints of the community wrapper instead of accessing the ArrowHead API directly, as it puts additional load on their servers (besides, we have shinier endpoints, I swear!).

The root URL of the API is available here: https://api.helldivers2.dev

Warning

The root domain of the API recently changed, it's recommended you use the domain above to avoid problems in the future

We ask that you send along a X-Super-Client header with the name of your application / domain (e.g. X-Super-Client: api.helldivers2.dev) and optionally a X-Super-Contact with some form of contact if your site does not link to any form of contact information we can find. We use this information in case we need to notify our users of important changes to the API that may cause disruption of service or when additional restrictions would be imposed on your app (to prevent abuse, unintentional or otherwise).

Important

While adding X-Super-Client and X-Super-Contact is currently not required, the X-Super-Client header will be made obligatory in the future, causing clients who don't send it to fail. For more information see #94

Rate limits

Currently the rate limit is set at 5 requests/10 seconds. This limit will probably be increased in the future, and is used during the transition to our new version.

To avoid hitting rate limits in your clients check the following headers in your response:

  • X-Ratelimit-Limit contains the total amount of requests you can make in the given timeframe
  • X-RateLimit-Remaining how many requests you can still make in the current window
  • Retry-After only added to 429 requests, the amount of seconds to wait before making a new request

Contributing

make sure to check out our contribution guidelines for more detailed information on how to help us contributing!

Community

Check out some awesome projects made by our community!

api's People

Contributors

chatterchats avatar dealloc avatar lambstream avatar marvinody avatar paulleonartcalvo avatar sreece52 avatar stnokott avatar superintendent2521 avatar thewizardofgauze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api's Issues

Add ETag Support to .NET rewrite

Add support for ETags, which provide a way for applications to verify if a given endpoint still returns the last cached data. This reduces load and bandwidth

With every fetch from the AH-API, the server could generate a hash like MD5 and response with the ETag Header which holds the value of the hash.
A client can take this value and use it in the If-None-Match header. If the hash is still the same, because AH-API data is still the same or the next request from the client has been done before a new fetch occured, the Server answers with a 304 - Not Modified response without body, and with the normal response body, if the data has been changed.

This reduces the bandwidth needed and would be a nice addition, please ask if I explained something bad or if there still are questions

Waypoints are supply lines! (Possibly?)

https://github.com/dealloc/helldivers2-api/blob/45a17d4bef56128be06d3a38ee2624a56f40f294/lib/helldivers_2_web/schemas/planet_schema.ex#L40

Was doing some digging and realized that waypoints are supply lines. The array maps to the indexes of the planets it goes to.
So for example "Azur Secundus" has waypoints: [213]. The planet with index 213 is "Overgoe Prime".

I am also going off of https://helldivers.io/ and it matches

Let me know if you agree and I can open a PR to update the docs

Mars missing

It appears that Mars is missing in the planet data. You can see Mars when you zoom into the Super Earth sector in-game. Other fan made trackers also show it on their maps.

[FEATURE]: option to increase rate limits

What problem does it solve

Some projects and applications will require higher rate limits than the current configuration allows

What is the solution

A system that allows higher rate limits for certain clients.
The main reason for the rate limits currently is to make sure the system stays within the limits of the current hosting plan, higher funding allows for higher limits thus allowing higher rate limits.

Existing alternatives

Use the existing rate limits

Added value

Allows certain clients to use higher rate limits for more demanding applications

Additional notes

Specifics on how this should be implemented needs to be discussed.

how did you find these endpoints?

I'm curious how you found these endpoints (assuming you are willing to share). I tried using burpsuite as a proxy but got no requests from the game

[BUG]: War factions is empty

Link to faulty endpoint

/api/v1/war

The name of your client/application

https://github.com/sebsebmc/helldivers-history

Request information

Factions currently responds with [] and no actual data

Steps to reproduce

curl -H "Accept-Language: en-us" https://helldivers-2-dotnet.fly.dev/api/v1/war

What is expected?

Something like ["Humans", "Terminids", "Automatons"]

What is actually happening?

{"started":"2024-01-23T20:05:13Z","ended":"2028-02-08T20:04:55Z","now":"1970-02-24T10:33:40Z","clientVersion":"0.3.0","factions":[],"impactMultiplier":0.012120398,"statistics":{"missionsWon":112362781,"missionsLost":11913252,"missionTime":119763643969,"terminidKills":9386109258,"automatonKills":3204924753,"illuminateKills":28,"bulletsFired":82143992697,"bulletsHit":83056767905,"timePlayed":119763643969,"deaths":407118779,"revives":2,"friendlies":56219002,"missionSuccessRate":90,"accuracy":100,"playerCount":245023}}


### System Info

_No response_

### Any additional comments?

_No response_

"sector" field missing from OpenApi

The field "sector" is not defined in PlanetSchema, yet it is returned from the API.
Besides, the field seems to be returning sometimes a name, and sometimes, a number (in String format).

Major Order Messages

The current major order text has all the text in the title field with a newline. Im not sure if this was a backend change on the part of Arrowhead or not. Also not seeing the newest messages since the liberation of Tien Kwan.

[FEATURE]: Add Progress for MO's to v1/assignments

What problem does it solve

This will allow users to obtain the MO progress for MO's that don't provide specific planets to liberate (in the case of the current MO).

What is the solution

Map the property to the assignment endpoint(s): /api/v1/assignments and /api/v1/assignments/:index

Existing alternatives

Making an additional request to the /raw/api/v2/Assignment/War/801 endpoint.

Added value

Lets users make fewer requests for useful info.

Additional notes

None

[FEATURE]: Add warbond endpoints

What problem does it solve

Provides API access to fetch warbond information

What is the solution

Add an API endpoint that returns the warbonds available

Existing alternatives

diveharder

Added value

Allows websites and apps to show warbond information.

Additional notes

Basically an endpoint that returns the JSON data from the helldivers-2/json repo

Wrong Dates / Date formatting

The API-Wrapper formats timestamps into Dates.
As an example here in the Object of a Planet Event:
grafik

The Dates in this Object are coming from Timestamps given by the Helldivers API like this:
grafik

As you can see there are TimeStamps. But these cannot be directly converted into a Date, since they are not UNIX Timestamps!
They show the time since the start of the season!

The return of the WarSeason Status shows this time as you can see here.
grafik

So if you want to create a correct Date you need to calculate the current UNIX Timestamp something like that:

$actualUnix = $currentTimeStamp - $warSeasonStatus->time + $planetEvent->expire_time

With this TimeStamp you can create a correct Date.

So imo the optimal Fix would be either calculating the correct Date or just returning the original TimeStamp from the HD2 Api.

Other than that, nice work with the wrapper. 😄

[FEATURE]: raw payloads should be 'raw'

What problem does it solve

When ArrowHead changes it's schema, or if the POCO classes in the API are not entirely correct or incomplete, the resulting data returned from raw payloads does not match with the ArrowHead API responses.

What is the solution

Store the exact payload of ArrowHead's API, rather than relying on a serialized version of a domain model

Existing alternatives

The current version uses POCO classes, however this causes problems (see above)

Added value

Future proofs the raw endpoints, reduced memory usage (no serialization step)

Additional notes

Planet Statistics

image

I believe that these APIs in the past were disabled for stability reasons and have now been stably up for a bit. Would be good to find out how to get these values as well.

Error Response

Im currently git-scraping the API and occasionally getting error responses for /api/801/status:

{"errors":{"detail":"Not Found"}}

If you are caching results it would be good to attempt to drop these error responses, serve either old data and attempt to fetch new data (reasonable rate limits considered).

[BUG]: Public SwaggerUI unavailable due to CORS

Link to faulty endpoint

https://helldivers-2.github.io/api/docs/openapi/swagger-ui.html

The name of your client/application

n/a

Request information

Querying the public GitHub pages SwaggerUI as linked in the README after #68 results in an empty page.

The reason for this is that the swagger-ui-bundle.js library doesn't load due to CORS policy.

Console log in browser:
Access to script at 'https://unpkg.com/[email protected]/swagger-ui-bundle.js' from origin 'https://helldivers-2.github.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Steps to reproduce

  1. Open public SwaggerUI

What is expected?

SwaggerUI is expected to load.

What is actually happening?

CORS policy prevents the SwaggerUI JS library from loading.

System Info

n/a

Any additional comments?

No prior experience with GitHub pages, so unfortunately I can't help with this topic.

[BUG]: Dispatches have incorrect publishing date

Link to faulty endpoint

https://helldivers-2-dotnet.fly.dev/api/v1/dispatches

The name of your client/application

curl / browser

Request information

curl 'https://helldivers-2-dotnet.fly.dev/api/v1/dispatches' \
  -H 'authority: helldivers-2-dotnet.fly.dev' \
  -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \
  -H 'accept-language: en-US,en;q=0.9' \
  -H 'cache-control: max-age=0' \
  -H 'sec-ch-ua: "Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Linux"' \
  -H 'sec-fetch-dest: document' \
  -H 'sec-fetch-mode: navigate' \
  -H 'sec-fetch-site: none' \
  -H 'sec-fetch-user: ?1' \
  -H 'upgrade-insecure-requests: 1' \
  -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36'

Steps to reproduce

Make a get request to "https://helldivers-2-dotnet.fly.dev/api/v1/dispatches"

What is expected?

published fields in dispatches endpoint reflect the date the dispatch occurred.

What is actually happening?

When making a GET request to "https://helldivers-2-dotnet.fly.dev/api/v1/dispatches" the published fields timestamp seem to be around 18 days behind the actually value. For example the dispatch that was posted today on 4/18/2024 has the value {"published": "2024-03-31T22:49:13Z"} when it should have a value close to "2024-04-18T05:20:03Z".

System Info

No response

Any additional comments?

No response

[BUG]: github.io not redirecting to OpenAPI properly

Link to faulty endpoint

https://helldivers-2.github.io/api/

The name of your client/application

N/A

Request information

N/A

Steps to reproduce

What is expected?

It should redirect to https://helldivers-2.github.io/api/docs/openapi/swagger-ui.html

What is actually happening?

It currently redirects to https://helldivers-2.github.io/docs/openapi/swagger-ui.html resulting in a 404 page.

System Info

Chrome 123.0.6312.123

Any additional comments?

No response

[FEATURE]: Option to fetch all dispatches/assignments in all languages

What problem does it solve

The old API responded with global_events containing the message in all fetchable languages like so (messages truncated for brevity):

"message": {
        "es": "...",
        "fr": "....",
        "de": "....",
        "en": "...",
        "it": "...",
        "pl": "...",
        "ru": "...",
        "zh": "..."
      },

What is the solution

Allow some method of retrieving all versions of the translated strings for dispatches and/or assignments without having to request every single language separately. I would be fine with a separate GET parameter or some specific Accept-Language header.

Existing alternatives

Making 8+ requests just to have the assignments in each language is annoying and would use up a lot of rate limit.

Added value

My app currently provides a language picker and ships the messages in all languages so you can choose to see them in any language.

[FEATURE]: Convert Arrowhead text formatting tags to standard HTML tags.

What problem does it solve

Arrowhead uses seemingly arbitrary text formatting system that isn't compatible with most (if any) applications.

What is the solution

Convert Arrowhead's formatting tags from their endpoint to standard HTML tags.

Existing alternatives

Manually converting tags in each application.

Added value

Would simplify text formatting for applications using the API, rather than having to convert the tags each time.

Additional notes

Although I'm unsure how exactly they use their tags, for the dispatches the headline is tagged with <i=3></i> which seems to be either a bold or header tag, while <i=1></i> makes text bold and yellow colored. Not sure the best way to interpret and convert them.

I have yet to see what <i=2></i> does if it exists.

[FEATURE]: Add expiresIn to assignments

What problem does it solve

This will allow consumers of the api to obtain the number of seconds until the major order expires in.

What is the solution

Map the property to the assignment endpoint(s): /api/v1/assignments and /api/v1/assignments/:index

Existing alternatives

Making an additional request to the /raw/api/v2/Assignment/War/801 endpoint.

Added value

Enable consumers of the api to make fewer requests. Improved QOL for api consumers.

Additional notes

None

[FEATURE]: Docker Setup

What problem does it solve

I figured it would help people setup self-hosted version easier :)

What is the solution

Dockerize!

Existing alternatives

🤷🏻‍♂️

Added value

Just makes it easier to setup a docker container for self-hosting

Additional notes

Sorry for this lackluster request, I don't really know what else to add

Docker run Issue: eaddrnotavail

Having an issue on a fresh instance of Ubuntu 22.04.2.

Running the following command from the README produces an error:

docker run -e SECRET_KEY_BASE=JlU7vU9xt9uWbf82Z9HrUjAuNGtqwqG8h8AaUc3AOyH0a86wa5Q4DITNLorGmILv -e FLY_APP_NAME=helldivers-2 -e FLY_IMAGE_REF=0 -e FLY_PRIVATE_IP=127.0.0.1 -p 4000:4000 helldivers2:latest
Protocol 'inet6_tcp': register/listen error: eaddrnotavail

I first attempted this on WSL but got the same error and assumed it may have been because of some weird Windows issue. However, I am still having this issue on a fresh VM.

Possible to get defense campaign status?

I was wondering if there was a known way to get status of a defense campaign. So far from what I've tried by using
https://helldivers-2.fly.dev/api/{war_id}/planets/{planet_index}/status
The defense planets are showing "health": 1000000, "liberation": 100.

Is there different planet information I can get that tells me or is it not known/not possible?

[BUG]: Assignment title not displaying correctly

Link to faulty endpoint

https://helldivers-2-dotnet.fly.dev/api/v1/assignments

The name of your client/application

python-requests/2.31.0

Request information

aresponse = requests.get("https://helldivers-2-dotnet.fly.dev/api/v1/assignments")

Steps to reproduce

Visit the assignments endpoint.

What is expected?

Title should be actual words relevant to the content of the assignment.

What is actually happening?

Title instead has a value of "#A / <i=1>#B</i>".

System Info

Python, VSCode, Chrome 123.0.6312.106

Any additional comments?

Unsure if this is an issue with the Arrowhead endpoint or this API's endpoint.

API responding with `null` for lang `de`

After the addition of different languages to the API, it seems that it‘s only responding with a NULL value for the german translation of the string. I‘m not familiar with Elixir, but from what I understand, you iterate through the different languages. The languages are defined in your env, so please check if de is set to de-DE

[
  {
    "assignment_id_32": 525659126,
    "effects": [],
    "flag": 1,
    "id": 1499082,
    "id_32": 0,
    "message": {
      "es": "Las esporas termínidas han inundado Heeth y Proyecto del Ángel y han engendrado hordas de termínidos que han aplastado las milicias coloniales. Es evidente que el instinto de colmena de esos bichos lleva a su irracional expansión a deshonrar el recuerdo de quienes lucharon por liberar estos planetas.\n\nTus compañeros Helldivers dieron su vida por estas tierras. No podemos perderlas. Mantén el control en los planetas hasta que lleguen los refuerzos S.E.A.F.",
      "fr": "Les spores terminides se répandent sur Hïs et le Périple de l'ange, des hordes d'insectes submergent les milices coloniales. De toute évidence, l'esprit de la ruche a décidé de cracher au visage des valeureux héros qui ont libéré ces planètes.\n\nVos compagnons d'armes ont sacrifié leur vie pour prendre le contrôle de ces territoires. Nous ne pouvons pas les abandonner. Gardez le contrôle de ces planètes jusqu'à l'arrivée des renforts de la Super-Terre.",
      "de": null,
      "en": "Terminid spores have engulfed Heeth and Angel's Venture, spawning hordes of Terminids that overwhelmed our colonial militias. Clearly, the bug hive instinct oriented their mindless expansion towards dishonoring the memory of those who fought to free these planets.\n\nYour fellow Helldivers paid for these lands with their lives. We cannot lose them now. Hold the planets until SEAF reinforcements arrive.",
      "it": "Le spore dei Terminidi hanno avvolto Heeth e Angel's Venture, generando orde di Terminidi che hanno sopraffatto le nostre milizie coloniali. Chiaramente, la mente alveare degli insetti ha portato la loro cieca espansione a disonorare la memoria di coloro che hanno combattuto per liberare questi pianeti.\n\nI vostri compagni Helldiver hanno dato la loro vita per questi territori. Non possiamo perderli. Difendeteli fino all'arrivo dei rinforzi FAST.",
      "pl": "Zarodniki terminidów wyroiły się w Heeth i Anielskim Przedsięwzięciu, co doprowadziło do pojawiania się hord terminidów, które pokonały nasze kolonialne bojówki. Najwyraźniej instynkt roju robali nakazał im bezmyślną ekspansję i zbezczeszczenie pamięci o tych, którzy walczyli o wyzwolenie tych planet.\n\nHelldiversi tacy jak ty zapłacili własnym życiem za te tereny. Nie możemy ich teraz utracić. Utrzymaj planety do czasu przybycia uzupełnień SZSZ.",
      "ru": "Споры терминидов окружили Хиит и Ангельский Риск и породили орды жуков, сломивших сопротивление планетарного ополчения. Определенно, коллективный инстинкт жуков теперь желает не только бессмысленно захватывать новые территории, но и опорочить память тех, кто боролся за освобождение этих планет.\n\nАдские Десантники заплатили за захват этих земель своими жизнями, потому мы не имеем права их потерять. Удерживайте эти планеты, пока не прибудут подкрепления ВССЗ."
    },
    "message_id_32": 2841401849,
    "planets": [],
    "portrait_id_32": 0,
    "race": "Humans",
    "title": "BRIEFING",
    "title_32": 2908633975
  },
  {
    "assignment_id_32": 0,
    "effects": [],
    "flag": 2,
    "id": 1499081,
    "id_32": 0,
    "message": {
      "es": "Bien hecho, Helldivers. A partir de ahora, los Equipos S.E.A.F. de contención se harán cargo de las operaciones de limpieza e inoculación. Se ha informado a los colonos de que no hay absolutamente ninguna amenaza de nuevos conflictos termínidos, y de que pueden asentarse con sus familias con toda tranquilidad.\n\nAdemás, los pilotos encargados de la limpieza de esporas en Veld ya han recibido órdenes de ocuparse de las operaciones de apoyo a los Helldivers. \n<i=1>La extracción será más rápida en todas las operaciones.</i>",
      "fr": "Bien joué, Helldivers. L'équipe de confinement des forces armées la Super-Terre va prendre en charge les opérations de nettoyage et de vaccination. Nous avons informé les colons qu'il n'y avait aucun risque de résurgence des terminides, mais aussi qu'ils pouvaient se réinstaller en toute quiétude.\n\nPar ailleurs, les pilotes chargés de dissiper les spores sur Veld vont être redéployés en soutien des Helldivers. \n<i=1>Les délais d'extraction seront plus courts pour toutes les opérations.</i> ",
      "de": null,
      "en": "Well done, Helldivers. SEAF Containment Teams will take over cleanup and inoculation operations from here. Colonists have been advised that there is absolutely zero threat of further Terminid violence, and to settle their families with total peace of mind.\n\nAdditionally, the pilots allocated to spore clearance on Veld have now been redirected to Helldiver support operations. \n<i=1>Extraction will be faster on all operations.</i> ",
      "it": "Bel lavoro, Helldiver. Le squadre di contenimento FAST si occuperanno delle operazioni di pulizia e inoculazione a partire da qui. I coloni sono stati informati che la minaccia di ulteriori attacchi da parte dei Terminidi è nulla e che possono stabilirsi con le loro famiglie in totale tranquillità.\n\nInoltre, i piloti assegnati alla rimozione delle spore su Veld sono stati reindirizzati alle operazioni di supporto degli Helldiver. \n<i=1>Le operazioni di estrazione saranno più veloci.</i> ",
      "pl": "Dobra robota, helldiversi. Oddziały likwidacyjne SZSZ zajmą się teraz czyszczeniem i szczepieniem. Koloniści otrzymali informację, że zagrożenie ze strony terminidów jest już absolutnie zerowe. Mogą spokojnie dokonywać osadnictwa wraz ze swoimi rodzinami.\n\nCo więcej, piloci przydzieleni wcześniej do oczyszczania Veld z zarodników, zostali teraz przeniesieni do operacji wsparcia helldiversów. \n<i=1>Podczas wszystkich operacji odbiór będzie szybszy.</i> ",
      "ru": "Отличная работа, Адские Десантники. Теперь команды сдерживания ВССЗ займутся зачисткой и иммунизацией. Колонистам сообщили, что угроза будущих нападений терминидов снижена до нуля и они могут без опаски селиться здесь вместе с семьями.\n\nТакже пилоты, отвечавшие за уничтожение спор на Вельде, в дальнейшем будут оказывать поддержку миссиям Адских Десантников.\n<i=1>С этого момента эвакуация во всех операциях будет происходить быстрее.</i>"
    },
    "message_id_32": 3767473056,
    "planets": [],
    "portrait_id_32": 0,
    "race": "Humans",
    "title": "SUCCESS",
    "title_32": 2998873950
  }
]

[BUG]: Dispatches endpoint only returning 10 or so items

Link to faulty endpoint

https://helldivers-2-dotnet.fly.dev/api/v1/dispatches

The name of your client/application

Mozilla FireFox

Request information

Need to include the maxEntries query param to the url.

Steps to reproduce

Load https://helldivers-2-dotnet.fly.dev/api/v1/dispatches in a browser.

What is expected?

Returns all newsfeed items

What is actually happening?

Only returns the first 10 or so

System Info

Windows 10
Firefox

Any additional comments?

No

[FEATURE]: supported different names of planets

What problem does it solve

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

The game has different proper names for these planets, which may be confusing when using the API in different countries or locally the name is different

What is the solution

A clear and concise description of what you want to happen.

I suggest it be supported as the API assigning the different languages ​​of the game, like that each person who uses it to load the data in the languages ​​of the game that they have at home

Existing alternatives

A clear and concise description of any alternative solutions or features you've considered.

As an alternative to this I couldn't find anything

Added value

A clear description of the value this feature would add to the community and applications.

This feature could make the API accessible to more people, the developers themselves are not negatively impacted but the target audience could find themselves preferring this API because the languages ​​are supported rather than an API which supports inconsistent names for them

Additional notes

Add any other context or screenshots about the feature request here.

I don't have a screenshot

Orders and Events Question

Thanks for the API! A friend and I are working on a site that uses it as a source for data. Do you know how to access the Major Orders and the Personal Orders? It's something we'd really like to include on our site but looking at the api I am not sure where they are.

Additionally, do you know when (if?) the events endpoint will be populated? I've been keeping an eye on it for the past few days and it always seems to return an empty array. But I might have missed something.

Thanks again! Also, in my free time I am an Elixir dev, so if you need any help working on this API I'd be happy to pitch in

Missing item type for some arrays causes problems with OpenApi generator

The OpenApi JSON file is missing some item types for some arrays (waypoints, planet_permanent_effects, capitals, active_election_policy_effects, community_targets and planet_active_effects), which causes Kotlin client generator to not be able to determine the List type:
image

This can easily be fixed by adding in the schema the item type for each array:

"waypoints": {
    "description": "Waypoints, seems to link planets together but purpose unclear",
    "type": "array",
    "items": {
        "type": "integer"
    }
}

I know most of the fields I mentioned are not known very well currently, but, just as a default type, could you add String or Intenger to avoid this kind of errors?

Thanks!

language code

zh-Hans and zh-Hant are also valid Accept-Language values

CORS

Currently no CORS headers are configured so attempting to fetch() the current data is blocked by browers.

[FEATURE]: provide biome and environment data for planets

What problem does it solve

Provide additional information about hazards and environments of planets

What is the solution

add the newly mapped information from helldivers-2/json

Existing alternatives

none

Added value

More information being provided for planets

Additional notes

This is a breaking change for the source generators, some care should be applied when picking this up, as Roslyn generators aren't the easiest SDK to work with.

Detail not found from /events/latest endpoint when global event is active

It seems that the endpoint /api/{war_id}/events/latest no longer provides data when an global event is active and returns a Not Found error.

Reproduction:

  • Wait till a Global Event is active,
  • Try and fetch data from the endpoint: /api/{war_id}/events/latest

Results:

{"errors":{"detail":"Not Found"}}

Expected Results:

  • Provide current global event information

Overview of all planets in the current war returns `"disabled": false` for all planets.

When calling /api/{war_id}/planets all planets return "disabled": false

example:

{
    "disabled": false,
    "hash": 897386910,
    "index": 0,
    "initial_owner": "Humans",
    "max_health": 1000000,
    "name": "Super Earth",
    "position": {
      "x": 0,
      "y": 0
    },
    "sector": "Sol",
    "waypoints": [
      1
    ]
  },

Super Earth should be disabled at the moment unless I'm missing something.

I'm fiddling around with creating a bot that displays things like, in this case, the currently active planets. In the meantime, I'll see about using /api/{war_id}/status instead. Probably the better option for my uses anyway, but I noticed this and thought I'd mention it.

Planet Details

First of all, great effort so far. I have been breaking down the API as well but unfortunately I haven't been able to fuzz out a planet's endpoint. I did break out a file from the game (generated_planet_data.dl_bin) which does list 385 planets with there corresponding biomes if you are interested in that information but unfortunately I don't think there is any specific names in that file just the IDs.

Additional Endpoints

Hey, I work on the rust wrapper for the helldivers api, in the spirit of cooperation there are two endpoints i dont think you use yet

https://api.live.prod.thehelldiversgame.com/api/NewsFeed/[war_id]

[{"id":2797,"published":2414563,"type":0,"tagIds":[]},{"id":2798,"published":2499000,"type":0,"tagIds":[]},{"id":2799,"published":2507100,"type":0,"tagIds":[]},{"id":2800,"published":2531100,"type":0,"tagIds":[]},{"id":2801,"published":2598240,"type":0,"tagIds":[]},{"id":2802,"published":2705219,"type":0,"tagIds":[]},{"id":2803,"published":2705235,"type":0,"tagIds":[]},{"id":2804,"published":2822793,"type":0,"tagIds":[]},{"id":2805,"published":2899259,"type":0,"tagIds":[]},{"id":2806,"published":2899330,"type":0,"tagIds":[]}]

and

https://api.live.prod.thehelldiversgame.com/api/WarSeason/[war_id]/WarTime

{"time":3120460}

[BUG]: Wrong links for new deployment.

Link to faulty endpoint

https://github.com/helldivers-2/api

The name of your client/application

Mozilla FF

Request information

Just loading github.com/helldivers-2/api

Steps to reproduce

Clicking on service link or the readme.md's links,
image

What is expected?

Link to take me to the current function api at -dotnet

What is actually happening?

getting links to the old api

System Info

Windows 10
Firefox FF

Any additional comments?

No response

[FEATURE]: Include data from planet_attacks

What problem does it solve

The raw data includes planet_attacks which provides a from->to mapping of planet indexes that may or may not be derivable from waypoints. This was nice for visualizations and it is annoying that its not included in the v1 API data.

What is the solution

Include some form of this from/to data for campaign data. For defenses this could be left empty. Actually it looks like defenses still have source/target info in raw data.

Existing alternatives

I could fallback to using the raw API data but thats another request for the full status that I would rather avoid.

Added value

Makes attack vectors clear, and reduces the number of requests I would have to make.

[BUG]: Dispatches message content occasionally returns null

Link to faulty endpoint

api/v1/dispatches/

The name of your client/application

GWW Bot

Request information

As discussed on Discord this endpoint ocassionally returns null for the message content.
Here is an example
Hard to reproduce

Steps to reproduce

I honestly have no idea, possible ideas that I totally came up with are that an API call to the AH api failing will silently fail 😉

What is expected?

Not null

What is actually happening?

Null

System Info

Any additional comments?

This version of the API is self-hosted. My code has no issue when retrying shortly after (likely after another sync).
Appreciate the work!

Updated sector data

Hi there! We're working on the HellHub API and we have updated our sector data by leveraging the power of tideous hand-work. Feel free to snag the json file if you like!

[FEATURE]: Adding Liberation Change for Planets

What problem does it solve

Currently, there is no option to get the current change rate for a planets liberation.
You would need to save a snapshot yourself and calculate the liberation rate on your own.
Having such a feature in this api would be highly usefull for displaying informations such as:
Winning, Loosing, Stalemate

What is the solution

We need to add the functionality of saving a snapshot of the current liberation and compare it.
Everytime we want to update the liberation change we have to calculate the difference between the
saved liberation and the current one to get an estimated rate of change.
After calculating the rate of change we should update the snapshot.

Existing alternatives

An example for a possible output can be found here

Added value

A lot of people want to display such information.
Providing this would make it easier for developers who dont want or cant implement an own database structure.

Additional notes

Here are some example Files I use, to implement such functionality with PHP in Symfony:
(My implementation does not include proper defense campaign handling)

Entity to save the PlanetProgress:

class PlanetProgress
{
    #[ORM\Id]
    #[ORM\Column(type: 'uuid', unique: true)]
    public readonly Uuid $id;

    #[ORM\Column(type: 'integer')]
    #[Serializer\Groups(['default'])]
    public int $currentHealth = 0;

    #[ORM\Column(type: 'integer')]
    #[Serializer\Groups(['default'])]
    public int $maxHealth = 0;

    #[ORM\Column(type: 'float')]
    #[Serializer\Groups(['default'])]
    public float $liberation = 0;

    #[ORM\Column(type: 'float')]
    #[Serializer\Groups(['default'])]
    public float $previousLiberation = 0;

    #[ORM\Column(type: 'float')]
    #[Serializer\Groups(['default'])]
    public float $liberationChange = 0;

    #[ORM\Column(type: 'datetime')]
    public \DateTime $modifiedAt;

    #[ORM\Column(type: 'datetime_immutable')]
    private \DateTimeImmutable $createdAt;

    public function __construct(
        #[ORM\Id]
        #[ORM\Column(type: 'integer', unique: true)]
        #[Serializer\Groups(['default'])]
        public readonly int $planetIndex,

        #[ORM\Column(type: 'string')]
        #[Serializer\Groups(['default'])]
        public string $name,

        #[ORM\ManyToOne(targetEntity: WarSeason::class, inversedBy: 'planetsProgress')]
        public WarSeason $warSeason,
    ) {
        $this->id = Uuid::v4();
        $this->modifiedAt = new \DateTime();
        $this->createdAt = new \DateTimeImmutable();
    }
}

Logic to calculate the change rate:

private function updatePlanetsLiberation(WarSeason $warSeason): void
    {
        $this->logger->warning('Loading Planets Liberation...');

        $planets = $warSeason->planets;
        $planetsProgress = $warSeason->planetsProgress->toArray();

        foreach ($planets as $planetStatus) {
            $planetIndex = $planetStatus->planet->index;

            if ($planetIndex !== 0 && !$planetIndex) {
                continue;
            }

            $planetProgress = array_filter($planetsProgress, function ($planetProgress) use ($planetIndex) {
                return $planetProgress->planetIndex === $planetIndex;
            });

            if (!empty($planetProgress)) {
                $planetProgress = reset($planetProgress);
            } else {
                $planetProgress = new PlanetProgress(planetIndex: $planetIndex, name: $planetStatus->planet->name, warSeason: $warSeason);
            }

            $planetProgress->currentHealth = $planetStatus->health;
            $planetProgress->maxHealth = $planetStatus->planet->max_health;
            $planetProgress->previousLiberation = $planetProgress->liberation;
            $planetProgress->liberation = $planetStatus->liberation;

            try {
                //Calculates difference between last and current Liberation % and multiplies by 12 to get the hour estimate (Gets called every 5 Minutes)
                $planetProgress->liberationChange = ($planetProgress->liberation - $planetProgress->previousLiberation) * 12; 
            } catch (Exception $e) {
                $planetProgress->liberationChange = 0;
            }

            $planetProgress->modifiedAt = new \DateTime();

            $this->entityManager->persist($planetProgress);
        }
    }

[BUG]: Possible Resource leak

Link to faulty endpoint

N/A

The name of your client/application

Self-Hosted API

Request information

CPU and RAM usage seem to be increasing over time (up to 50% CPU and 500MB RAM after around 2 weeks)

image
^ on startup
image
^after 24 hours

image
^ on startup
image
^ after 24 hours

Steps to reproduce

  1. RUN API
  2. ?????
  3. Usage goes up

I'm not 100% on the process of setting it up

What is expected?

CPU and RAM levels to stay stable

What is actually happening?

CPU and RAM usage increases over time (CPU seemingly capped at around 50%)

System Info

RAM: 8GB
CPU: AMD EPYC-Milan Processor (2C\4T) (as much info as we can get)

Any additional comments?

Since this is an old version of the API (still V1) we'll update it before proceeding.

[BUG] planet-events does not give event's maxHealth for planet

Link to faulty endpoint

https://helldivers-2-dotnet.fly.dev/api/v1/planet-events

The name of your client/application

Mozilla / Swagger_UI Page

Request information

Mozilla / Swagger_UI Page

Steps to reproduce

Send get request to https://helldivers-2-dotnet.fly.dev/api/v1/planet-events to get planet event info

What is expected?

event maxHealth to be depicted in the event key

What is actually happening?

maxHealth is missing from event key

System Info

Windows 10
Mozilla FF
https://helldivers-2-dotnet.fly.dev/swagger-ui.html

Any additional comments?

No response

Retrieving War_ID

Other then hard coding 801 for the War Id is there any way to pull the war id from somewhere? Just don't see changing a hard coded value every time there is a new current War ID

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.