This API provides detailed information about characters in Valve's Deadlock. The API features both a summary view of all characters and in-depth information of your desired characters.
If you don't already have TS runtime, install one. Bun is what this project utilizes.
To install for MacOS & Linux:
curl -fsSL https://bun.sh/install | bashTo install for Windows:
powershell -c "irm bun.sh/install.ps1 | iex"Then, clone the project and navigate into the directory:
git clone https://codeberg.org/dalentri/deadlock_api.git
cd deadlock_apiAfter cloning, you must configure your .env variables. The project has a pre-populated .env under the name .env.example, to use the provided template, rename it to .env:
mv .env.example .envOnce .env variables are configured, next is running the docker compose file.
If its your first time running the app, or you haven't changed any config files:
docker compose up -dIf you made any changes to your .env file or if you made any changes to the code or dependencies in 'package.json':
docker compose up --buildNext is to test the API endpoints.
Now lets test it out! There are two quick ways to test the API:
First we can get a JSON response from the browser. To start, paste and search this sample request URL into your browser's address bar:
http://localhost:3000/api/characters
The second method is to use cURL if you're more familiar with the command line, to request JSON from the server, run this command to fetch data:
curl http://localhost:3000/api/charactersThat's it, its as simple as that.
To request custom characters, append your desired character name after the characters/ endpoint like so:
http://localhost:3000/api/characters/character-name
Which turns into:
http://localhost:3000/api/characters/mina
Note that custom character names follow a special formatting:
- If the character name has a space, replace the space with a hyphen "-".
- The character name must be lowercase.
Alternatively, if you would like to type the name with spaces and uppercase letters, the application will properly format the name.