Skip to content

Commit

Permalink
refractor: optimize readme file (#17)
Browse files Browse the repository at this point in the history
* refractor: change name in license file

* refractor: optimize readme

* refractor: change code block markup type
  • Loading branch information
fabio-nettis authored Mar 25, 2024
1 parent e9f8c7e commit 238461b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 33 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Fabio Nettis
Copyright (c) 2024 HellHub Collective

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
61 changes: 29 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,48 @@
</p>

<h3 align="center">The Official API For The Community Driven HellHub App.</h3>
<p align="center">Written 100% in Typescript, running on Bun. Pulls data from the official API and acts as cache/transformer relay.</p>
<p align="center">Written 100% in <a href="https://github.com/microsoft/TypeScript">TypeScript</a>, running on <a href="https://github.com/oven-sh/bun">Bun</a>. Pulls data from the official game API and simplifies the data structure.</p>

<br>
<br />

## Whats is the HellHub API?

The unofficial API was not explicitly made usable by Arrowhead Game Studios for third parties, may be subject to change at any time. This API will be updated to reflect any changes to the game API.

### How does it work?

The API is written in Typescript and runs on the Bun framework. It pulls data from the Helldivers 2 API and transforms it into a more user-friendly format. It also caches the data so that the app can pull data from the API without having to worry about rate limits or slow response times.

## Rate limit

The HellHub API has a rate limit of 200 requests per minute. To avoid hitting rate limits in your clients check the following headers in your response:

- `X-Rate-Limit`: The maximum number of requests per minute.
- `X-Rate-Count`: The number of requests made in the current minute.
- `X-Rate-Reset`: The time at which the current rate limit resets.
- `X-Rate-Remaining`: The number of requests remaining.
<p align="center">
<a href="https://github.com/hellhub-collective/api/actions/workflows/github-code-scanning/codeql">
<img src="https://github.com/hellhub-collective/api/actions/workflows/github-code-scanning/codeql/badge.svg" alt="CodeQL" />
</a>
<a href="https://github.com/hellhub-collective/api/actions/workflows/tests.yml">
<img src="https://github.com/hellhub-collective/api/actions/workflows/tests.yml/badge.svg" alt="Tests" />
</a>
</p>

## API Entities and Endpoints
## What is the HellHub API?

For the full full documentation, check out the [postman collection](./postman.json) inside the repository root.
The HellHub API is a community-driven project that strives to provide easy access to the [Helldivers 2](https://store.steampowered.com/app/553850/HELLDIVERS_2/) data. This project is part of the HellHub Collective.

### Sectors
## Getting started

Sectors contain a number of planets and define a area on the galaxy map. We have manually mapped all planets to their respective sectors, if new planets should start existing (what is highly unlikely) we will add them too.
To start using the HellHub API, you can use the following base for your requests:

### Planets
```bash
https://api-hellhub-collective.koyeb.app/api
```

Celestial bodies inside a sector. As the war for democracy rages on, the planets are the main battlegrounds. Planets carry player counts and controlling faction.
Followed by the endpoint you want to access. Our data is **updated every 30 minutes**. For more information on the available endpoints, check the [postman collection](postman.json).

### Attacks
## Fair usage

Attacks always have a source and a target. The source is the planet that the attack is coming from, and the target is the planet that the attack is going to. You an check the attack progress by having a look on the planet's health properties.
To Enforce fair usage, we have implemented a rate limiter. The HellHub API has a rate limit of **200 requests per minute**. To avoid hitting rate limits in your clients check the following headers in your response:

### Factions
- `X-Rate-Remaining`: The number of requests remaining.
- `X-Rate-Limit`: The maximum number of requests per minute.
- `X-Rate-Reset`: The time at which the current rate limit resets.
- `X-Rate-Count`: The number of requests made in the current minute.

Factions are divided in three groups: Terminids, Humans and Automatons. Humans are the only faction that can be controlled by players. The other two are controlled by the game as Non-Player Characters (NPCs).
We reserve the right to block any IP address that uses the API in a way that is not fair to other users, or that is trying to abuse the system.

### War
## Disclaimer

The current war season is the 1st. The war season is a period of time in which the factions fight for control of the planets. The war season has a start and an end date which of the time of this writing is bugged out and not working properly.
The unofficial game API was not explicitly made usable by Arrowhead Game Studios for third parties and thus may be subject to change at any time. This project will be updated to reflect any changes to the data source.

### Events
## License

Events are in game briefings and updates that are sent to the players. They are used to inform the players about the current state of the game and the war.
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

0 comments on commit 238461b

Please sign in to comment.