A simple micro-service used to cache Riot Match API Response Because Riot is keeping matchs for only 3 months (Except for the esports clients), we're storing the matches in our databases, to be able to fetch the entire match again later
Caution
This project isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games, and all associated properties are trademarks or registered trademarks of Riot Games, Inc.
| Build Status | Latest Version |
|---|---|
This repository contains the Rust relay caching Valorant matches from the Riot API.
License: This project is licensed under the GC-Stats License v1.0 - see the LICENSE file for details.
- Webserver: Axum
- Database: MariaDB 10.11+ (With SQLx)
All endpoints (except /health) require an Authorization header matching the AUTH_KEY environment variable.
| Endpoint | Description |
|---|---|
GET /match/{region}/{id} |
Returns the match from cache (X-Cache: HIT + X-Cache-Fetched-At), or fetches it from Riot and caches it (X-Cache: MISS) |
POST /match/{region}/{id}/renew |
Re-fetches the match from Riot and replaces the cached copy (X-Cache: RENEWED). If Riot fails, the old cache entry is preserved (X-Cache: RENEW-FAILED + X-Cache-Preserved: true) |
GET /health |
Liveness probe, no auth |
region must be one of: ap, br, esports, eu, kr, latam, na.
This service is used in an internal environment only. Publicly exposing it might go against Riot's Developer Policies.
From our research, it's not explicitly forbidden, but it falls in a gray zone (the closest applicable rule being "one product per key" in Riot's General Policies: https://developer.riotgames.com/policies/general). For that reason, this service stays private and internal to GC-Stats.
The easiest way to get started without installing Rust or MariaDB locally.
-
Clone the repo:
git clone https://github.com/GC-Stats/RiotRelay.git cd RiotRelay -
Copy .env
cp .env.example .env
Edit the files, and set your own variables
-
Build and launch it via Docker
docker build -t riotrelay . docker run -d --env-file .env -p 3000:3000 riotrelay
- Requirements: Rust, Cargo & MariaDB
- Commands:
cargo run
Interested in helping? Please refer to our CONTRIBUTING.md for guidelines on how to submit pull requests.