The API primarily communicates via structured objects. Below is a conceptual example of a payload returned when querying a player profile endpoint:

"

As of 2025, Transformice has transitioned from Flash to HTML5/WebGL. This transition broke many legacy API tools, but it also opened new possibilities:

┌────────────────────────────────────────────────────────┐ │ Transformice Game Client │ └───────────────────────────┬────────────────────────────┘ │ (Triggers Events) ▼ ┌────────────────────────────────────────────────────────┐ │ Transformice Module API │ │ • eventLoop() • eventChatCommand() │ │ • eventKeyboard() • eventNewGame() │ └───────────────────────────┬────────────────────────────┘ │ (Executes Custom Code) ▼ ┌────────────────────────────────────────────────────────┐ │ Lua Runtime Engine │ │ • Spawns Shaman Objects • Renders Custom UI Windows │ │ • Alters Room Physics • Manages Game State Data │ └────────────────────────────────────────────────────────┘

, which allows you to create custom minigames (modules) or tribe house scripts. To display and manipulate text within the game, you use the tfm.enum.addTextArea function and its related events. Transformice Wiki Creating a Text Area

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

(anchor) tag with a custom event name. When a player clicks it, the eventTextAreaCallback is triggered. Transformice Wiki Define the Link: Wrap your text in Text Handle the Click:

Inside the game, modules like tfm.get.room provide direct access to live room data, including: Player positions and scores. Current map codes and authors. Shaman mechanics and object spawning properties. Best Practices and Safety Guidelines

Writing a packet encoder and decoder from scratch in raw TCP can take weeks. Fortunately, seasoned community developers have built robust open-source wrappers across multiple programming languages. Aiotf (Python)

Modules are categorized based on their status and accessibility:

Do not spam the authentication or game servers with rapid requests. Limit your network calls to prevent unintentional Distributed Denial of Service (DDoS) behavior.

and have a clean record (no active hack bans) to use these features. Draft Implementation Example (Lua) This simple script greets any player who joins the room: eventNewPlayer(playerName) tfm.exec.chatMessage( "Welcome to the room, " .. playerName .. , playerName) Use code with caution. Copied to clipboard or a guide on setting up a Python-based bot Lua | Transformice Wiki | Fandom

import asyncio async def connect_tf_server(): server_address = '://transformice.com' port = 443 print(f"Connecting to server_address:port...") reader, writer = await asyncio.open_connection(server_address, port) # Example raw handshake placeholder (requires specific game bytecode) # handshake_packet = b'\x1c\x01...' # writer.write(handshake_packet) # await writer.drain() print("Connection established. Listening for packets...") writer.close() await writer.wait_closed() asyncio.run(connect_tf_server()) Use code with caution. 4. Utilizing the In-Game Lua API

getPlayerStats("ExampleUser");

Historically, developers relied heavily on community-driven scrapers or the Transformice Forum API . Today, modern implementations combine official endpoints with robust community libraries (like transformice.js or Python-based wrappers) to handle data fetching safely and efficiently. Key Capabilities and Use Cases

This is the official way to create custom game modes (Modules) or scripts for tribe houses. It uses a sandboxed version of Lua. Capabilities

Complete Your Purchase