← OWStats for Twitch

OWStatsfor Twitch

A small Python bot that sits in your Twitch chat and answers questions about ranks, heroes and today's wins. This guide takes you from zero to a running bot in about 5 minutes.

15chat commands
~5 minsetup time
Freeno paid services
1

Install Python

The bot is written in Python, so you need Python 3.10 or newer once. Download it from python.org/downloads and run the installer.

On Windows, tick “Add python.exe to PATH” before clicking Install Now. If you forget it, the bot can't find Python.
2

Download and start

Download owstatsbot.zip and unzip it, for example on your desktop (right-click → Extract all). Open the folder owstatsbot and double-click START.bat.

FileWhat it is
START.batDouble-click this to start the bot
owstatsbot.pyThe bot itself
requirements.txtTells the setup which Python package to install
setup-guide.htmlThis guide

If Windows shows a blue “Windows protected your PC” box, click More info → Run anyway. That happens with every downloaded script, not just this one.

On the first start the bot sets itself up (about a minute) and asks two questions: your Twitch channel name and your BattleTag. Type each one and press Enter.

START.bat, first start
First start: setting up, this takes about a minute ...

  Welcome to OWStats! Two quick questions, then you're done.

  1/2  Your Twitch channel name: your_channel
  2/2  Your BattleTag (e.g. Name#1234): Player#1234
   Found your profile.
  Saved to settings.txt.
Your answers are saved in settings.txt. You can change them there later.
3

Log in with Twitch

Right after the questions, your browser opens Twitch. Log in with the account the bot should chat as and click Authorize. That's the whole login: no token, no copying. The bot remembers it and renews it by itself.

Recommended: a separate bot account

Create a second Twitch account for the bot, for example my_ow_bot. Then the answers show up under the bot's name, and your own account stays out of it. Your browser is probably logged in as you, so open the link the bot shows in a private/incognito window and log in there with the bot account. Using your own account also works.

Twitch login
  TWITCH LOGIN
  Your browser opens Twitch now. Log in with the account the bot should chat as
  (a separate bot account is recommended) and click "Authorize".
  Browser didn't open, or you want another account? Open this link
  in a private/incognito window:  https://www.twitch.tv/activate?...
  Waiting for you ...
  Logged in as my_ow_bot. The bot remembers this, no need to log in again.
Connected to #your_channel as my_ow_bot
Session start saved: 412 wins, 398 losses
“Connected” means the chat side works. “Session start saved” means the stats lookup works too.
4

Make your profile public

The bot reads your stats from your public career profile. If the profile is private, there's nothing to read. In Overwatch, open Options → Social → Career Profile Visibility and set it to Public.

Simplified illustration. The exact layout of the options menu can differ between game versions.

The change often only takes effect after you play one match or log out and back in. Profiles also update a few minutes after each match, not instantly.

5

Test it

Type !owshelp in your chat. The bot answers with a link to all commands. Keep the black window open while you stream; closing it stops the bot.

Type this in your Twitch chat to test!owshelp

Recommended: make the bot a mod

Type /mod my_ow_bot in your chat (with your bot's name). Twitch limits how fast non-mods can post, and mod status avoids that.

Type this in your Twitch chat (with your bot's name)/mod my_ow_bot
That's it.
From now on: double-click START.bat at the start of each stream, so !today counts from the right moment. No questions, no login.

All commands

Upper and lower case don't matter. Every command except !reset has a cooldown (10 seconds by default). If someone tries too early, the bot tells them once how long to wait.

Stats from the streamer's profile

All of these use the BattleTag from your settings.txt. Add someone else's BattleTag to look them up instead, e.g. !profile Name#1234.

Type in chatWhat the bot answers
!rankTank, DPS and Support rank (plus Open Queue if placed)
!rank tankOnly one role. Also works with dps, support, open and short forms like dmg, supp, heal
!mainTop 3 most played heroes with playtime and win rate
!stats <hero>Games, win rate, KDA, playtime and per-10-minute averages, e.g. !stats kiriko
!playtimeTotal playtime, split into Quick Play and Competitive. !playtime ana does the same for one hero.
!rolesWin rate, KDA and playtime for Tank, DPS and Support, plus the best role
!bestCareer records from a single game: most elims, damage, healing, longest kill streak and more
!best <hero>Records on one hero, including hero-specific ones like most enemies slept as Ana
!bestheroHero with the highest win rate (only heroes with at least 5 games count)
!worstHero with the lowest win rate, for some friendly roasting
!profileTitle, endorsement level and when the profile was last updated (!endorse does the same)
!compare Name#1234Win rate, KDA and games played side by side with another player
!todayWins, losses and rank changes since the bot started or the last reset
!resetSets the !today counter back to 0. Streamer and mods only.

Choosing a game mode

Stats commands use Competitive by default (change it with GAMEMODE in settings.txt). Add qp, comp or all to any of !main, !stats, !roles, !best, !besthero, !worst and !compare to switch, for example !main qp or !stats ana all.

Game info

These don't need a profile at all.

Type in chatWhat the bot answers
!hero <hero>Role, HP, home location and abilities of a hero, e.g. !hero ana
!metaTop 5 heroes in Competitive by win rate right now. Narrow it down with a role and a rank: !meta support diamond. Add pick or ban to sort by pick rate or ban rate.
!owshelpPosts a link to the command overview page (set with HELP_URL)
Example answers. The numbers come live from the API, so yours will differ.

Hero nicknames

s76 Soldier: 76, ball or hammond Wrecking Ball, jq Junker Queen, dva D.Va, widow Widowmaker, rein Reinhardt, zen Zenyatta, brig Brigitte, bap Baptiste, torb Torbjörn, sym Symmetra, hog Roadhog, lw Lifeweaver, cass Cassidy, soj Sojourn, doom Doomfist, rama Ramattra, cat Jetpack Cat. All other heroes work with their normal name, accents optional. If you make a typo, the bot suggests the closest hero.

!reset only works for the streamer and mods.

Settings

Everything is optional. Open settings.txt in the bot folder (double-click opens Notepad), change a value, save, and restart the bot.

SettingWhat it does
TWITCH_CHANNELYour channel name, the part after twitch.tv/
BATTLETAGYour BattleTag including the number, with exact upper and lower case
PLATFORMpc or console
GAMEMODEDefault mode for stats commands: competitive or quickplay
REGIONRegion for !meta: europe, americas or asia
COOLDOWN_SECONDSHow long each command is locked after use. Default is 10 seconds, the minimum is 5.
MIN_GAMESHow many games a hero needs to count for !besthero and !worst (default 5)
HELP_URLThe link !owshelp posts in chat (default https://imprala.de/owstats/commands)

To log the bot in with a different Twitch account, delete the data folder in the bot folder and start START.bat again.

How it works

Overwatch has no official stats API. The bot uses the free community project OverFast API, which reads public career profiles and returns them as data.

Twitch chat!rank Your boton your PC OverFast APIcommunity service Career profilemust be public Solid: question goes out. Dashed: answer comes back.
  • The bot runs on your own computer. Nothing is installed on Twitch.
  • !today remembers your total wins and losses when the bot starts and compares them later. That's why it counts from bot start or the last !reset.
  • To go easy on the free API, the bot remembers player stats for 2 minutes, and hero and map info for several hours.
  • The very first lookup of a profile can take up to a minute, because OverFast has to fetch it fresh. After that it's cached and fast. The bot waits up to 60 seconds and retries 3 times.

Troubleshooting

You seeWhat to do
Windows protected your PCClick More info → Run anyway. Windows shows this for every downloaded script.
Python 3.10 or newer is missingInstall Python from python.org and tick “Add python.exe to PATH”. If it's installed already: run the installer again, choose Modify, and tick “Add Python to environment variables”.
Twitch refused the loginThe bot renews the login by itself. If it keeps asking, just log in again in the browser. Nothing to copy.
Logged in with the wrong accountDelete the data folder in the bot folder and start START.bat again. Open the login link in a private window to choose the bot account.
Updating from an older versionYour old .env keeps working. To get the automatic login instead: copy the new files into your bot folder, delete .env and start START.bat.
Player not foundCheck the BattleTag, including upper and lower case. Make sure the profile is public, then play one match. You can test with overfast-api.tekrop.fr/players?name=YourName: if your name shows up there, the listed player_id tells you the exact spelling. After a failed lookup the API waits before asking Blizzard again (10 minutes at first, longer after repeated tries); the bot tells you how long.
The Overwatch API is not respondingUsually the slow first lookup. Wait a minute and try again. If it keeps happening, the OverFast service is overloaded; try later.
Tank: unrankedNormal if you haven't placed in that role this season.
!today shows 0 right after a winBlizzard updates profiles a few minutes after each match. Ask again a bit later.
!rank is on cooldownEach command can only be used once every 10 seconds. The bot tells each person once per cooldown and stays quiet if they keep trying, so chat isn't flooded. You can lower it to 5 seconds, but not below.
← OWStats for Twitch

OWStatsfor Twitch

Ein kleiner Python-Bot, der in deinem Twitch-Chat sitzt und Fragen zu Rängen, Helden und den heutigen Siegen beantwortet. Diese Anleitung bringt dich in etwa 5 Minuten von null zum laufenden Bot.

15Chat-Befehle
~5 minEinrichtung
Gratiskeine Bezahldienste
1

Python installieren

Der Bot ist in Python geschrieben, du brauchst also einmalig Python 3.10 oder neuer. Lade es von python.org/downloads herunter und starte den Installer.

Setz unter Windows das Häkchen bei „Add python.exe to PATH“, bevor du auf Install Now klickst. Vergisst du das, findet der Bot Python nicht.
2

Herunterladen und starten

Lade owstatsbot.zip herunter und entpacke die Datei, zum Beispiel auf deinem Desktop (Rechtsklick → Alle extrahieren). Öffne den Ordner owstatsbot und doppelklicke auf START.bat.

DateiWas sie ist
START.batDoppelklick startet den Bot
owstatsbot.pyDer Bot selbst
requirements.txtSagt der Einrichtung, welches Python-Paket sie installieren soll
setup-guide.htmlDiese Anleitung

Zeigt Windows ein blaues Fenster „Der Computer wurde durch Windows geschützt“, klick auf Weitere Informationen → Trotzdem ausführen. Das passiert bei jedem heruntergeladenen Skript, nicht nur bei diesem.

Beim ersten Start richtet sich der Bot selbst ein (etwa eine Minute) und stellt zwei Fragen: deinen Twitch-Kanalnamen und deinen BattleTag. Tipp jeweils die Antwort ein und drück Enter.

START.bat, erster Start
First start: setting up, this takes about a minute ...

  Welcome to OWStats! Two quick questions, then you're done.

  1/2  Your Twitch channel name: your_channel
  2/2  Your BattleTag (e.g. Name#1234): Player#1234
   Found your profile.
  Saved to settings.txt.
Deine Antworten landen in settings.txt. Dort kannst du sie später ändern.
3

Mit Twitch anmelden

Direkt nach den Fragen öffnet sich dein Browser mit Twitch. Melde dich mit dem Account an, unter dem der Bot schreiben soll, und klick auf Autorisieren. Das ist die ganze Anmeldung: kein Token, nichts kopieren. Der Bot merkt sie sich und erneuert sie selbst.

Empfohlen: ein eigener Bot-Account

Leg einen zweiten Twitch-Account für den Bot an, zum Beispiel my_ow_bot. Dann stehen die Antworten unter dem Namen des Bots, und dein eigener Account bleibt außen vor. Dein Browser ist wahrscheinlich mit deinem Account eingeloggt. Öffne den Link, den der Bot anzeigt, deshalb in einem privaten Fenster (Inkognito) und melde dich dort mit dem Bot-Account an. Mit deinem eigenen Account geht es auch.

Twitch-Anmeldung
  TWITCH LOGIN
  Your browser opens Twitch now. Log in with the account the bot should chat as
  (a separate bot account is recommended) and click "Authorize".
  Browser didn't open, or you want another account? Open this link
  in a private/incognito window:  https://www.twitch.tv/activate?...
  Waiting for you ...
  Logged in as my_ow_bot. The bot remembers this, no need to log in again.
Connected to #your_channel as my_ow_bot
Session start saved: 412 wins, 398 losses
„Connected“ heißt: Der Chat funktioniert. „Session start saved“ heißt: Die Stats-Abfrage funktioniert auch.
4

Profil öffentlich stellen

Der Bot liest deine Stats aus deinem öffentlichen Karriereprofil. Ist das Profil privat, gibt es nichts zu lesen. Öffne in Overwatch Optionen → Soziales → Sichtbarkeit des Karriereprofils und stell es auf Öffentlich.

Vereinfachte Darstellung. Das Optionsmenü kann je nach Spielversion und Sprache etwas anders aussehen.

Die Änderung greift oft erst, nachdem du ein Match gespielt oder dich einmal ab- und wieder angemeldet hast. Profile aktualisieren sich außerdem erst ein paar Minuten nach jedem Match, nicht sofort.

5

Testen

Tipp !owshelp in deinen Chat. Der Bot antwortet mit einem Link zu allen Befehlen. Lass das schwarze Fenster offen, solange du streamst. Schließt du es, ist der Bot aus.

Zum Testen in deinen Twitch-Chat tippen!owshelp

Empfohlen: Bot zum Mod machen

Tipp /mod my_ow_bot in deinen Chat (mit dem Namen deines Bots). Twitch begrenzt, wie schnell Nicht-Mods schreiben dürfen, und mit Mod-Status fällt das weg.

In deinen Twitch-Chat tippen (mit dem Namen deines Bots)/mod my_ow_bot
Fertig.
Ab jetzt gilt: Zu Beginn jedes Streams START.bat doppelklicken, damit !today ab dem richtigen Moment zählt. Keine Fragen, keine Anmeldung.

Alle Befehle

Groß- und Kleinschreibung ist egal. Jeder Befehl außer !reset hat einen Cooldown (standardmäßig 10 Sekunden). Wer es zu früh versucht, bekommt einmal gesagt, wie lange er warten muss.

Stats aus dem Profil des Streamers

Alle nutzen den BattleTag aus deiner settings.txt. Hängst du einen anderen BattleTag an, bekommst du dessen Daten, z. B. !profile Name#1234.

Im Chat tippenWas der Bot antwortet
!rankRang in Tank, DPS und Support (plus Open Queue, falls platziert)
!rank tankNur eine Rolle. Geht auch mit dps, support, open und Kurzformen wie dmg, supp, heal
!mainDie 3 meistgespielten Helden mit Spielzeit und Winrate
!stats <hero>Spiele, Winrate, KDA, Spielzeit und Durchschnitt pro 10 Minuten, z. B. !stats kiriko
!playtimeGesamtspielzeit, aufgeteilt in Quick Play und Competitive. !playtime ana macht das für einen Helden.
!rolesWinrate, KDA und Spielzeit für Tank, DPS und Support, plus die beste Rolle
!bestRekorde aus einem einzelnen Match: meiste Elims, Schaden, Heilung, längster Killstreak und mehr
!best <hero>Rekorde auf einem Helden, inklusive heldenspezifischer, z. B. meiste eingeschläferte Gegner als Ana
!bestheroHeld mit der höchsten Winrate (es zählen nur Helden mit mindestens 5 Spielen)
!worstHeld mit der niedrigsten Winrate, für ein bisschen freundliches Aufziehen
!profileTitel, Endorsement-Level und wann das Profil zuletzt aktualisiert wurde (!endorse macht dasselbe)
!compare Name#1234Winrate, KDA und Anzahl Spiele im Vergleich mit einem anderen Spieler
!todaySiege, Niederlagen und Rangänderungen seit dem Bot-Start oder dem letzten Reset
!resetSetzt den !today-Zähler auf 0 zurück. Nur Streamer und Mods.

Spielmodus wählen

Stats-Befehle nutzen standardmäßig Competitive (änderbar mit GAMEMODE in der settings.txt). Häng qp, comp oder all an !main, !stats, !roles, !best, !besthero, !worst oder !compare an, um zu wechseln, z. B. !main qp oder !stats ana all.

Spielinfos

Die brauchen gar kein Profil.

Im Chat tippenWas der Bot antwortet
!hero <hero>Rolle, HP, Herkunft und Fähigkeiten eines Helden, z. B. !hero ana
!metaDie aktuellen Top 5 Helden in Competitive nach Winrate. Mit Rolle und Rang eingrenzen: !meta support diamond. Mit pick oder ban nach Pick- bzw. Banrate sortieren.
!owshelpPostet einen Link zur Befehlsübersicht (einstellbar mit HELP_URL)
Beispielantworten. Die Zahlen kommen live von der API, bei dir sehen sie also anders aus.

Helden-Spitznamen

s76 Soldier: 76, ball oder hammond Wrecking Ball, jq Junker Queen, dva D.Va, widow Widowmaker, rein Reinhardt, zen Zenyatta, brig Brigitte, bap Baptiste, torb Torbjörn, sym Symmetra, hog Roadhog, lw Lifeweaver, cass Cassidy, soj Sojourn, doom Doomfist, rama Ramattra, cat Jetpack Cat. Alle anderen Helden gehen mit ihrem normalen Namen, Akzente sind optional. Bei einem Tippfehler schlägt der Bot den passenden Helden vor.

!reset funktioniert nur für den Streamer und die Mods.

Einstellungen

Alles optional. Öffne settings.txt im Bot-Ordner (Doppelklick öffnet den Editor), ändere einen Wert, speichere und starte den Bot neu.

EinstellungWas sie macht
TWITCH_CHANNELDein Kanalname, der Teil nach twitch.tv/
BATTLETAGDein BattleTag inklusive Nummer, mit exakter Groß- und Kleinschreibung
PLATFORMpc oder console
GAMEMODEStandardmodus für Stats-Befehle: competitive oder quickplay
REGIONRegion für !meta: europe, americas oder asia
COOLDOWN_SECONDSWie lange jeder Befehl nach Benutzung gesperrt ist. Standard 10 Sekunden, Minimum 5.
MIN_GAMESWie viele Spiele ein Held für !besthero und !worst braucht (Standard 5)
HELP_URLDer Link, den !owshelp im Chat postet (Standard https://imprala.de/owstats/commands)

Um den Bot mit einem anderen Twitch-Account anzumelden, lösch den Ordner data im Bot-Ordner und starte START.bat neu.

So funktioniert es

Für Overwatch gibt es keine offizielle Stats-Schnittstelle. Der Bot nutzt das kostenlose Community-Projekt OverFast API, das öffentliche Karriereprofile ausliest und als Daten zurückgibt.

Twitch-Chat!rank Dein Botauf deinem PC OverFast APICommunity-Dienst Karriereprofilmuss öffentlich sein Durchgezogen: Frage geht raus. Gestrichelt: Antwort kommt zurück.
  • Der Bot läuft auf deinem eigenen Computer. Auf Twitch wird nichts installiert.
  • !today merkt sich beim Start deine Gesamtzahl an Siegen und Niederlagen und vergleicht später damit. Deshalb zählt es ab dem Bot-Start oder dem letzten !reset.
  • Um die kostenlose API zu schonen, speichert der Bot Spielerstats 2 Minuten und Helden- und Karteninfos mehrere Stunden zwischen.
  • Die allererste Abfrage eines Profils kann bis zu einer Minute dauern, weil OverFast es frisch holen muss. Danach ist es zwischengespeichert und schnell. Der Bot wartet bis zu 60 Sekunden und versucht es 3-mal.

Problemlösung

Du siehstWas du tun kannst
Windows protected your PCKlick auf Weitere Informationen → Trotzdem ausführen. Windows zeigt das bei jedem heruntergeladenen Skript.
Python 3.10 or newer is missingInstalliere Python von python.org und setz den Haken bei „Add python.exe to PATH“. Ist es schon installiert: Installer erneut starten, Modify wählen und „Add Python to environment variables“ anhaken.
Twitch refused the loginDer Bot erneuert die Anmeldung selbst. Fragt er trotzdem immer wieder, melde dich einfach erneut im Browser an. Nichts zu kopieren.
Mit dem falschen Account angemeldetLösch den Ordner data im Bot-Ordner und starte START.bat neu. Öffne den Anmeldelink in einem privaten Fenster, um den Bot-Account zu wählen.
Update von einer älteren VersionDeine alte .env funktioniert weiter. Für die automatische Anmeldung: neue Dateien in den Bot-Ordner kopieren, .env löschen und START.bat starten.
Player not foundPrüf den BattleTag inklusive Groß- und Kleinschreibung. Stell sicher, dass das Profil öffentlich ist, und spiel dann ein Match. Testen kannst du mit overfast-api.tekrop.fr/players?name=DeinName: Taucht dein Name dort auf, zeigt die player_id die genaue Schreibweise. Nach einer erfolglosen Suche wartet die API, bevor sie Blizzard erneut fragt (anfangs 10 Minuten, bei wiederholten Versuchen länger), der Bot sagt dir, wie lange.
The Overwatch API is not respondingMeist die langsame erste Abfrage. Warte eine Minute und versuch es erneut. Passiert das ständig, ist der OverFast-Dienst überlastet, dann später nochmal probieren.
Tank: unrankedNormal, wenn du in dieser Rolle in der aktuellen Season noch nicht platziert bist.
!today zeigt direkt nach einem Sieg 0Blizzard aktualisiert Profile erst ein paar Minuten nach jedem Match. Frag etwas später nochmal.
!rank is on cooldownJeder Befehl geht standardmäßig nur alle 10 Sekunden. Der Bot sagt jeder Person einmal pro Cooldown Bescheid und schweigt bei weiteren Versuchen, damit der Chat nicht vollläuft. Runter auf 5 Sekunden geht, weniger nicht.