Skip to content

Work in progress

This documentation page is currently work in progress.
Not all existing DecAPI endpoints are documented here yet. For the currently active documentation, please visit docs.decapi.me.

Query a server's current player count (PC)

Returns the current player count for a specific server.
For instance, a server with currently 4 players out of a maximum of 60 players will return: 4/60

Note: This may support servers for other games using the Steam query protocol, but has only really been tested with DayZ servers. Your mileage may vary.

Endpoint URL

https://decapi.me/dayz/players?ip=127.0.0.1&port=2302&query=27016

Query parameters

If you're not sure what the query port is for your server, you can use my DayZ server search website and use the "Query port" column to figure it out.

  • ip - Required - The IP address of the server.
  • port - Required - The game port of the server.
  • query - Optional - The query port of the server.
    • If the query port is not specified, it will default to "game port plus 24714". For example: 2302 + 24714 = 27016
    • However, if this calculation does not work for your server, you need to specify the query port manually. A valid query port is necessary to get the player count.

Example

Examples for bots

Nightbot

Note: Nightbot will automatically convert variables, such as $(channel) or $(touser) to the correct channel name / username, when the command is used.
You do not have to change those variables.

Fossabot

Note: Fossabot will automatically convert variables, such as $(channel) or $(user.login) to the correct channel name / username, when the command is used.
You do not have to change those variables.

StreamElements

Note: StreamElements will automatically convert variables, such as ${channel} or ${touser} to the correct channel name / username, when the command is used.
You do not have to change those variables.

Streamlabs Chat Bot

Note: Streamlabs Chat Bot will automatically convert variables, such as $mychannel or $touserid to the correct channel name / username, when the command is used.
You do not have to change those variables.

Streamlabs Cloudbot

Note: Streamlabs Cloudbot will automatically convert variables, such as {channel.name} or {touser.name} to the correct channel name / username, when the command is used.
You do not have to change those variables.

Deepbot

Note: Deepbot will automatically convert variables, such as @stream@ or @user@ to the correct channel name / username, when the command is used.
You do not have to change those variables.

PhantomBot

Note: PhantomBot will automatically convert variables, such as (channelname) or (touser) to the correct channel name / username, when the command is used.
You do not have to change those variables.