Transformice Api !link! Site

Mastering the Cheese: A Deep Dive into the Transformice API If you’ve ever wanted to track your stats, build a custom leaderboard, or create a unique tribe tool, the Transformice API is your ticket to the back-end of the cheese-loving universe. Developed by Atelier 801, this API allows the community to pull real-time data from the game and build the fansites we all rely on.

Here is everything you need to know about getting started with the Transformice API and the tools available to you. What is the Transformice API?

The Transformice API (often called the Web API) is a set of interfaces provided by Atelier 801 that allows developers to access game-specific data. Instead of manual scraping, the API provides a structured way to retrieve:

Player Profiles: Stats like cheese gathered, firsts, and shaman saves.

Leaderboards: Global and local rankings for various game modes. Tribe Data: Member lists and tribe house statistics.

Wardrobes & Skill Trees: Visual data on mouse customization and shaman progress. Lua vs. The Web API

It’s important to distinguish between the two ways you can "code" for Transformice:

Lua Scripting: Used inside the game to create custom room modules, mini-games, and tribe house scripts. You can find the latest functions by typing /luahelp in-game or checking the Transformice Wiki.

Web API: Used outside the game (on websites or apps) to fetch data from the servers for display on external platforms. Popular Community Projects

The API has birthed some incredible community-led projects that have become staples of the game:

Micetigri: One of the most famous fansites that utilizes the API to show 30-day stat evolutions, title progression, and detailed player wardrobes.

Discord Bots: Many tribes use the API to create Discord integrations that announce when a member hits a milestone or to display a "shaman of the week." transformice api

Leaderboard Trackers: Sites that archive the Top 1000 players globally, providing historical data that the game client doesn't store. How to Get Started

If you’re a developer looking to build your own tool, start here:

Documentation: Keep an eye on the Atelier 801 Forums, specifically the "API" and "Lua" sections, where developers share library updates and wrapper code.

Community Libraries: Look for Python or Node.js wrappers on GitHub that simplify the process of connecting to the game's socket servers.

Respect the Rate Limits: Like any API, Atelier 801 has limits. Ensure your tool doesn't spam the servers, or your IP might get blocked. Final Thoughts

The Transformice API is what keeps the community vibrant outside of the game client. Whether you're a casual player checking your progress on Micetigri or a coder building the next big module, the API opens up a world of possibilities beyond just collecting cheese.

Are you planning to build a tool or looking for a specific stat tracker? Let me know, and I can help you find the right resources!

The Transformice API, primarily referred to as the Module API, is a Lua-based scripting system that allows players to create custom minigames (modules) directly within the game environment. Unlike external bots, these modules run natively on the game's servers, enabling developers to modify game physics, handle player interactions, and create unique objectives. Core Functionality

The API operates on an event-driven model, where specific Lua functions are triggered by in-game actions:

Player Input: eventChatCommand detects "!" commands in chat, while eventKeyboard and eventMouse track physical inputs.

Game State: eventNewGame triggers when a new map loads, and eventLoop runs every 500 milliseconds to handle continuous logic. Mastering the Cheese: A Deep Dive into the

Interactions: Events like eventEmotePlayed allow scripts to respond to player animations. Types of Modules

Modules are categorized based on their status and accessibility:

Official Modules: Approved by Administrators and featured in the game's room list (e.g., #survivor or #racing). Players can earn shop cheese in these rooms.

Semi-Official Modules: Verified utilities or games that can be loaded in tribe houses but require a member of the Module Team to host them.

User Scripts: Custom scripts that players can run in their own private rooms or tribe houses for testing and casual play. Development Resources

Documentation: The official Module FAQ & Documentation on the Atelier 801 forums provides the standard starting point for developers.

Community Projects: Libraries like Transfromage provide external API access for bot development, though they require specific encryption tokens.

Shared Scripts: Many developers host ready-to-run scripts on GitHub, covering game modes from "Pacmice" to complex competitive variants. Getting Started

To begin coding, players typically use the /lua command in a room where they have permissions (like a tribe house) to paste and execute their scripts. For those looking for inspiration, the Transformice Wiki maintains an unofficial but detailed guide on event arguments and function descriptions. transformice · GitHub Topics


Authentication

To use the official API, you must generate an API key. This usually requires logging into your account on the official forums or developer section. You must include this key in your request headers.

Practical Uses of the Web API

Note: Because these endpoints are unofficial, they are fragile. A single game update from Atelier 801 can break every bot and website relying on them. Authentication To use the official API, you must

1. Player Profile Lookup

Used to get a player’s ID and rank. GET https://transformice.com/en/api/profile/username/[NAME]

Response (JSON):


  "success": true,
  "player_id": 1234567,
  "nickname": "CheeseMaster",
  "registration_date": "2012-05-14",
  "is_vip": false

How it’s implemented (high-level)

  1. Protocol reverse-engineering
    • Developers inspect the official client’s network traffic to learn packet structure, opcodes, and serialization formats.
    • Packets typically use binary framing over TCP or WebSocket (depending on client version).
  2. Libraries and bots
    • Community libraries implement handshake/authentication, event loop, and handlers for room/player actions.
    • Bots connect like a regular client, listen for events, and send commands encoded in the same packet format.
  3. Web scraping / HTTP endpoints
    • Some public data (profiles, rankings) is served as HTML or JSON endpoints; scrapers or HTTP clients extract fields.
  4. Private servers
    • Reimplementation of the server-side logic to accept client connections and manage rooms, maps, and events.

2. tfm.get (The Data Fetcher)

Retrieves the current state of the room.

4.2 Item Icons

GET https://transformice.com/images/items/[id].png

Example: id=3 → plank sprite

4. Building Your Own Transformice Bot (A Practical Guide)

For developers, creating a bot that interacts with Transformice is a rite of passage. Here is a high-level overview using Node.js or Python.

5. Practical Implementation Example (Node.js)

const WebSocket = require('ws');

const ws = new WebSocket('wss://transformice.com/game');

ws.on('open', () => ws.send('v2'); ws.send('aMyBot'); ws.send('pen'); );

ws.on('message', (data) => const msg = data.toString(); const cmd = msg.substring(0, 1);

switch(cmd) 
    case 'l': // login success
        console.log('Connected');
        ws.send('jFunRoom');
        break;
    case 'M': // chat
        const [id, text] = msg.substring(1).split(']');
        console.log(`Player $id: $text`);
        break;
    case 'C': // cheese count
        console.log(`Cheese collected: $msg.substring(1)`);
        break;

);