PythBots API
Access PythBots features programmatically using simple HTTPS endpoints.
These APIs let you:
- Look up users
- Get chat staff and ranks
- View chat statistics
- Send and read in-system mail
user(required) — Username (example:tiro) OR user ID (example:221192)chatid(required) — Numeric chat IDchatid(required) — Numeric chat IDpersonalkey(required) — Your personal keyuser(required) — Target usernamemessage(required) — Message textpersonalkey(required) — Your personal keyid(required) — Target user IDmessage(required) — Message textpersonalkey(required) — Your personal keyreadnew(flag) — Include exactly like&readnewpersonalkey(required) — Your personal keyreadall(flag) — Include exactly like&readall- URL parameters must be URL-encoded
- Avoid sending too many requests too fast to prevent rate limiting
- Keep your personal key private — it grants access to your mail
Authentication
Most endpoints do NOT require any key.
Only the Mail API requires a personalkey.
1. Go to https://xat.com/pythbots
2. Type the command:
!link 3. The bot will send you a private chat (PC) with your personal key.
Endpoints
User Info
Get profile information for a user by xat username or numeric ID.
Endpoint GET https://pythbots.com/api/userinfo.php?user=$usernameorid
What it does
Returns detailed user data including username, nickname, avatar, powers, chats, rank, and live online status.
Parameters
Example https://pythbots.com/api/userinfo.php?user=tiro
Chat Rank Info
Get staff members and ranks for a chat.
Endpoint GET https://pythbots.com/api/crank.php?chatid=$chatid
What it does
Returns a list of staff members (Main Owner, Owner, Moderator) for a chat, including time held and avatar.
Parameters
Example https://pythbots.com/api/crank.php?chatid=220531305
Chat Stats
Get message counts, user activity, and usage data for a chat.
Endpoint GET https://pythbots.com/api/cstats.php?chatid=$chatid
What it does
Returns chat-level message totals, active users, and usage statistics.
Parameters
Example https://pythbots.com/api/cstats.php?chatid=220531305
Mail API
personalkey.Send Mail (by username)
Send an encrypted message to another user using their username.
Endpoint GET https://pythbots.com/api/mail.php?personalkey=$personalkey&user=$username&message=$message
What it does
Sends a private in-system message to a user by username.
Parameters
Example https://pythbots.com/api/mail.php?personalkey=YOURKEY&user=tiro&message=Hello
Send Mail (by user ID)
Send an encrypted message to another user using their numeric user ID.
Endpoint GET https://pythbots.com/api/mail.php?personalkey=$personalkey&id=$userid&message=$message
What it does
Sends a private in-system message using the target user’s numeric ID.
Parameters
Example https://pythbots.com/api/mail.php?personalkey=YOURKEY&id=221192&message=Hello
Get New Mail
Retrieve all unread mail messages.
Endpoint GET https://pythbots.com/api/mail.php?personalkey=$personalkey&readnew
What it does
Returns all unread messages for your account.
Parameters
Example https://pythbots.com/api/mail.php?personalkey=YOURKEY&readnew
Get All Mail
Retrieve all messages (read and unread).
Endpoint GET https://pythbots.com/api/mail.php?personalkey=$personalkey&readall
What it does
Returns your entire mail history, including both read and unread messages.
Parameters
Example https://pythbots.com/api/mail.php?personalkey=YOURKEY&readall