tMLAPIs adds multiple apis to get data for tModLoader mods.
It has support for both tModLoader version 1.3 and 1.4.
This Project is built in rust using the rocket, reqwest and scraper crates. Data for 1.3 mods are scraped from http://javid.ddns.net/tModLoader and data for 1.4 mods is reqwested from the Steam API.
You can host tMLAPIs yourself by compiling this repo and running it on your own machine. How to build this repo is explained in the next section. Or you can use the API using the mirror: https://tmlapis.le0n.dev/
- Install cargo
Bare metal: Prerequisites: A running postgres environment with the DATABASE_URL env set.
- Clone the repository
- Set the STEAM_API_KEY environment variable to your Steam API key. Go here to get one.
- Run with
cargo run --release
Docker: Prerequisites: A running postgres environment with the DATABASE_URL env set.
- Clone the repository
- Build the image:
docker build -t tmlapis . - Run the image with the STEAM_API_KEY environment variable included:
docker run --name tmlapis \
-e STEAM_API_KEY=**** \
-dp 127.0.0.1:8000:8000 \
tmlapis
Docker compose
-
Create compose.yaml:
services: db: image: timescale/timescaledb:latest-pg15 container_name: modinfo-db ports: - "5432:5432" env_file: - db.env volumes: - db_data:/var/lib/postgresql/data tmlapis: build: . container_name: tmlapis env_file: - tmlapis.env ports: - "8000:8000" depends_on: - db volumes: db_data:
-
docker compose up
For api documentation, see the wiki page.