Skip to main content
Pokémon Showdown’s protocol is a newline-and-pipe-delimited text stream that enables communication between clients and servers, as well as battle simulation.

Connection Methods

Pokémon Showdown is implemented using SockJS, a compatibility layer over raw WebSocket. You can connect directly using WebSocket:
ws://sim.smogon.com:8000/showdown/websocket
or with SSL:
wss://sim3.psim.us/showdown/websocket

Protocol Structure

Client-to-Server

Messages sent from clients to the server follow a simple ROOMID|TEXT format

Server-to-Client

Messages from the server include room identifiers and pipe-delimited data blocks

Battle Protocol

Battle-specific messages use a specialized format for game state updates

Choice Requests

JSON-based requests for player decisions during battles

Message Format Basics

Server Messages

Server-to-client messages follow this structure:
>ROOMID
MESSAGE
MESSAGE
MESSAGE
...
The >ROOMID line can be omitted if the room is lobby or global. Empty lines should be ignored.
Most messages start with | and follow the pattern:
|TYPE|DATA

Client Messages

Messages from clients to the server use:
ROOMID|TEXT
ROOMID can be left blank if unneeded. Responses will be sent to a PM box with no username.
TEXT can contain newlines, which will be treated as if each line were sent separately.

Message Type Abbreviations

For bandwidth efficiency, five common message types are abbreviated:
Full TypeAbbreviatedDescription
chatcChat messages
joinjUser joined
leavelUser left
namenName change
battlebBattle started
Uppercase versions (J, L, N, B) indicate high-frequency events that clients may want to suppress from inline display.

Example Message Flow

Here’s what a typical chat room interaction looks like:
|j| Some dude
|c|@Moderator|hi!
|c| Some dude|you suck and i hate you!
Some dude was banned by Moderator.
|l| Some dude
|b|battle-ou-12| Cool guy|@Moderator
This might be displayed as:
Some dude joined.
@Moderator: hi!
Some dude: you suck and i hate you!
Some dude was banned by Moderator.
Some dude left.
OU battle started between Cool guy and Moderator

Debugging

The official client logs protocol messages in the JavaScript console (F12 in most browsers), which helps understand what’s happening during gameplay.

Client Implementations

Reference implementations are available in multiple languages:

Official Client

HTML5 + JavaScript implementationView on GitHub

Android Client

Kotlin/Java implementation by MajeurView on GitHub

Node.js Bot

Chat bot by Quinella and TalkTakesTimeView on GitHub

Ruby Bot

Chat bot by pickdenisView on GitHub

Next Steps

Client-Server Messages

Learn about room messages, authentication, and server commands

Battle Protocol

Understand battle-specific messages and game state updates

Choice Requests

Handle player decisions and move selections

Build docs developers (and LLMs) love