Pokeitbot API Reference


Pokeitbot is designed so that it can be run on your channel by itself, as well as alongside other bots. If you're interested in integrating Pokeitbot with another chat service (such as Nightbot), you can set up custom commands that refer to URLs on https://api.pokeit.co/. The commands below can then be added on to the end of that address to create a URL like this:

https://api.pokeit.co/@ChazDazzle/session

Note that these URLs will only work if you're currently streaming on Pokeit!

Set up API access

API access to your session's data is disabled by default. If you'd like to turn it on, go to your Pokeit Account page, select "Live Streaming" from the side menu, and then toggle on the switch for "Enable Pokeit API".

Example Endpoints

Click on the in each row below to see a sample response from that command. Items inside curly brackets such as {player}, {stat}, or {num} are "dynamic inputs" that can be replaced with actual values. For example, @ChazDazzle/hand/{num} becomes @ChazDazzle/hand/25 to access the 25th hand of the session. Only players, hands, stats, and other dynamic items that are present in the current live session will be accessible via this API.

URL

Description

Ex.

@ChazDazzle/viz/{viz}gives a link to the visualization with the following name.
@ChazDazzle/biggest
@ChazDazzle/biggest/{num}
gives a link to the biggest hand won this session.
gives a link to the {num}-th biggest hand won this session.

@ChazDazzle/commandsgives the list of active commands that Pokeitbot will respond to.
@ChazDazzle/def/{stat}gives a description of this stat.
@ChazDazzle/graphsgives a list of links to all the individual graphs currently being streamed.
@ChazDazzle/hand
@ChazDazzle/hand/{num}
@ChazDazzle/hand/{id}
gives a link to the most recent hand played this session.
gives a link to the {num}-th hand played this session.
gives a link to the hand with following id.


@ChazDazzle/handsgives a list of links to all the hands based visualizations currently being streamed
@ChazDazzle/lag/{+/-seconds}add or subtract seconds from the twitch lag
@ChazDazzle/livegives a link to your live Pokeit page.
@ChazDazzle/loserslists the biggest losing players in the session
@ChazDazzle/player/{player}gives information about a player's results this session
@ChazDazzle/playersgives a list of the most recently seen opponents
@ChazDazzle/pokeitexplains to a curious viewer of your stream what Pokeit is and how Pokeitbot works.
@ChazDazzle/profitgives the net profit/losses during this session.
@ChazDazzle/reportsgives a list of links to all the individual reports currently being streamed.
@ChazDazzle/sessiongives number of hands, net profit/loss, and other stats for this session.
@ChazDazzle/stats
@ChazDazzle/stats/{player}
@ChazDazzle/stats/{stat}
@ChazDazzle/stats/{player}/{stat}
gives the list of stats currently being tracked in this session.
gives all hud stats for this player.
gives this stat for all recent players.
gives this stat for just this player.



@ChazDazzle/table/{table}gives more details about your performance at a particular table this session.
@ChazDazzle/tablesgives a list of tables played at this session.
@ChazDazzle/tourney
@ChazDazzle/tourney/{num}
@ChazDazzle/tourney/{id}
gives more details about your most recently finished tournament this session.
gives more details about the {num}-th tournament you started this session.
gives more details about the tournament with the following id.


@ChazDazzle/tourneysgives a list of links to all the tournament based visualizations currently being streamed
@ChazDazzle/visualizationsgives a list of links to all the individual visualizations currently being streamed.
@ChazDazzle/winnerslists the top winning players in the session
@ChazDazzle/worst
@ChazDazzle/worst/{num}
gives a link to the biggest hand lost this session.
gives a link to the {num}-th biggest hand lost this session.

Usage With NightBot

There are two ways to add a Pokeitbot API command to NightBot. First, you can create a custom command by clicking the "Add Command" button on your commands page and then typing in "urlfetch" along with the Pokeit API endpoint. Examples can be found inside the $(..) portion of the commands below

Alternatively, if you already have NightBot active in your room, you can just paste one of the lines of code below right into chat and NightBot will take care of the rest. This will need to be done for each command you want to add.

Basic Commands

To add the "session" endpoint to NightBot, use the command:

!addcom !rel $(urlfetch https://api.pokeit.co/@ChazDazzle/session)

You can then switch out @ChazDazzle/session with one of the other endpoints above.

Commands with Dynamic Inputs

If one of the endpoints has a dynamic input like {player}, {stat}, or {num}, replace that part of the NightBot command with a $(1). This will allow NightBot to pass along something like a player name or stat name without you needing to input each one separately. For example:

!addcom !rel $(urlfetch https://api.pokeit.co/@ChazDazzle/hand/$(1))

This will allow the text "!hand 25" to return the 25th hand in your session (or any other number). Commands with multiple dynamic inputs can use $(1), $(2), etc.