Skip to content

Web API

Jacek edited this page Jan 11, 2014 · 8 revisions

The web API provides some limited access to the features of minebans.com. A small Java library is being developed to provide an interface to this API, more details can be found on the GitHub page for it.

Server Moderators

You can get a list of users that have moderator access to a server by making a HTTP GET request for

http://minebans.com/feed/server_moderators.json?api_key=YOUR_SERVERS_API_KEY

replacing YOUR_SERVERS_API_KEY with the api key of the server you are requesting data for.

This will result in a JSON encoded array of all moderator player names.

If you are using PHP on your website, you can get this data and convert it into an array like so

$data = file_get_contents('http://minebans.com/feed/server_moderators.json?api_key=' . $api_key);
$mods = json_decode($data, true);

The $mods array will now look something like this

Array
(
    [0] => wide_load
    [1] => Silken_thread
    [2] => jobud9
)

Server Bans

You can get a list of all of the bans that a specific server has made by making a HTTP GET request for

http://minebans.com/feed/server_bans.json?api_key=YOUR_SERVERS_API_KEY

replacing YOUR_SERVERS_API_KEY with the api key of the server you are requesting data for.

This will result in a JSON encoded array of all bans made (including any evidence that was collected).

If you are using PHP on your website, you can get this data and convert it into an array like so

$data = file_get_contents('http://minebans.com/feed/server_bans.json?api_key=' . $api_key);
$bans = json_decode($data, true);

The $bans array will now look something like this

Array
(
    [0] => Array
        (
            [player_name] => xyzdaniel123
            [issued_by] => wide_load
            [server_name] => SomethingCraft
            [time] => 1331943266
            [reason] => Stealing
            [long_reason] => Stealing from another player
            [evidence] => Array
                (
                    [17] => -16
                )

        )

    [1] => Array
        (
            [player_name] => mick1234
            [issued_by] => wide_load
            [server_name] => SomethingCraft
            [time] => 1331942641
            [reason] => Griefing
            [long_reason] => Destroying another players building
            [evidence] => Array
                (
                    [broken] => Array
                        (
                            [102] => 2
                            [50] => 3
                            [53] => 1
                        )

                    [placed] => Array
                        (
                            [50] => 3
                            [53] => 1
                        )

                )

        )

)

Player Bans

A list of all bans including the supporting evidence can be fetched by making a HTTP GET request for

http://minebans.com/feed/player_bans.json?player_uuid=PLAYER_UUID

replacing PLAYER_UUID with the Mojang account ID of the player you want to look up. This will return a JSON encoded array of all of the players bans.

If you are using PHP on your website, you can get this data and convert it into an array like so

$data = file_get_contents('http://minebans.com/feed/player_bans.json?player_uuid=' . $player_uuid);
$bans = json_decode($data, true);

The $bans array will then look something like this

Array
(
    [0] => Array
        (
            [player_name] => peterkiller125
            [player_uuid] => 65064a8733404585a7b9a5ec83f4f220
            [issued_by] => wide_load
            [server_name] => SomethingCraft
            [time] => 1350137176
            [reason] => Griefing
            [long_reason] => Destroying another players building
            [evidence] => Array
                (
                    [broken] => Array
                        (
                            [68] => 8
                            [1] => 1454
                        )

                    [placed] => Array
                        (
                            [68] => 7
                            [35] => 28
                            [3] => 300
                        )

                )

        )

)
Clone this wiki locally