Live API Documentation: https://api.deadlock-api.com/docs
Note: deadlock-api.com is not endorsed by Valve and does not reflect the views or opinions of Valve or anyone officially involved in producing or managing Valve properties. Valve and all associated properties are trademarks or registered trademarks of Valve Corporation.
The API provides endpoints for:
- Matches: Match data and statistics
- Players: Player profiles and statistics
- Leaderboard: Competitive rankings
- Analytics: Game analytics and statistics
- Builds: Hero build information
- Patches: Game update information
- Commands: Streamkit integration
- Info: General API information
For detailed API documentation, visit the live API docs or run the API locally and
navigate to /docs.
Deadlock API is a Rust-based REST API that provides data and statistics for the game Deadlock. It offers endpoints for player statistics, match history, leaderboards, hero analytics, build information, and more.
The API is built with:
- Axum - Web framework
- Tokio - Async runtime
- Utoipa - OpenAPI documentation
- SQLx - SQL toolkit
- Redis - Caching
- ClickHouse - Analytics database
- PostgreSQL - Relational database
- Rust (stable toolchain)
- Protocol Buffers compiler
- Docker and Docker Compose (for deployment)
-
Clone the repository:
git clone https://github.com/deadlock-api/deadlock-api-rust.git cd deadlock-api-rust -
Install the Protocol Buffers compiler:
# Ubuntu/Debian sudo apt-get install -y protobuf-compiler libprotobuf-dev # macOS brew install protobuf
-
Build the project:
cargo build
The application uses environment variables for configuration. Create a .env file in the project root with the
following variables (adjust as needed):
# General Settings
EMERGENCY_MODE=false
STEAM_API_KEY=your_steam_api_key
INTERNAL_API_KEY=your_internal_api_key
STEAM_PROXY_URL=your_steam_proxy_url
STEAM_PROXY_API_KEY=your_steam_proxy_api_key
# Redis
REDIS_URL=redis://localhost:6379
# S3 Storage
S3_REGION=your_region
S3_BUCKET=your_bucket
S3_ACCESS_KEY_ID=your_access_key
S3_SECRET_ACCESS_KEY=your_secret_key
S3_ENDPOINT=your_endpoint
# S3 Cache
S3_CACHE_REGION=your_region
S3_CACHE_BUCKET=your_bucket
S3_CACHE_ACCESS_KEY_ID=your_access_key
S3_CACHE_SECRET_ACCESS_KEY=your_secret_key
S3_CACHE_ENDPOINT=your_endpoint
# ClickHouse
CLICKHOUSE_HOST=localhost
CLICKHOUSE_HTTP_PORT=8123
CLICKHOUSE_NATIVE_PORT=9000
CLICKHOUSE_USERNAME=default
CLICKHOUSE_PASSWORD=your_password
CLICKHOUSE_DBNAME=default
# PostgreSQL
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USERNAME=postgres
POSTGRES_PASSWORD=your_password
POSTGRES_DBNAME=postgres
POSTGRES_POOL_SIZE=10# Run in development mode
cargo runThe API will be available at http://localhost:3000. The OpenAPI documentation is accessible at http://localhost:3000/docs.
# Build and start the container
docker-compose up -dRun the test suite with:
cargo testContributions are welcome! Here's how you can contribute:
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -am 'Add my feature' - Push to the branch:
git push origin feature/my-feature - Submit a pull request
- Follow the Rust API Guidelines
- Write tests for new features
- Update documentation as needed
- Run
cargo fmtandcargo clippybefore committing
This project is licensed under the MIT License - see the LICENSE file for details.