tetr-ch-rs

A Rust wrapper for the TETRA CHANNEL API.
You can get the following data by using this library:
- Detailed user information
- User's summaries
- 40 LINES
- BLITZ
- QUICK PLAY
- EXPERT QUICK PLAY
- TETRA LEAGUE
- ZEN
- Achievements
- User leaderboards
- User records
- Record leaderboards
- Rank metadata
- and more...
Also you can:
- Search for TETR.IO accounts by social connections.
- Search for record by user ID and timestamp.
[!WARNING]
This library is not an officially provided wrapper.
TETR.IO is an ongoing project in continuous development. The TETRA CHANNEL API may change with or without notice between updates. So this wrapper may be outdated in the future.
Usage of the TETRA CHANNEL API does not require an account or bot account. Please do note that requests are logged. Some simple rules:
- Do not flood the API with requests. This should be obvious, but just to be sure. Please keep the amount of requests at a moderate rate - once a second should be fine for most cases, short bursts are OK. Please consider other users!
- Honor caching data. If a response indicates its cache will expire after 10 minutes, please do not rerequest the data during that time, as the data should not change in that time, assuming you are sending an
X-Session-IDheader.- Send an
X-Session-IDheader if you are often rerequesting the same datasets. This not only assures the data you receive is consistent, it also helps reduce database calls on our side.- Don't use a
X-Session-IDheader for requests that are not related. That way, load balancing can function as expected.- Do not use the API in ways that break the TETR.IO Terms of Service. Should be obvious.
Installation
Run the following Cargo command in your project directory:
Examples
The following example is a template for getting user details.
use *;
async
All the examples can be found in the examples directory.
For more information about this library, see the documentation.