EdouardCourty / helldivers2-api

A wrapper for the official Helldivers 2 API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Helldivers 2 API

ESLint

This project aims to create an API wrapper for Helldivers 2.
I have been playing the game a lot since it is out, and I wanted to try and build something around it.

Currently, there is no way to get access to player data, but we're not done!

Features

  • Get current war id
  • Get war statistics
  • Get war info
  • Get war news feed
  • Get war summary (galaxy & planet statistics)
  • Get war main order
  • Get war leaderboards
  • Player endpoints
  • Global statistics endpoints

Usage example

Simply import the module and call the available methods. All of them return promises.

import helldivers2 from "helldivers2-api";

const currentWarId = await helldivers2.getCurrentWarId();
const warInfo = await helldivers2.getWarInfo(currentWarId);

console.log('War started on ' + warInfo.startDate);

const newsFeed = await helldivers2.getWarNewsFeed(currentWarId);

newsFeed.forEach((article) => {
    console.log(article.message);
});

// ...

Contributing

If you're interested in reverse-engineering and you want to contribute to this project, don't be afraid to submit a PR or use the discussion feed.

If you want to chat with me, get in touch using my email address or Discord: php_sensei

© Edouard Courty - 2024

About

A wrapper for the official Helldivers 2 API.


Languages

Language:JavaScript 100.0%